- Description
-
Class trees
Index of elements
Todo List
Interfaces
Phpfox_Cache_Interface
Phpfox_Database_Interface
Phpfox_Gateway_Interface
Phpfox_Image_Interface
Phpfox_Mail_Interface
Classes
Database_Driver_Mssql
Database_Driver_Oracle
Database_Driver_Postgres
Database_Driver_Sqlite
Phpfox
Phpfox_Ajax
Phpfox_Api
Phpfox_Archive
Phpfox_Archive_Export
Phpfox_Archive_Extension_Tar
Phpfox_Archive_Extension_Xml
Phpfox_Archive_Extension_Zip
Phpfox_Archive_Import
Phpfox_Archive_Support
Phpfox_Cache
Phpfox_Cache_Abstract
Phpfox_Cache_Storage_File
Phpfox_Cache_Storage_Memcache
Phpfox_Cdn
Phpfox_Cdn_Abstract
Phpfox_Cdn_Module_S3
Phpfox_Component
Phpfox_Cron
Phpfox_Database
Phpfox_Database_Dba
Phpfox_Database_Driver_Mysql
Phpfox_Database_Driver_Mysqli
Phpfox_Database_Export
Phpfox_Database_Support
Phpfox_Date
Phpfox_Debug
Phpfox_Diff_Md5
Phpfox_Editor
Phpfox_Error
Phpfox_File
Phpfox_File_Minimize
Phpfox_Ftp
Phpfox_Gateway
Phpfox_Gateway_Api_2checkout
Phpfox_Gateway_Api_Paypal
Phpfox_Hash
Phpfox_Image
Phpfox_Image_Abstract
Phpfox_Image_Helper
Phpfox_Image_Library_Gd
Phpfox_Locale
Phpfox_Mail
Phpfox_Mail_Driver_Phpmailer_Mail
Phpfox_Mail_Driver_Phpmailer_Smtp
Phpfox_Module
Phpfox_Pager
Phpfox_Parse_Bbcode
Phpfox_Parse_Css
Phpfox_Parse_Format
Phpfox_Parse_Input
Phpfox_Parse_Output
Phpfox_Parse_Wiki
Phpfox_Plugin
Phpfox_Process
Phpfox_Request
Phpfox_Search
Phpfox_Search_Inline
Phpfox_Server
Phpfox_Service
Phpfox_Session
Phpfox_Session_Handler
Phpfox_Session_Handler_Default
Phpfox_Session_Handler_File
Phpfox_Session_Handler_Memcache
Phpfox_Session_Storage_Cookie
Phpfox_Session_Storage_Session
Phpfox_Setting
Phpfox_Spam
Phpfox_Spam_Hash
Phpfox_Template
Phpfox_Url
Phpfox_Validator
Phpfox_Xml_Builder
Phpfox_Xml_Parser
Functions
d
e
p
Files
2checkout.class.php
abstract.class.php
abstract.class.php
abstract.class.php
ajax.class.php
api.class.php
archive.class.php
bbcode.class.php
builder.class.php
cache.class.php
cdn.class.php
component.class.php
cookie.class.php
cron.class.php
css.class.php
database.class.php
date.class.php
dba.class.php
debug.class.php
default.class.php
editor.class.php
error.class.php
export.class.php
export.class.php
file.class.php
file.class.php
file.class.php
format.class.php
ftp.class.php
gateway.class.php
gd.class.php
handler.class.php
hash.class.php
hash.class.php
helper.class.php
image.class.php
import.class.php
inline.class.php
input.class.php
interface.class.php
interface.class.php
interface.class.php
interface.class.php
interface.class.php
locale.class.php
mail.class.php
mail.class.php
md5.class.php
memcache.class.php
memcache.class.php
minimize.class.php
module.class.php
mssql.class.php
mysql.class.php
mysqli.class.php
oracle.class.php
output.class.php
pager.class.php
parser.class.php
paypal.class.php
phpfox.class.php
plugin.class.php
postgres.class.php
process.class.php
request.class.php
s3.class.php
search.class.php
server.class.php
service.class.php
session.class.php
session.class.php
setting.class.php
smtp.class.php
spam.class.php
sqlite.class.php
support.class.php
support.class.php
tar.class.php
template.class.php
url.class.php
validator.class.php
wiki.class.php
xml.class.php
zip.class.php
Template-
Classes
Phpfox_Template_Cache
Files
cache.class.php
Phpfox_File
Handles anything related to files and/or folders on the server.
Handles:
- checking meta data
- loading a file that was recently uploaded
- upload and move files
- get a list of files from a given directory
- delete directories
- copy files
- force a download of a file
- check if file/folder is writable
- make a new directory
- write to a file / create a new file
- write to a cache file
- get the servers temporary directory
Located in /include/library/phpfox/file/file.class.php (line 30)
void
forceDownload
(string $sFile, string $sName, [string $sMimeType = ''], [string $sFileSize = ''], [string $iServerId = 0])
mixed
upload
(string $sFormItem, string $sDestination, string $sFileName, [bool $bModifyFileName = true], [int $iPerm = 0644], [bool $buildDir = true], [bool $bCdn = true])
array
$_aFile
= array() (line 44)
Holds meta information about a file that was uploaded. Information includes $_FORM
array
$_aFileCheck
= array(// 'mp3' =>
) (line 74)
Foruce a special file check on meta data. This feature is not being used at the moment as it was designed for MP3s
array
$_aSupported
= array() (line 58)
Holds an ARRAY of all the supported file types identified by the routine
int
$_iMaxSize
= null (line 66)
Holds the max size of what is allowed by the routine in bytes. Note that this is also checked by the system to make sure it can handle such a size.
string
$_sDestination
(line 37)
Holds the final path of a file that was uploaded
string
$_sExt
(line 51)
Holds the file extension of the file that was uploaded.
static filesize (line 334)
Gets the filesize of a file and returns the best human readable output.
- int $iSize: Size of the file
- int $iPrecision: Precision on the output
Constructor __construct (line 82)
Class constructor
copy (line 517)
Copy a file from one location to another.
- string $sSrc: Full path to the orginal file
- string $sDest: Full path to where the orignal file will be copied to
delete_directory (line 754)
Deletes a directory and all the files and folders in it (recursive)
- string $sPath: Absolute path to the folder
- $dir
forceDownload (line 433)
Forces a file to be downloaded by the end-user and at the same time try to hide the location of the file.
- string $sFile: Full path to a file
- string $sName: Name of the file when the user trys to download it
- string $sMimeType: MIME type of the file in case we can't find it.
- string $sFileSize: File size of the file in case we can't find it.
- string $iServerId: Optional if the site has more then one server you need to specify the original location of the file with the servers ID#
getAllFiles (line 294)
Gets all files/folders in a give directory recursively.
- string $sDir: Full path to the directory
- bool $bRecurse: TRUE if we are in a recursive check or FALSE if we are not.
getBuiltDir (line 742)
Gets the directory we just built to place an uploaded file.
- string $sDestination: Full path to where we should place the uploaded file.
getFiles (line 268)
Gets all the files/folders in a specified directory.
- string $sDir: Full path to the directory.
getLimit (line 718)
Gets the servers limit on uploading files.
- int $iMaxSize: You can define what you want as a limit.
getMeta (line 97)
Get meta information about a file using the getID3 library.
Library is located at: include/library/getid3/
Example:
- string $sFileName: Full path to the file we need to check
getTempDir (line 673)
Get the temporary directory of the server based on the servers enviroment variables.
Note: Use with caution some servers can be tricky.
isWritable (line 569)
Checks if path is writable
- string $sPath: Path to file or directory
- bool $bForce: If set to TRUE we will disable error reporting and force a check on the file/folder
load (line 125)
Loads an uploaded file and performs checks to make sure it was allowed
to be uploaded bassed on the supported file extensions passed by the 2nd argument. As well as check if the filesize is allowed bassed on the 3rd argument that is passed plus to also make sure the server can handle uploading such a size on the file.
- string $sFormItem: Name of the <input> used when submitting the form.
- array $aSupported: An ARRAY of allowed file extensions
- int $iMaxSize: Max filesize in bytes for the file being uploaded
mkdir (line 787)
Creates a directory. Unlike mkdir() it can also create recursive directories based on the full path that is being passed.
- string $sDir: Full path of the directory to create
- bool $bRecurse: FALSE by default, however if set to TRUE we will create a recursive run on mkdir.
rename (line 535)
Renames a file
- string $sSrc: Full path to the orginal file
- string $sDest: Full path to where the new file will be located with its new name
unlink (line 552)
Delete a file from the server.
- string $sSrc: Full path to the file
upload (line 198)
Method is named "upload", however due to how PHP works the file has already been uploaded and this simply moves the uploaded file to the final location since it passed all the tests done by the load() method.
- string $sFormItem: Name of the <input> used when submitting the form.
- string $sDestination: Full path to where the final location of the file will be
- string $sFileName: File name of the uploaded file once we have moved it to its final destination
- bool $bModifyFileName: By default we modify the actual file name with a unique MD5 hash to make it harder to find, however setting this to FALSE will keep the original name of the file.
- int $iPerm: UNIX file permissions on the file. Default is 0644 (read only).
- bool $buildDir: We place files in folders based on the current month/year by default. Set this to FALSE to not create such directories and place it in the specificed destination folder.
- bool $bCdn: If CDN support is enabled we will copy the file to the CDN server. Set this to FALSE to force the script to not copy the file to CDN even if support is enabled for CDN.
write (line 405)
Writes to a file on the server. Always removes files if it exists.
- string $sFile: Full path to the file
- string $sData: Data to put in the file
- string $sMode: Mode to take when opening the file. Default is "w"
writeToCache (line 384)
Writes to a cache file. Overwrites old files and if it does not exist it creates a new one.
- string $sFile: Fill name of the file to write to.
- string $sData: Data to add into the file.
_buildDir (line 852)
Builds a directory structure for items being uploaded based on
by deafult the month/year we are in. This is a setting in the AdminCP where admins can control how the structure is to be built. Note that if SAFE_MODE is enabled this feature will do nothing as we are not allowed to create folders in such an enviroment.
- string $sDestination: Destination of the folder we are to create new folders in.
_buildFile (line 899)
We build an ARRAY of information about the file based on information passed by $_FORM or $_FORM['FOO'][] with the latter being a multiple uploade routine.
- string $sFormItem: The ID to connect with the $_FORM variable
_getFileType (line 884)
We find out a files extension based on information passed along with $_FILE
_passLimit (line 816)
Runs a check to make sure the item being uploaded is allowed to be uploaded based on the server requirements.
_verify (line 932)
If this feature is enabled we use getID3 to try to find the mime type by trying to extract meta information. Note that since this is based off a 3rd party library this method has been known to have it share of problems. We are not using this by default until it is fully stable.
- string $sFileName: Path to the file we are going to check
Documentation generated on Tue, 28 Sep 2010 10:36:39 +0200 by phpDocumentor 1.4.0a2