Phpfox

Description

phpFox Engine All interactions with anything phpFox related is executed via this class.

It is the engine that runs phpFox and all of the other libraries and modules. All methods, variables and constants are static.

All libraries are located within the folder: include/library/phpfox/ Example of connect to request library:

  1.  $oObject Phpfox::getLib('request');

  • author: Raymond Benc
  • version: $Id: phpfox.class.php 1668 2010-07-12 08:54:32Z Raymond_Benc $
  • copyright: [PHPFOX_COPYRIGHT]

Located in /include/library/phpfox/phpfox/phpfox.class.php (line 25)


	
			
Class Constant Summary
 BROWSER_AGENT = 'phpFox'
 CODE_NAME = 'Arctic'
 PHPFOX_API = 'http://api.phpfox.com/deepspace/'
 PHPFOX_PACKAGE = '[PHPFOX_PACKAGE_NAME]'
 VERSION = '2.0.6'
Variable Summary
 static array $_aLibs
 static array $_aLogs
 static unknown_type $_aObject
 static array $_aPages
 static bool $_bIsAdminCp
Method Summary
 static void addMessage (string $sMsg)
 static mixed callback (string $sCall)
 static void clearMessage ()
 static array endLog ()
 static object getBlock (string $sClass, [array $aParams = array()])
 static int getBuild ()
 static int getCleanVersion ()
 static string getCodeName ()
 static object We getComponent (string $sClass, [array $aParams = array()], [string $sType = 'block'])
 static mixed getComponentSetting (int $iUserId, string $sVarName, mixed $mDefaultValue)
 static string getCookie (string $sName)
 static int getId ()
 static string getIp ()
 static object Object &getLib (string $sClass, [array $aParams = array()])
 static bool getLibClass (string $sClass)
 static string|void getMessage ()
 static object Object &getObject (string $sClass, [array $aParams = array()])
 static mixed getParam (string $sVar)
 static string getPhrase (string $sParam, [array $aParams = array()], [bool $bNoDebug = false], [string $sDefault = null], [string $sLang = ''])
 static string getPhraseT (string $sParam, string $sPrefix)
 static object getService (string $sClass, [array $aParams = array()])
 static string getT (string $sTable)
 static string getTime ([string $sStamp = null], [int $iTime = PHPFOX_TIME])
 static string getTimeZone ([bool $bDst = true])
 static string getUserBy ([ $sVar = null])
 static string getUserField ([string $sAlias = 'u'], [string $sPrefix = ''])
 static mixed getUserGroupParam (int $iGroupId, string $sName)
 static int getUserId ()
 static unknown getUserParam (string $sName, [bool $bRedirect = false], [mixed $sJsCall = null])
 static string getVersion ()
 static bool hasCallback (string $sModule, string $sMethod)
 static bool isAdmin ([bool $bRedirect = false])
 static TRUE isAdminPanel ()
 static bool isMobile ()
 static bool isModule (string $sModule)
 static unknown isPackage (mixed $mPackage)
 static bool isPublicView ()
 static bool isSpammer ()
 static bool isUser ([bool $bRedirect = false])
 static string itemUrl (string $sUrl, array $mParams, string $sUserName)
 static string link ([bool $bLink = true], [bool $bVersion = true])
 static void log (string $sLog)
 static mixed massCallback (string $sMethod)
 static void run ()
 static void setCookie (string $sName, string $sValue, [int $iExpire = 0])
 static void startLog ([string $sLog = null])
Variables
static array $_aLibs = array() (line 76)

ARRAY of libraries being loaded.

  • access: private
static array $_aLogs = array() (line 97)

History of any logs we save for debug purposes.

  • access: private
static unknown_type $_aObject = array() (line 69)

ARRAY of objects initiated. Used to keep a static history so we don't call the same class more then once.

  • access: private
static array $_aPages = array() (line 83)

ARRAY of custom pages the site admins have created.

  • access: private
static bool $_bIsAdminCp = false (line 90)

Used to keep a static variable to see if we are within the AdminCP.

  • access: private
Methods
static addMessage (line 1234)

Add a public message which can be used later on to display information to a user.

Message gets stored in a $_SESSION so the message can be viewed after page reload in case it is used with a HTML form.

  • see: Phpfox_Session::set()
  • access: public
void addMessage (string $sMsg)
  • string $sMsg: Message we plan to display to the user
static callback (line 355)
mixed callback (string $sCall)
  • string $sCall
static clearMessage (line 1255)

Clear the public message we set earlier

  • see: Phpfox_Session::remove()
  • access: public
void clearMessage ()
static endLog (line 1318)

End the log and get it.

  • return: Returns the log.
  • access: public
array endLog ()
static getBlock (line 345)
object getBlock (string $sClass, [array $aParams = array()])
  • string $sClass
  • array $aParams
static getBuild (line 139)

Get the products build number.

  • access: public
int getBuild ()
static getCleanVersion (line 149)

Get the clean numerical value of the phpFox version.

  • access: public
int getCleanVersion ()
static getCodeName (line 129)

Get the products code name.

  • access: public
string getCodeName ()
static getComponent (line 402)
object We getComponent (string $sClass, [array $aParams = array()], [string $sType = 'block'])
  • string $sClass: Class name.
  • array $aParams: ARRAY of params you can pass to the component.
  • string $sType: Type of component (block or controller).
static getComponentSetting (line 414)
mixed getComponentSetting (int $iUserId, string $sVarName, mixed $mDefaultValue)
  • int $iUserId
  • string $sVarName
  • mixed $mDefaultValue
static getCookie (line 1281)

Gets a cookie set by the method self::setCookie().

  • return: Value of the cookie.
  • access: public
string getCookie (string $sName)
  • string $sName: Name of the cookie.
static getId (line 119)

Get the current phpFox version ID.

  • access: public
int getId ()
static getIp (line 472)
string getIp ()
static getLib (line 306)

Get a phpFox library. This includes the class file and creates the object for you.

Example usage:

  1.  Phpfox::getLib('url')->makeUrl('test');
In the example we called the URL library found in the folder: include/library/phpfox/url/url.class.php then created an object for it so we could directly call the method "makeUrl".

  • return: of the library class is returned.
  • access: public
object Object &getLib (string $sClass, [array $aParams = array()])
  • string $sClass: Library class name.
  • array $aParams: ARRAY of params you can pass to the library.
static getLibClass (line 258)

Fine and load a library class and make sure it exists.

  • return: TRUE if library has loaded, FALSE if not.
  • access: public
bool getLibClass (string $sClass)
  • string $sClass: Library class name.
static getMessage (line 1245)

Get the public message we setup earlier

  • return: Return the public message, or return nothing if no public message is set
  • see: Phpfox_Session::get()
  • access: public
string|void getMessage ()
static getObject (line 205)

Gets and creates an object for a class.

  • return: created will be returned.
  • access: public
object Object &getObject (string $sClass, [array $aParams = array()])
  • string $sClass: Class name.
  • array $aParams: Params to pass to the class.
static getParam (line 247)
mixed getParam (string $sVar)
  • string $sVar
static getPhrase (line 1210)
  • see: Phpfox_Local::getPhrase()
  • access: public
string getPhrase (string $sParam, [array $aParams = array()], [bool $bNoDebug = false], [string $sDefault = null], [string $sLang = ''])
  • string $sParam
  • array $aParams
  • bool $bNoDebug
  • string $sDefault
  • string $sLang
static getPhraseT (line 1221)
string getPhraseT (string $sParam, string $sPrefix)
  • string $sParam
  • string $sPrefix
static getService (line 425)
object getService (string $sClass, [array $aParams = array()])
  • string $sClass
  • array $aParams
static getT (line 436)

Builds a database table prefix.

  • return: Returns the table name with the clients prefix.
  • access: public
string getT (string $sTable)
  • string $sTable: Database table name.
static getTime (line 569)

Gets a time stamp, Works similar to PHP date() function.

We also take into account locale and time zone settings.

  • return: Time stamp value based on locale.
  • see: date()
  • access: public
string getTime ([string $sStamp = null], [int $iTime = PHPFOX_TIME])
  • string $sStamp: Time stamp format.
  • int $iTime: UNIX epoch time stamp.
static getTimeZone (line 555)
string getTimeZone ([bool $bDst = true])
  • bool $bDst
static getUserBy (line 454)
  • see: User_Service_Auth::getUserBy()
  • access: public
string getUserBy ([ $sVar = null])
  • $sVar
static getUserField (line 509)

Get all the user fields when joining with the user database table.

  • return: Returns SQL SELECT for user fields.
  • access: public
string getUserField ([string $sAlias = 'u'], [string $sPrefix = ''])
  • string $sAlias: Table alias. User table alias by default is "u".
  • string $sPrefix: Prefix for each of the fields.
static getUserGroupParam (line 755)
  • see: User_Service_Group_Setting_Setting::getGroupParam()
  • access: public
mixed getUserGroupParam (int $iGroupId, string $sName)
  • int $iGroupId
  • string $sName
static getUserId (line 445)
  • see: User_Service_Auth::getUserId()
  • access: public
int getUserId ()
static getUserParam (line 769)

Get a user group setting.

  • see: User_Service_Group_Setting_Setting::getParam()
  • access: public
unknown getUserParam (string $sName, [bool $bRedirect = false], [mixed $sJsCall = null])
  • string $sName: User group param name.
  • bool $bRedirect: TRUE will redirect the user to a subscribtion page if they do not have access to the param.
  • mixed $sJsCall: NULL will do nothing, however a STRING JavaScript code will run the code instead of a redirection.
static getVersion (line 104)

Get the current phpFox version.

  • access: public
string getVersion ()
static hasCallback (line 390)
bool hasCallback (string $sModule, string $sMethod)
  • string $sModule
  • string $sMethod
static isAdmin (line 713)

Used to see if a user is an Admin. By passing the first argument as TRUE we can also do an auto redirect to guide the user to login first before using a feature in the AdminCP.

  • return: If the 1st argument is FALSE, it will return a BOOL TRUE if the user is logged in, otherwise FALSE.
  • access: public
bool isAdmin ([bool $bRedirect = false])
  • bool $bRedirect: User will be redirected to the AdminCP login page if they are not logged int.
static isAdminPanel (line 871)

Check to see if we are in the AdminCP or not.

  • return: if we are, FALSE if we are not.
  • access: public
TRUE isAdminPanel ()
static isMobile (line 463)
bool isMobile ()
static isModule (line 334)
bool isModule (string $sModule)
  • string $sModule
static isPackage (line 171)

Check if a feature can be used based on the package the client has installed.

Example (STRING):

  1.  if (Phpfox::isPackage('1'}

Example (ARRAY):

  1.  if (Phpfox::isPackage(array('1''2')) }

  • access: public
unknown isPackage (mixed $mPackage)
  • mixed $mPackage: STRING can be used to pass the package ID, or an ARRAY to pass multipl packages.
static isPublicView (line 881)

Check to see if items are to be displayed in a public manner or within a persons profile.

  • return: TRUE will display items in public and FALSE will display on a users profile.
  • access: public
bool isPublicView ()
static isSpammer (line 482)

Checks to see if the user that is logged in has been marked as a spammer.

  • return: TRUE is a spammer, FALSE if not a spammer.
  • access: public
bool isSpammer ()
static isUser (line 683)

Used to see if a user is logged in or not. By passing the first argument as TRUE we can also do an auto redirect to guide the user to login first before using a feature.

  • return: If the 1st argument is FALSE, it will return a BOOL TRUE if the user is logged in, otherwise FALSE.
  • access: public
bool isUser ([bool $bRedirect = false])
  • bool $bRedirect: User will be redirected to the login page if they are not logged int.
static itemUrl (line 737)

Creates a URL for an item that is connected with a users profile.

  • return: Items URL now connected with a persons profile.
  • deprecated: 2.0.0beta1
  • access: public
string itemUrl (string $sUrl, array $mParams, string $sUserName)
  • string $sUrl: URL
  • array $mParams: URL params.
  • string $sUserName: Users vanity user name.
static link (line 193)

Provide "powered by" link.

  • return: Powered by phpFox string returned.
  • access: public
string link ([bool $bLink = true], [bool $bVersion = true])
  • bool $bLink: TRUE to include a link to phpFox.
  • bool $bVersion: TRUE to include the version being used.
static log (line 1308)

Log a message.

  • access: public
void log (string $sLog)
  • string $sLog: Message to the log.
static massCallback (line 372)
mixed massCallback (string $sMethod)
  • string $sMethod
static run (line 890)

Starts the phpFox engine. Used to get and display the pages controller.

  • access: public
void run ()
static setCookie (line 1268)

Set a cookie with PHP setcookie()

void setCookie (string $sName, string $sValue, [int $iExpire = 0])
  • string $sName: The name of the cookie.
  • string $sValue: The value of the cookie.
  • int $iExpire: The time the cookie expires. This is a Unix timestamp so is in number of seconds since the epoch.
static startLog (line 1293)

Start a new log.

  • access: public
void startLog ([string $sLog = null])
  • string $sLog: Message to the log.
Class Constants
BROWSER_AGENT = 'phpFox' (line 43)

Browser agent used with API curl requests.

CODE_NAME = 'Arctic' (line 37)

Product Code Name

PHPFOX_API = 'http://api.phpfox.com/deepspace/' (line 55)

phpFox API server.

PHPFOX_PACKAGE = '[PHPFOX_PACKAGE_NAME]' (line 61)

phpFox package ID.

PRODUCT_BUILD = '1' (line 49)

Product build number.

VERSION = '2.0.6' (line 30)

Product Version : major.minor.maintenance [alphaX, betaX or rcX]

Documentation generated on Tue, 28 Sep 2010 10:36:43 +0200 by phpDocumentor 1.4.0a2