예제 #1
0
 /**
  * Sets the configuration for this class. Should be called statically
  * in the bootstrap so the helper is configured once for every time it
  * is used.
  *
  * @param Array $config An array with the following config options:
  * - ip
  * - timeout
  * - port
  * - enabled
  *
  * @throws Zend_Controller_Action_Exception if the class has already
  * been configured
  */
 public static function setConfig(array $config)
 {
     if (!empty(self::$_config)) {
         /**
          * @see Zend_Controller_Action_Exception
          */
         require_once 'Zend/Controller/Action/Exception.php';
         throw new Zend_Controller_Action_Exception("class has already been configured");
     }
     self::$_config = $config;
 }
예제 #2
0
     * @see Conjoon_Controller_Plugin_ExtRequest
     */
    require_once 'Conjoon/Controller/Plugin/ExtRequest.php';
    $extDirect = new Conjoon_Controller_Plugin_ExtRequest(array('extParameter' => $config->application->ext->direct->request->parameter, 'additionalHeaders' => array('Content-Type' => 'application/json'), 'additionalParams' => array('format' => 'json'), 'action' => 'multi.request', 'controller' => 'ext', 'module' => 'default', 'singleException' => $config->application->ext->direct->request->singleException));
    Zend_Registry::set(Conjoon_Keys::EXT_REQUEST_OBJECT, $extDirect);
    $extDirect->registerPlugins();
}
// add helper namespace
Zend_Controller_Action_HelperBroker::addPrefix('Conjoon_Controller_Action_Helper');
/*@REMOVE@*/
// set the connection check default properties
if ($config->application->connection_check->enabled) {
    $c =& $config->application->connection_check;
    /**
     * @see Conjoon_Controller_Action_Helper_ConnectionCheck
     */
    require_once 'Conjoon/Controller/Action/Helper/ConnectionCheck.php';
    Conjoon_Controller_Action_Helper_ConnectionCheck::setConfig(array('enabled' => true, 'ip' => $c->ip, 'port' => $c->port, 'timeout' => $c->timeout));
}
/*@REMOVE@*/
// +----------------------------------------------------------------------------
// | Set up Routing
// +----------------------------------------------------------------------------
// +----------------------------------------------------------------------------
// | We are all set, dispatch!
// +----------------------------------------------------------------------------
/**
 * @see Conjoon_Controller_DispatchHelper
 */
require_once 'Conjoon/Controller/DispatchHelper.php';
Conjoon_Controller_DispatchHelper::dispatch();