static function run($configData)
 {
     self::init($configData);
     $router = Api_Core_Factory::createRouter();
     $controllerName = $router->getControllerName();
     $controllerClassName = "Api_Application_{$controllerName}_Controller";
     $controller = new $controllerClassName();
     $actionName = $router->getActionName();
     $action = 'action' . $actionName;
     if (!method_exists($controller, $action)) {
         http_response_code(404);
         Api_Core_Application::end();
     }
     $controller->{$action}();
 }
Example #2
0
function getWorkersId()
{
    $config = Api_Core_Factory::createConfig()->getConfig();
    return $config['host']['workers'];
}
Example #3
0
 /**
  * 
  * @param string $type
  * @return \Api_Component_FileStorage_IFileStorage
  */
 static function createFileStorage($type = 'amazon')
 {
     $config = Api_Core_Factory::createConfig()->getConfig();
     return new Api_Component_FileStorage_Amazon($config['host']);
 }
Example #4
0
 /**
  * 
  * @param string $domainName
  * @return \Job_Backup_Storage
  */
 static function createStorage($domainName)
 {
     $config = Api_Core_Factory::createConfig()->getConfig();
     $storage = Api_Component_Factory::createFileStorage();
     return new Job_Backup_Storage($domainName, $storage);
 }
Example #5
0
 static function createWorkerStarter()
 {
     $jobServer = Api_Component_Factory::createJobServer();
     $config = Api_Core_Factory::createConfig()->getConfig();
     return new Job_Monitor_WorkerStarter($jobServer, $config['host']['workers']);
 }