File
[ class tree: File ] [ index: File ] [ all elements ]

Class: File_Module

Source Location: /file.php

Class Overview

Module_Skeleton
   |
   --File_Module



Variables

Methods



Class Details

[line 8]


[ Top ]


Class Variables

$acl_cache =

[line 17]



Tags:

access:  protected

Type:   mixed


[ Top ]

$compression_instances =

[line 14]



Tags:

access:  protected

Type:   mixed


[ Top ]

$mysql =

[line 9]



Tags:

access:  public

Type:   mixed


[ Top ]

$pgsql =

[line 10]



Tags:

access:  public

Type:   mixed


[ Top ]

$quota_cache =

[line 12]



Tags:

access:  protected

Type:   mixed


[ Top ]

$registered_extensions =

[line 13]



Tags:

access:  protected

Type:   mixed


[ Top ]

$stat_cache =

[line 16]



Tags:

access:  protected

Type:   mixed


[ Top ]

$UID_Mappings =

[line 15]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


method chgrp [line 579]

bool chgrp( string $mFile, string $mGroup, [bool $mRecursive = false])

bool chgrp(string, string[, bool = false])



Tags:

access:  public


Parameters:

string   $mFile   filename
string   $mGroup   target gid, effectively just the admin's uid
bool   $mRecursive   recursively chown

[ Top ]

method chgrp_backend [line 593]

void chgrp_backend( $mFile, $mGroup, $mRecursive)



Tags:

access:  public


Parameters:

array   $mFile  
   $mGroup  
   $mRecursive  

[ Top ]

method chmod [line 696]

void chmod( string $mFile, int $mMode, [bool $mRecursive = false])

bool chmod (string, int)



Tags:

access:  public


Parameters:

string   $mFile   file name
int   $mMode   mode in octal for the file
bool   $mRecursive  

[ Top ]

method chmod_backend [line 708]

void chmod_backend( $mFile, $mMode, $mRecursive)

bool chmod_backend (string, int[, bool = false])

chmod




Tags:

access:  public


Parameters:

   $mFile  
   $mMode  
   $mRecursive  

[ Top ]

method chown [line 518]

bool chown( mixed $mFile, string $mUser, [bool $mRecursive = false])

bool chown(string, string[, bool = false])



Tags:

access:  public


Parameters:

mixed   $mFile   array of filenames or single filename
string   $mUser   target uid
bool   $mRecursive   recursively chown

[ Top ]

method chown_backend [line 529]

void chown_backend( $mFile, $mUser, $mRecursive)



Tags:

access:  public


Parameters:

array   $mFile  
   $mUser  
   $mRecursive  

[ Top ]

method chown_symlink [line 1632]

void chown_symlink( $mFile, $mUser)



Tags:

access:  public


Parameters:

   $mFile  
   $mUser  

[ Top ]

method chown_symlink_backend [line 1642]

void chown_symlink_backend( $mFile, $mUser)



Tags:

access:  public


Parameters:

   $mFile  
   $mUser  

[ Top ]

method convert_eol [line 1561]

void convert_eol( $mFile, $mEOL)



Tags:

access:  public


Parameters:

   $mFile  
   $mEOL  

[ Top ]

method convert_eol_backend [line 1568]

void convert_eol_backend( $mFile, $mTarget)



Tags:

access:  public


Parameters:

   $mFile  
   $mTarget  

[ Top ]

method copy [line 272]

void copy( $mSrc, $mDest, [ $mOwrite = true])



Tags:

access:  public


Parameters:

   $mSrc  
   $mDest  
   $mOwrite  

[ Top ]

method copy_backend [line 282]

void copy_backend( $mSrc, $mDest, $mOwrite)



Tags:

access:  public


Parameters:

array   $mSrc  
   $mDest  
   $mOwrite  

[ Top ]

method copy_storehouse_backend [line 1343]

void copy_storehouse_backend( $mApplication, $mVersion, $mSrc, $mDest)

bool copy_storehouse_backend(string, string)



Tags:

access:  public


Parameters:

   $mApplication  
   $mVersion  
   $mSrc  
   $mDest  

[ Top ]

method copy_storehouse_raw_backend [line 1326]

void copy_storehouse_raw_backend( $mApplication, $mSrc, $mDest)

bool copy_storehouse_raw_backend(string, string, string) Similar to copy_storehouse_backend, except source references a file within /var/storehouse/<application>/.



Tags:

access:  public


Parameters:

   $mApplication  
   $mSrc  
   $mDest  

[ Top ]

method create_directory [line 661]

void create_directory( string $mDir, [integer $mMode = 0755], [bool $mRecursive = true])

bool create_directory (string[, int[, bool]]) Creates a directory within the filesystem and will recursively create parent directories if need be



Tags:

access:  public


Parameters:

string   $mDir   directory name to create
integer   $mMode   mode to create the file
bool   $mRecursive   recursively create directory

[ Top ]

method create_directory_backend [line 673]

void create_directory_backend( $mDir, $mMode, $mRecursive)

bool create_directory_backend (string)

Backend for create_directory




Tags:

access:  public


Parameters:

   $mDir  
   $mMode  
   $mRecursive  

[ Top ]

method create_file [line 1091]

void create_file( string $mFile, [integer $mMode = 0644])

bool create_file (string[, integer = 0644])



Tags:

access:  public


Parameters:

string   $mFile   file name to create
integer   $mMode   mode for the file

[ Top ]

method create_file_backend [line 1099]

void create_file_backend( $mFile, $mMode)

bool create_file_backend (string, integer)

create_file




Tags:

access:  public


Parameters:

   $mFile  
   $mMode  

[ Top ]

method create_symlink [line 1588]

void create_symlink( $mSrc, $mDest)



Tags:

access:  public


Parameters:

   $mSrc  
   $mDest  

[ Top ]

method create_symlink_backend [line 1592]

void create_symlink_backend( $mSrc, $mDest)



Tags:

access:  public


Parameters:

   $mSrc  
   $mDest  

[ Top ]

method delete [line 392]

bool delete( mixed $mFile, [bool $mRecurse = false])

bool delete (mixed, [bool = FALSE]) Deletes a file from within the filesystem and calls can_delete



Tags:

return:  File deletion succeeded
privilege:  PRIVILEGE_ALL
access:  public


Parameters:

mixed   $mFile   Accepts two parameter types, a string indicating the single file to delete or an array of strings for files or directories to delete.
bool   $mRecurse   If $mRecurse is true, then all files underneath the directory will be deleted.

[ Top ]

method delete_backend [line 444]

void delete_backend( $mFile, $mRecurse)

bool delete_backend (mixed, [bool = FALSE])

delete




Tags:

access:  public


Parameters:

   $mFile  
   $mRecurse  

[ Top ]

method extract [line 121]

bool extract( string $mArchive, string $mDest)

bool extract (string, string)

Extracts files from $mArchive to $mDest




Tags:

return:  true on success
access:  public


Parameters:

string   $mArchive   archive file
string   $mDest   destination directory

[ Top ]

method extract_backend [line 129]

void extract_backend( $mArchive, $mDest)

bool extract_backend (string, string)

extract




Tags:

access:  public


Parameters:

   $mArchive  
   $mDest  

[ Top ]

method file_exists [line 1737]

void file_exists( $mFile)



Tags:

access:  public


Parameters:

   $mFile  

[ Top ]

method find_quota_files [line 1729]

void find_quota_files( [ $mFile = NULL])



Tags:

access:  public


Parameters:

   $mFile  

[ Top ]

method fix_apache_perms_backend [line 1370]

void fix_apache_perms_backend( $mPath $mPath, [ $mRecurse = false])

bool fix_apache_perms_backend(mixed [, bool = false])



Tags:

access:  public


Parameters:

$mPath   $mPath  

mixed either a string or array of strings of paths

Calls setgid, fixes permissions for Apache-written directories

   $mRecurse  

[ Top ]

method get_acls [line 955]

array get_acls( string $mFile)

array get_acls (string)



Tags:

return:  associative array of acl information
access:  public


Parameters:

string   $mFile   filename to get ACLs for

[ Top ]

method get_acls_backend [line 962]

void get_acls_backend( $mFile)

array get_acls_backend_string (string)



Tags:

access:  public


Parameters:

   $mFile  

[ Top ]

method get_archive_contents [line 233]

array get_archive_contents( $mFile)

array get_archive_contents (string)



Tags:

return:  items within the archive
access:  public


Parameters:

   $mFile  

[ Top ]

method get_archive_contents_backend [line 241]

void get_archive_contents_backend( $mFile)

array get_archive_contents_backend (string)

get_archive_contents




Tags:

access:  public


Parameters:

   $mFile  

[ Top ]

method get_directory_contents [line 1187]

array get_directory_contents( $mString, string $mPath)

array get_directory_contents (string)



Tags:

access:  public


Parameters:

string   $mPath   the path to the directory
   $mString  

[ Top ]

method get_directory_contents_backend [line 1275]

void get_directory_contents_backend( $mPath)

array get_directory_contents_backend (string)

get_directory_contents




Tags:

access:  public


Parameters:

   $mPath  

[ Top ]

method get_file_contents [line 1033]

string get_file_contents( string $mPath, [ $mRaw = FALSE])

mixed get_file_contents (string)

Returns the base64-encoded contents of a file




Tags:

return:  containing the contents of the file
throws:  FileError if the requested file is not a file (directory)
throws:  PermissionError if the user does not have access to read the file
privilege:  PRIVILEGE_ALL
access:  public


Parameters:

string   $mPath   path to the filename
   $mRaw  

[ Top ]

method get_file_contents_backend [line 1054]

base64 get_file_contents_backend( string $mPath, bool $mRaw)

string get_file_contents_backend (string)

get_file_contents




Tags:

return:  encoded file
privilege:  PRIVILEGE_SERVER_EXEC
access:  public


Parameters:

string   $mPath   file name
bool   $mRaw  

[ Top ]

method get_mime_type [line 919]

void get_mime_type( string $mFile, [ $mFormat = 'normal'])

string get_mime_type (string)

Determines the MIME type of a file through the file shell command




Tags:

access:  public


Parameters:

string   $mFile  
   $mFormat  

[ Top ]

method get_mime_type_backend [line 935]

void get_mime_type_backend( $mFile, $mFormat)

string get_mime_type_backend (string)



Tags:

access:  public


Parameters:

   $mFile  
   $mFormat  

[ Top ]

method get_registered_extensions [line 112]

array get_registered_extensions( )

array get_registered_extensions ()

Keys from the return value correspond to the extension type, values are the classes all implementing the common interface Compression_Interface




Tags:

return:  list of known compression extensions and their corresponding interfaces.
access:  public


[ Top ]

method is_compressed [line 183]

bool is_compressed( string $mFile)

bool is_compressed (string)

Checks to see if a file is a compressed archive through a bit of guestimation




Tags:

access:  public


Parameters:

string   $mFile  

[ Top ]

method make_path [line 1197]

void make_path( string $mPath, [ &$mLink = ''])

string make_path (string)

Returns a path outside the chroot'd environment




Tags:

throws:  FileError when an invalid path is detected
access:  public


Parameters:

string   $mPath  
   &$mLink  

[ Top ]

method move [line 407]

void move( string $mSrc, string $mDest, [string $mOwrite = false])

bool move(string, string[, bool = false])



Tags:

access:  public


Parameters:

string   $mSrc   source file or directory
string   $mDest   destination directory
string   $mOwrite   overwrite destination if exists

[ Top ]

method move_backend [line 418]

void move_backend( $mSrc, $mDest, $mOwrite)

bool move_backend(string, string, bool)



Tags:

access:  public


Parameters:

   $mSrc  
   $mDest  
   $mOwrite  

[ Top ]

method put_file_contents [line 1130]

bool put_file_contents( $mFile, string $mData, [bool $mOverwrite = FALSE], string $mPath)

bool put_file_contents (string, string[, bool = FALSE])



Tags:

throws:  FileError the requested file exists and $mOverwrite is false
throws:  PermissionError the user does not have access to write to the parent directory/file
privilege:  PRIVILEGE_ALL
access:  public


Parameters:

string   $mPath   path to the filename
string   $mData   file data
bool   $mOverwrite   if the file exists, overwrite
   $mFile  

[ Top ]

method put_file_contents_backend [line 1137]

void put_file_contents_backend( $mFile, $mData, $mOverwrite)

string put_file_contents_backend (string)

put_file_contents




Tags:

access:  public


Parameters:

   $mFile  
   $mData  
   $mOverwrite  

[ Top ]

method rename [line 1673]

void rename( $mSrc, $mDest)



Tags:

access:  public


Parameters:

   $mSrc  
   $mDest  

[ Top ]

method rename_backend [line 1678]

void rename_backend( $mSrc, $mDest)



Tags:

access:  public


Parameters:

array   $mSrc  
array   $mDest  

[ Top ]

method report_quota [line 1465]

array report_quota( $mUIDs $mUIDs)

array report_quota (mixed)



Tags:

return:  associative array of quotas for given users supplied by the parameter $mUIDs. The array is structured as follows: -uid: user id of the user N.B.: the username is not used; instead call Site_Module::get_users to retrieve the numeric values
  • quota:
  • soft:
  • hard
  • files:
  • file_soft:
  • file_hard
privilege:  PRIVILEGE_SITE
access:  public


Parameters:

$mUIDs   $mUIDs   array of uids

[ Top ]

method report_quota_backend [line 1478]

void report_quota_backend( $mUIDs)

*

array report_quota_backend (array)




Tags:

privilege:  PRIVILEGE_SITE|PRIVILEGE_USER
access:  public


Parameters:

   $mUIDs  

[ Top ]

method sanitize [line 1438]

bool sanitize( mixed $mFile)

bool sanitize (mixed)



Tags:

return:  true if the files contain valid characters, false if not
access:  public


Parameters:

mixed   $mFile   array of files or directories to check for malicious characters

[ Top ]

method set_handler [line 100]

void set_handler( &$function)



Tags:

access:  public


Parameters:

   &$function  

[ Top ]

method stat [line 648]

array stat( $mFile $mFile)

array stat (string)

TODO: Cross-reference ACLs for additional read/write constraints




Tags:

return:  Returns an asssociative array of the following details: owner: resolved name of the uid group: resolved name of the gid size: file size in bytes file_type (string): possible values of dir, file, or link link (integer): 2 if a symbolic link to a directory, 1 if a symbolic link to a file, 0 if not a symlink nlinks: number of links to the file permissions: site_quota: whether the file counts towards the site's quota user_quota: whether the file counts towards the user's quota ctime: creation time mtime: modification time atime: last access time can_delete: if the user has access to delete the file can_read: if the user has access to read the file can_execute: user is able to execute application or descend into the directory
access:  public


Parameters:

$mFile   $mFile   filename to stat

[ Top ]

method stat_backend [line 798]

void stat_backend( $mFile)

array stat_backend (string)



Tags:

access:  public


Parameters:

   $mFile  

[ Top ]


Documentation generated on Sat, 05 Jul 2008 04:00:37 -0400 by phpDocumentor 1.4.0