コード例 #1
0
ファイル: front.php プロジェクト: wardvanderput/SumoStore
 private function execute($action)
 {
     if (!method_exists($action, 'getFile')) {
         return '[could not execute this action]';
     }
     if (file_exists($action->getFile())) {
         Sumo\Logger::info('Executing ' . $action->getClass() . '->' . $action->getMethod());
         require_once $action->getFile();
         $class = $action->getClass();
         try {
             if (!class_exists($class)) {
                 throw new \Exception('File not found for class ' . $class);
             }
             $controller = new $class($this->registry);
         } catch (\Exception $e) {
             trigger_error('Could not execute ' . $class . ', something is wrong.', E_USER_ERROR);
         }
         if (is_callable(array($controller, $action->getMethod()))) {
             $return = call_user_func_array(array($controller, $action->getMethod()), $action->getArgs());
         } else {
             trigger_error('Could not execute ' . $action->getClass() . '->' . $action->getMethod(), E_USER_ERROR);
             $return = $this->error;
             $this->error = '';
         }
     } else {
         $file = $action->getFile();
         if (empty($file)) {
             Sumo\Logger::warning('$action does not have method $action->getFile(): ' . print_r($action, true));
         }
         Sumo\Logger::warning('Could not load file ' . $action->getFile() . ' to call ' . $action->getClass() . '->' . $action->getMethod());
         $return = $this->error;
         $this->error = '';
     }
     return $return;
 }
コード例 #2
0
ファイル: startup.php プロジェクト: wardvanderput/SumoStore
require DIR_SYSTEM . 'library/formatter.php';
require DIR_SYSTEM . 'library/apps.php';
if (!isset($unknown)) {
    Sumo\Logger::info('Common library is loaded');
}
// Application Classes
require DIR_SYSTEM . 'library/customer.php';
require DIR_SYSTEM . 'library/affiliate.php';
require DIR_SYSTEM . 'library/currency.php';
require DIR_SYSTEM . 'library/tax.php';
# to be removed, legacy only
require DIR_SYSTEM . 'library/weight.php';
require DIR_SYSTEM . 'library/length.php';
require DIR_SYSTEM . 'library/cart.php';
if (!isset($unknown)) {
    Sumo\Logger::info('Application library is loaded');
}
// Load security plugin
require DIR_SYSTEM . 'engine/communicator.php';
//if (!isset($unknown)) {
//Sumo\Logger::info('SumoGuard Communicator loaded');
//}
//else {
//Sumo\Logger::info('test');
//}
require DIR_SYSTEM . 'engine/security.php';
if (ini_get('register_globals')) {
    ini_set('session.use_cookies', 'On');
    ini_set('session.use_trans_sid', 'Off');
    session_set_cookie_params(0, '/');
    session_start();