Beispiel #1
0
    // Global translation function
    if (!function_exists('__')) {
        /**
         * Translate message
         *
         * @package     base-app
         * @version     2.0
         *
         * @param string $string string to translate
         * @param array $values replace substrings
         *
         * @return string translated string
         */
        function __($string, array $values = NULL)
        {
            return \Baseapp\Library\I18n::instance()->_($string, $values);
        }
    }
    if (!defined('ROOT_PATH')) {
        define('ROOT_PATH', dirname(__DIR__));
    }
    require_once ROOT_PATH . '/app/Bootstrap.php';
    $app = new \Baseapp\Bootstrap(new \Phalcon\DI\FactoryDefault());
    echo $app->handle()->getContent();
} catch (\Phalcon\Exception $e) {
    \Baseapp\Bootstrap::exception($e);
} catch (\PDOException $e) {
    \Baseapp\Bootstrap::exception($e);
} catch (\Exception $e) {
    \Baseapp\Bootstrap::exception($e);
}
Beispiel #2
0
 /**
  * @return string Either an XML document or a gzipped file
  */
 public function render()
 {
     // Default uncompressed
     $response = $this->_xml->saveXML();
     if ($this->gzip) {
         // Try and gzip the file before we send it off.
         try {
             $response = gzencode($response, $this->compression);
         } catch (ErrorException $e) {
             \Baseapp\Bootstrap::exception($e);
         }
     }
     return $response;
 }