/** Redifine this function instead of default constructor */ function init() { $this->getLogger(); // Verify Licensing //$this->licenseCheck('atk4'); // send headers, no caching $this->sendHeaders(); $this->cleanMagicQuotes(); parent::init(); /** In addition to default initialization, set up logger and template */ $this->initializeTemplate(); if (get_class($this) == 'App_Web') { $this->setConfig(array('url_postfix' => '.php', 'url_prefix' => '')); } }
/** * init * * @return [type] [description] */ public function init() { parent::init(); try { // Extra 24-hour protection parent::init(); $this->logger = $this->add('Logger'); $this->add('Controller_PageManager')->parseRequestedURL(); // It's recommended that you use versioning inside your API, // for example http://api.example.com/v1/user // // This way version is accessible anywhere from $this->app->version list($this->version, $junk) = explode('_', $this->page, 2); // Add-ons may define additional endpoints for your API, but // you must activate them explicitly. $this->pathfinder->base_location->defineContents(array('endpoint' => 'endpoint')); } catch (Exception $e) { $this->caughtException($e); } }