Exemplo n.º 1
0
 public function main()
 {
     require_once dirname(__FILE__) . '/../../app/config.php';
     Agavi::bootstrap('development');
     AgaviController::initializeModule('AppKit');
     AgaviConfig::set('core.default_context', 'console');
     AgaviConfig::set('core.context_implementation', 'AppKitAgaviContext');
     AgaviContext::getInstance('console')->getController()->dispatch();
 }
 /**
  * Loads the agavi and appkit bootstrap
  * TODO:   the appkit bootstrap is not really needed, the console context
  * 		   uses it's factories. Perhaps a "cron" context can be created to minimize
  * 		   memory usage and optimize performance
  *  
  */
 private function bootstrap()
 {
     require_once $this->agaviPath;
     require_once $this->configPath;
     // +---------------------------------------------------------------------------+
     // Setting the running context to web ...
     Agavi::bootstrap('development');
     AgaviConfig::set('core.default_context', 'console');
     AgaviController::initializeModule('AppKit');
     AgaviConfig::set('core.context_implementation', 'AppKitAgaviContext');
     AppKitAgaviContext::getInstance();
 }
Exemplo n.º 3
0
#!/usr/bin/php
<?php 
error_reporting(E_ALL);
// +---------------------------------------------------------------------------+
// | An absolute filesystem path to the agavi/agavi.php script.                |
// +---------------------------------------------------------------------------+
require dirname(__FILE__) . '/../lib/agavi/src/agavi.php';
// +---------------------------------------------------------------------------+
// | An absolute filesystem path to our app/config.php script.                 |
// +---------------------------------------------------------------------------+
require dirname(__FILE__) . '/../app/config.php';
// +---------------------------------------------------------------------------+
// | Initialize the framework. You may pass an environment name to this method.|
// | By default the 'development' environment sets Agavi into a debug mode.    |
// | In debug mode among other things the cache is cleaned on every request.   |
// +---------------------------------------------------------------------------+
// Setting the running context to web ...
Agavi::bootstrap('development');
AgaviConfig::set('core.default_context', 'console');
AgaviController::initializeModule('AppKit');
AgaviConfig::set('core.context_implementation', 'AppKitAgaviContext');
// +---------------------------------------------------------------------------+
// | Call the controller's dispatch method on the default context              |
// +---------------------------------------------------------------------------+
AgaviContext::getInstance('console')->getController()->dispatch();
Exemplo n.º 4
0
 /**
  * A method that is called in the __call overload by the SOAP call handler.
  *
  * All it does is call parent::dispatch() to prevent an infinite loop.
  *
  * @author     David Zülke <*****@*****.**>
  * @since      0.11.0
  */
 public function doDispatch()
 {
     try {
         // return the content so SoapServer can send it.
         // AgaviSoapResponse::send() does not send the content, but sets the headers on the SoapServer
         return parent::dispatch($this->dispatchArguments, $this->dispatchContainer);
     } catch (SoapFault $f) {
         $this->response->clear();
         $this->response->setContent($f);
         // return the content so SoapServer can send it.
         return $this->response;
     }
 }