当前位置: 首页>>代码示例>>PHP>>正文


PHP Phpfox::getLibClass方法代码示例

本文整理汇总了PHP中Phpfox::getLibClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox::getLibClass方法的具体用法?PHP Phpfox::getLibClass怎么用?PHP Phpfox::getLibClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Phpfox的用法示例。


在下文中一共展示了Phpfox::getLibClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: defined

<?php

/**
 * [PHPFOX_HEADER]
 */
defined('PHPFOX') or exit('NO DICE!');
Phpfox::getLibClass('phpfox.cdn.abstract');
/**
 * We use this class to store data on CDN services like Amazon S3. This can be items from
 * photos, videos, songs, CSS files etc...
 * 
 * Example of storing a file:
 * <code>
 * Phpfox::getLib('cdn')->put('/var/www/file/sample.jpg');
 * </code>
 * 
 * Displaying an uploaded file:
 * <code>
 * <img src="<?php echo Phpfox::getLib('cdn')->getUrl('/var/www/file/sample.jpg'); ?>" />
 * </code>
 * 
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author			Raymond Benc
 * @package 		Phpfox
 * @version 		$Id: cdn.class.php 3956 2012-03-01 12:28:26Z Raymond_Benc $
 */
class Phpfox_Cdn
{
    /**
     * Object of the CDN module.
     *
开发者ID:Lovinity,项目名称:EQM,代码行数:31,代码来源:cdn.class.php

示例2: defined

<?php

/**
 * [PHPFOX_HEADER]
 */
defined('PHPFOX') or exit('NO DICE!');
Phpfox::getLibClass('phpfox.cache.abstract');
/**
 * Class is used to cache any sort of data that is passed via PHP. 
 * Currenlty there is support for file based caching and memcached. 
 * It is perfect to store output from SQL queries that do not need to be executed
 * each time a user visits a specific page.
 * 
 * Example of using the cache system:
 * <code>
 * $oCache = Phpfox::getLib('cache');
 * // Create a name for your cache file
 * $sCacheId = $oCache->set('cache_file_name');
 * // Check if the file is already cached
 * if (!($aData = $oCache->get($sCacheId)))
 * {
 * 		// Run SQL query here...
 * 		$aData = array(1, 2, 3, 4);
 * 		// Store data in the the cache file (eg. strings, arrays, bools, objects etc...)
 * 		$oCache->save($sCacheId, $aData);
 * }
 * print_r($aData); 
 * </code>
 * 
 * If you want to remove a cache file:
 * <code>
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:31,代码来源:cache.class.php

示例3: array

 /**
  * Get a phpFox library. This includes the class file and creates the object for you.
  * 
  * Example usage:
  * <code>
  * Phpfox_Url::instance()->makeUrl('test');
  * </code>
  * 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".
  *
  * @param string $sClass Library class name.
  * @param array $aParams ARRAY of params you can pass to the library.
  * @return object Object of the library class is returned.
  */
 public static function &getLib($sClass, $aParams = array())
 {
     class_exists('Phpfox_Plugin') && ($sPlugin = Phpfox_Plugin::get('library_phpfox_getlib_0')) ? eval($sPlugin) : false;
     if (substr($sClass, 0, 7) != 'phpfox.' || ($sClass == 'phpfox.api' || $sClass == 'phpfox.process')) {
         $sClass = 'phpfox.' . $sClass;
     }
     $sHash = md5($sClass . serialize($aParams));
     if (isset(self::$_aObject[$sHash])) {
         return self::$_aObject[$sHash];
     }
     Phpfox::getLibClass($sClass);
     $sClass = str_replace('phpfox.phpfox.', 'phpfox.', $sClass);
     self::$_aObject[$sHash] = Phpfox::getObject($sClass, $aParams);
     return self::$_aObject[$sHash];
 }
开发者ID:html5ravi,项目名称:phpfox,代码行数:29,代码来源:phpfox.class.php

示例4: defined

<?php

/**
 * [PHPFOX_HEADER]
 */
defined('PHPFOX') or exit('NO DICE!');
Phpfox::getLibClass('phpfox.image.interface');
/**
 * Image Manipulation Library Template
 * 
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author			Raymond Benc
 * @package 		Phpfox
 * @version 		$Id: interface.class.php 1666 2010-07-07 08:17:00Z Raymond_Benc $ 
 */
interface Phpfox_Image_Interface
{
    /**
     * Create a thumbnail for an image
     *
     * @param string $sImage Full path of the original image
     * @param string $sDestination Full path for the newly created thumbnail
     * @param int $nMaxW Max width of the thumbnail
     * @param int $nMaxH Max height of the thumbnail
     * @param bool $bRatio TRUE to keep the aspect ratio and FALSE to not keep it
     * @param bool $bSkipCdn Skip the CDN routine
     * @return mixed FALSE on failure, TRUE or NULL on success
     */
    public function createThumbnail($sImage, $sDestination, $nMaxW, $nMaxH);
}
开发者ID:Lovinity,项目名称:EQM,代码行数:30,代码来源:interface.class.php

示例5: defined

<?php

/**
 * [Nulled by DarkGoth - NCP TEAM] - 2015
 */
defined('PHPFOX') or exit('NO DICE!');
Phpfox::getLibClass('phpfox.database.interface');
/**
 * Parent class for all SQL drivers. Each driver needs to interact
 * with this class in case any modifications need to be done to a query.
 * 
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author			Raymond Benc
 * @package 		Phpfox
 * @version 		$Id: dba.class.php 6809 2013-10-21 09:16:37Z Miguel_Espinoza $
 */
abstract class Phpfox_Database_Dba implements Phpfox_Database_Interface
{
    /**
     * Array of all the parts of a query we are going to execute
     *
     * @see self::execute()
     * @var array
     */
    protected $_aQuery = array();
    /**
     * Array of all the words that cannot be used
     * when creating a database table or field. This is only 
     * used in development mode.
     *
     * @var array
开发者ID:lev1976g,项目名称:core,代码行数:31,代码来源:dba.class.php

示例6: foreach

 foreach ($aCacheModules as $aCacheModule) {
     $aFinal[] = $aCacheModule['name'];
 }
 $sCacheModules = PHPFOX_DIR_FILE . 'log' . PHPFOX_DS . 'installer_modules.php';
 if (file_exists($sCacheModules)) {
     unlink($sCacheModules);
 }
 $sData = '<?php' . "\n";
 $sData .= '$aModules = ';
 $sData .= var_export($aFinal, true);
 $sData .= ";\n?>";
 Phpfox_File::instance()->write($sCacheModules, $sData);
 require PHPFOX_DIR . 'include' . PHPFOX_DS . 'settings' . PHPFOX_DS . 'server.sett.php';
 Phpfox::getLibClass('phpfox.database.dba');
 $sDriver = 'phpfox.database.driver.mysql';
 Phpfox::getLibClass($sDriver);
 $oDb = Phpfox::getLib($sDriver);
 $oDb->connect($_CONF['db']['host'], $_CONF['db']['user'], $_CONF['db']['pass'], $_CONF['db']['name']);
 $oDbSupport = Phpfox::getLib('database.support');
 $sTablePrefix = 'phpfox%s_';
 $aTables = $oDbSupport->getTables('mysql', $oDb);
 $bDefaultTaken = false;
 foreach ($aTables as $sTable) {
     if (substr($sTable, 0, 7) == 'phpfox_') {
         $bDefaultTaken = true;
         break;
     }
 }
 if ($bDefaultTaken === true) {
     $aNumbers = array();
     foreach ($aTables as $sTable) {
开发者ID:lev1976g,项目名称:core,代码行数:31,代码来源:2.0.0rc1.php

示例7: _process

 private function _process()
 {
     Phpfox::getLibClass('phpfox.database.dba');
     if (strtolower(preg_replace("/\\W/i", "", Phpfox::getParam(array('db', 'driver')))) == 'database_driver') {
         $aVals = Phpfox::getLib('session')->get('installer_db');
         if (isset($aVals['driver'])) {
             unset($aVals['module']);
             unset($aVals['drop']);
             $aVals['user'] = $aVals['user_name'];
             $aVals['pass'] = $aVals['password'];
             $aT = array();
             $aT['db'] = $aVals;
             Phpfox::getLib('setting')->setParam($aT);
             unset($aT);
         }
         unset($aVals);
         Phpfox::getLib('session')->remove('installer_db');
     }
     $sDriver = 'phpfox.database.driver.' . strtolower(preg_replace("/\\W/i", "", Phpfox::getParam(array('db', 'driver'))));
     if (Phpfox::getLibClass($sDriver)) {
         $oDb = Phpfox::getLib($sDriver);
         if ($oDb->connect(Phpfox::getParam(array('db', 'host')), Phpfox::getParam(array('db', 'user')), Phpfox::getParam(array('db', 'pass')), Phpfox::getParam(array('db', 'name')))) {
         }
     }
     $oDbSupport = Phpfox::getLib('database.support');
     $sCacheModules = PHPFOX_DIR_FILE . 'log' . PHPFOX_DS . 'installer_modules.php';
     if (!file_exists($sCacheModules)) {
         // Something went wrong...
     }
     $aModules = [];
     require_once $sCacheModules;
     $oModuleProcess = Phpfox::getService('admincp.module.process');
     foreach ($aModules as $iKey => $sModule) {
         if ($sModule == 'core') {
             unset($aModules[$iKey]);
         }
     }
     $aModules = array_merge(array('core'), $aModules);
     foreach ($aModules as $sModule) {
         if ($sModule == 'phpfoxsample' || $sModule == 'phpfox') {
             continue;
         }
         $oModuleProcess->install($sModule, array('table' => true));
     }
     $sModuleLog = PHPFOX_DIR_CACHE . 'installer_completed_modules.log';
     if (file_exists($sModuleLog)) {
         unlink($sModuleLog);
     }
     // $this->_pass();
     /*
     $this->_oTpl->assign(array(
     		'sMessage' => 'Tables installed...',
     		'sNext' => $this->_step('import')
     	)
     );
     */
     return ['message' => 'Importing language package', 'next' => 'import'];
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:58,代码来源:installer.class.php

示例8: defined

<?php

/**
 * [PHPFOX_HEADER]
 */
defined('PHPFOX') or exit('NO DICE!');
Phpfox::getLibClass('phpfox.database.driver.mysql');
/**
 * Database driver for MySQLi. This class extends the MySQL driver
 * we provide since both function in the same way there was no need to make
 * an extra class for MySQLi.
 * 
 * @see Phpfox_Database_Driver_Mysql
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author			Raymond Benc
 * @package 		Phpfox
 * @version 		$Id: mysqli.class.php 2016 2010-11-01 13:47:08Z Raymond_Benc $
 */
class Phpfox_Database_Driver_Mysqli extends Phpfox_Database_Driver_Mysql
{
    /**
     * Array of all the MySQLi functions we use. This 
     * variable overwrites the parent MySQL variable.
     *
     * @see parent::$_aCmd
     * @var array
     */
    protected $_aCmd = array('mysql_query' => 'mysqli_query', 'mysql_connect' => 'mysqli_connect', 'mysql_pconnect' => 'mysqli_pconnect', 'mysql_select_db' => 'mysqli_select_db', 'mysql_num_rows' => 'mysqli_num_rows', 'mysql_fetch_array' => 'mysqli_fetch_array', 'mysql_real_escape_string' => 'mysqli_real_escape_string', 'mysql_insert_id' => 'mysqli_insert_id', 'mysql_fetch_assoc' => 'mysqli_fetch_assoc', 'mysql_free_result' => 'mysqli_free_result', 'mysql_error' => 'mysqli_error', 'mysql_affected_rows' => 'mysqli_affected_rows', 'mysql_get_server_info' => 'mysqli_get_server_info', 'mysql_close' => 'mysqli_close');
}
开发者ID:Lovinity,项目名称:EQM,代码行数:29,代码来源:mysqli.class.php

示例9: defined

<?php

/**
 * [PHPFOX_HEADER]
 */
defined('PHPFOX') or exit('NO DICE!');
Phpfox::getLibClass('phpfox.mail.interface');
/**
 * Email Driver Layer
 * Our email loads a 3rd party email class that usually has support for both sendmail and smtp.
 * 
 * Example:
 * <code>
 * Phpfox::getLib('mail')->to('foo@bar.com')
 * 		->subject('Test Subject')
 * 		->message('Test Message')
 * 		->send();
 * </code>
 * 
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author			Raymond Benc
 * @package 		Phpfox
 * @version 		$Id: mail.class.php 7079 2014-01-29 17:27:22Z Fern $
 */
class Phpfox_Mail
{
    /**
     * Object of the 3rd party library we are using to send the actual image.
     *
     * @var object
     */
开发者ID:noikiy,项目名称:phpfox-v3-dist,代码行数:31,代码来源:mail.class.php

示例10: strtolower

        return;
    }
    $class = strtolower($class);
    if (preg_match('/([a-zA-Z0-9]+)_service_([a-zA-Z0-9_]+)/', $name, $matches)) {
        $parts = explode('_', $matches[2]);
        if (count($parts) > 1) {
            if ($parts[0] == $parts[1]) {
                unset($parts[1]);
            }
        }
        $className = $matches[1] . '.' . implode('.', $parts);
        Phpfox::getService($className);
    } else {
        if (substr($name, 0, 7) == 'phpfox_') {
            $class = str_replace('_', '.', $class);
            Phpfox::getLibClass($class);
        }
    }
});
require PHPFOX_DIR_LIB_CORE . 'phpfox' . PHPFOX_DS . 'phpfox.class.php';
require PHPFOX_DIR_LIB_CORE . 'error' . PHPFOX_DS . 'error.class.php';
require PHPFOX_DIR_LIB_CORE . 'module' . PHPFOX_DS . 'service.class.php';
require PHPFOX_DIR_LIB_CORE . 'module' . PHPFOX_DS . 'component.class.php';
// No need to load the debug class if the debug is disabled
if (PHPFOX_DEBUG) {
    require_once PHPFOX_DIR_LIB_CORE . 'debug' . PHPFOX_DS . 'debug.class.php';
    $handler = new Whoops\Handler\PrettyPageHandler();
    $handler->setEditor('textmate');
    $whoops = new Whoops\Run();
    $whoops->pushHandler($handler);
    $whoops->register();
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:31,代码来源:init.inc.php

示例11: array

	/**
	 * Get a phpFox library. This includes the class file and creates the object for you.
	 * 
	 * Example usage:
	 * <code>
	 * Phpfox::getLib('url')->makeUrl('test');
	 * </code>
	 * 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".
	 *
	 * @param string $sClass Library class name.
	 * @param array $aParams ARRAY of params you can pass to the library.
	 * @return object Object of the library class is returned.
	 */
	public static function &getLib($sClass, $aParams = array())
	{		
		if ((substr($sClass, 0, 7) != 'phpfox.') || ($sClass == 'phpfox.api' || $sClass == 'phpfox.process'))
		{
			$sClass = 'phpfox.' . $sClass;
		}
		
		$sHash = md5($sClass . serialize($aParams));
		
		if (isset(self::$_aObject[$sHash]))
		{	
			return self::$_aObject[$sHash];
		}		
		
		Phpfox::getLibClass($sClass);		

		$sClass = str_replace('phpfox.phpfox.', 'phpfox.', $sClass);		

		self::$_aObject[$sHash] = Phpfox::getObject($sClass, $aParams);
		
		return self::$_aObject[$sHash];
	}
开发者ID:hoanghd,项目名称:tools,代码行数:36,代码来源:phpfox.class.php

示例12: defined

<?php

/**
 * [NULLED BY DARKGOTH 2014]
 */
defined('PHPFOX') or exit('NO DICE!');
Phpfox::getLibClass('phpfox.image.abstract');
/**
 * Image Manipulation Library Loader
 * Loads the specified image manipulation library to be used based on admin settings.
 * Classes can be found: include/library/phpfox/image/library/
 * By default we use: GD
 * 
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author			Raymond Benc
 * @package 		Phpfox
 * @version 		$Id: image.class.php 1666 2010-07-07 08:17:00Z Raymond_Benc $
 */
class Phpfox_Image
{
    /**
     * Object for the image library
     *
     * @var object
     */
    private $_oObject = null;
    /**
     * Class constructor. We load the image library the admin decided to use on their site.
     *
     */
    public function __construct()
开发者ID:googlesky,项目名称:snsp.vn,代码行数:31,代码来源:image.class.php

示例13: defined

<?php

/**
 * [PHPFOX_HEADER]
 */
defined('PHPFOX') or exit('NO DICE!');
Phpfox::getLibClass('phpfox.cache.interface');
/**
 * Abstract class for cache storage classes. This class is used to work with the cache
 * system and certain methods do not require to work with a specific storage.
 * 
 * Example of deleting static JavaScript & CSS files:
 * <code>
 * Phpfox::getLib('cache')->removeStatic('sample.css');
 * </code>
 * 
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author			Raymond Benc
 * @package 		Phpfox
 * @version 		$Id: abstract.class.php 3054 2011-09-09 08:50:14Z Raymond_Benc $
 * @abstract 
 */
abstract class Phpfox_Cache_Abstract implements Phpfox_Cache_Interface
{
    /**
     * Array of any special params we pass in case we need to do something.
     *
     * @var array
     */
    protected $_aParams = array();
    /**
开发者ID:Lovinity,项目名称:EQM,代码行数:31,代码来源:abstract.class.php

示例14: defined

<?php

/**
 * [Nulled by DarkGoth - NCP TEAM] - 2015
 */
defined('PHPFOX') or exit('NO DICE!');
Phpfox::getLibClass('phpfox.gateway.interface');
/**
 * API Gateway Layer
 * Handles all API requests to interact with 3rd party payment gateway
 * sites like PayPal, 2checkout.
 * 
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author			Raymond Benc
 * @package 		Phpfox
 * @version 		$Id: gateway.class.php 7120 2014-02-18 13:56:29Z Fern $
 */
class Phpfox_Gateway
{
    /**
     * Holds an ARRAY of API objects
     *
     * @var array
     */
    private $_aObject = array();
    /**
     * Class constructor
     *
     */
    public function __construct()
    {
开发者ID:lev1976g,项目名称:core,代码行数:31,代码来源:gateway.class.php

示例15: defined

<?php

/**
 * [PHPFOX_HEADER]
 */
defined('PHPFOX') or exit('NO DICE!');
Phpfox::getLibClass('phpfox.database.dba');
/**
 * Database layer for phpFox. All interactions with a database is done via this class.
 * It connects to a specific driver such as MySQL or MySQLi or Oracle based on the
 * site owners needs.
 * 
 * Example use of an SQL query:
 * <code>
 * Phpfox::getLib('database')->query('SELECT * FROM user');
 * </code>
 * 
 * Example use to get multiple rows from a table:
 * <code>
 * $aRows = Phpfox::getLib('database')->select('*')
 * 		->from('user')
 * 		->where('user_name = \'foo\'')
 * 		->execute('getRows');
 * </code>
 * 
 * Example to insert data into the database:
 * <code>
 * Phpfox::getLib('database')->insert('user', array(
 * 			'email' => 'foo@bar.com',
 * 			'full_name' => 'Full Name'
 * 		)
开发者ID:Lovinity,项目名称:EQM,代码行数:31,代码来源:database.class.php


注:本文中的Phpfox::getLibClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。