Ejemplo n.º 1
0
<?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.
     *
Ejemplo n.º 2
0
<?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>
Ejemplo n.º 3
0
 /**
  * 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];
 }
Ejemplo n.º 4
0
<?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);
}
Ejemplo n.º 5
0
<?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
Ejemplo n.º 6
0
 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) {
Ejemplo n.º 7
0
 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'];
 }
Ejemplo n.º 8
0
<?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');
}
Ejemplo n.º 9
0
<?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('*****@*****.**')
 * 		->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
     */
Ejemplo n.º 10
0
        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();
Ejemplo n.º 11
0
	/**
	 * 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];
	}
Ejemplo n.º 12
0
<?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()
Ejemplo n.º 13
0
<?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();
    /**
Ejemplo n.º 14
0
<?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()
    {
Ejemplo n.º 15
0
<?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' => '*****@*****.**',
 * 			'full_name' => 'Full Name'
 * 		)
Ejemplo n.º 16
0
	private function _process()
	{		
		Phpfox::getLibClass('phpfox.database.dba');
		
		$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...
		}
		
		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')
			)
		);
	}