Example #1
0
 public function __construct()
 {
     $config = Config::get('application');
     Session::start();
     if (get_magic_quotes_gpc()) {
         function stripslashes_deep($value)
         {
             $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
             return $value;
         }
         $_POST = stripslashes_deep($_POST);
         $_GET = stripslashes_deep($_GET);
         $_COOKIE = stripslashes_deep($_COOKIE);
         $_REQUEST = stripslashes_deep($_REQUEST);
     }
     if (isset($config['response']['defaultHeaders'])) {
         foreach ($config['response']['defaultHeaders'] as $header) {
             header($header);
         }
     }
     AbstractDb::$useMemcacheForMetadata = $config['useCache'];
     Object::$debug = MySQL::$monitorQueries = $config['debug'];
     Db::setConfig(Config::get('database'));
     $this->initialize();
 }
Example #2
0
 /**
  * @deprecated
  *
  * @param	string	$rpcQuery	with xmlrpc
  * @exception 123x
  */
 private function parseRpcQuery($rpcQuery)
 {
     $rpcRequest = new XmlRpcRequest($rpcQuery);
     if ($rpcRequest->errno) {
         $this->__raiseError(1231, $rpcRequest->errno, $rpcRequest->error);
     }
     $appConfig = Config::get('application');
     $parts = explode('.', $rpcRequest->methodName);
     $partsCnt = count($parts);
     if ($partsCnt > 0 && in_array($parts[0], Config::get('divisions'))) {
         $this->_division = $parts[0];
         $parts = array_slice($parts, 1);
     } else {
         $this->_division = '';
     }
     if (empty($parts[0])) {
         $this->_module = $appConfig['module']['default'];
     } else {
         $this->_module = $parts[0];
     }
     if ($partsCnt < 2 || empty($parts[1])) {
         $this->_method = $appConfig['module']['defaultMethodsControllerAction'];
     } else {
         $this->_method = $parts[1];
     }
     $this->_params = $rpcRequest->params;
 }