Ejemplo n.º 1
0
 public static function parse()
 {
     if (!self::$mConfigData) {
         $params = Factory::getParameters();
         $file = isset($params['conf']) ? $params['conf'] : DIR_CONF . '/peel.conf';
         self::$mConfigData = parse_ini_file($file, true, INI_SCANNER_NORMAL);
         self::$mConfigData['config_file_path'] = $file;
         self::$mConfigData['config_directory'] = dirname($file);
         self::createDirectories();
         self::parsePeelers();
     }
     return self::$mConfigData;
 }
Ejemplo n.º 2
0
 /**
  * Run application.
  *
  * Starts application execution.
  *
  * @return void
  */
 public function run()
 {
     $this->mBase->run();
     $c = $this->getConfig();
     $p = Factory::getParameters();
     $peelerToEnable = isset($p['e']) ? $p['e'] : (isset($p['enable']) ? $p['enable'] : '');
     $peelerToDisable = isset($p['d']) ? $p['d'] : (isset($p['disable']) ? $p['disable'] : '');
     $this->mPathPeelersAvailable = $this->resolvePath($c, 'dir_available');
     $this->mPathPeelersEnabled = $this->resolvePath($c, 'dir_enabled');
     $this->enablePeeler($peelerToEnable);
     $this->disablePeeler($peelerToDisable);
 }
Ejemplo n.º 3
0
define('PROFILE_MOD', MODULES . 'profile/');
define('REGISTRATION_MOD', MODULES . 'signup/');
define('WATCH_VIDEO_MOD', MODULES . 'video_watch/');
define('UTILS', LIB . 'utils/');
define('INTERFACES', UTILS . 'interfaces/');
define('VIDEO_UPLOAD_MOD', MODULES . 'video_upload/');
define('VIDEO_SEARCH_MOD', MODULES . 'search/');
define('TMP_VIDEO', LIB . 'tmp_video/');
setReporting(true);
////ALWAYS SET THIS TO 'FALSE' BEFORE DEPLOYING
/** AutoLoad class files as soon as needed ***/
spl_autoload_register('loadClass');
include_once CONFIG . 'settings.php';
$registry = new Registry();
Factory::getRegistry($registry);
Factory::getParameters($parameters);
//parameter is defined in the settings file
// URI will always be of the form /specific_path
$request = $_SERVER["REQUEST_URI"];
$path = explode("/", $request);
$controller_obj = null;
switch ($path[1]) {
    case '':
        $controller_obj = new HomeController($path, $registry);
        $controller_obj->process($_POST);
        break;
    case 'admin':
        $controller_obj = new AdminController($path, $registry);
        $controller_obj->process($_POST);
        break;
    case 'categories':