示例#1
0
 /**
  * dispatch request
  *
  */
 public static function dispatchRequest()
 {
     // disable magic_quotes_runtime
     ini_set('magic_quotes_runtime', 0);
     // display errors we can't handle ourselves
     error_reporting(E_COMPILE_ERROR | E_CORE_ERROR | E_ERROR | E_PARSE);
     ini_set('display_errors', 1);
     ini_set('log_errors', 1);
     set_error_handler('Tinebase_Core::errorHandler', E_ALL);
     // set default internal encoding
     ini_set('iconv.internal_encoding', 'utf-8');
     $server = NULL;
     /**************************** JSON API *****************************/
     if (isset($_SERVER['HTTP_X_TINE20_REQUEST_TYPE']) && $_SERVER['HTTP_X_TINE20_REQUEST_TYPE'] == 'JSON' || isset($_POST['requestType']) && $_POST['requestType'] == 'JSON') {
         $server = new Setup_Server_Json();
         /**************************** CLI API *****************************/
     } elseif (php_sapi_name() == 'cli') {
         $server = new Setup_Server_Cli();
         /**************************** HTTP API ****************************/
     } else {
         $server = new Setup_Server_Http();
     }
     $server->handle();
 }
 /**
  * dispatch request
  *
  * @see Tinebase_Core::dispatchRequest()
  */
 public static function dispatchRequest()
 {
     $request = new \Zend\Http\PhpEnvironment\Request();
     self::set(self::REQUEST, $request);
     $server = NULL;
     /**************************** JSON API *****************************/
     if (isset($_SERVER['HTTP_X_TINE20_REQUEST_TYPE']) && $_SERVER['HTTP_X_TINE20_REQUEST_TYPE'] == 'JSON' || isset($_POST['requestType']) && $_POST['requestType'] == 'JSON') {
         $server = new Setup_Server_Json();
         /**************************** CLI API *****************************/
     } elseif (php_sapi_name() == 'cli') {
         $server = new Setup_Server_Cli();
         /**************************** HTTP API ****************************/
     } else {
         $server = new Setup_Server_Http();
     }
     $server->handle();
 }