/** * Call the registered user function, including an external file if needed * and passing along the specified arguments * * @param array $aArgs The function arguments * * @return void */ public function call($aArgs = array()) { if ($this->sInclude) { ob_start(); require_once $this->sInclude; $sOutput = ob_get_clean(); if ($sOutput) { $sOutput = $this->trans('debug.function.include', array('file' => $this->sInclude, 'output' => $sOutput)); ResponseManager::getInstance()->debug($sOutput); } } $mFunction = $this->sUserFunction; ResponseManager::getInstance()->append(call_user_func_array($mFunction, $aArgs)); }
private function __construct() { $this->aProcessingEvents = array(); $sTranslationDir = realpath(__DIR__ . '/../translations'); $sTemplateDir = realpath(__DIR__ . '/../templates'); Utils\Container::getInstance()->init($sTranslationDir, $sTemplateDir); $this->xRequestManager = RequestManager::getInstance(); $this->xResponseManager = ResponseManager::getInstance(); $this->xPluginManager = PluginManager::getInstance(); $this->setDefaultOptions(); $this->aOptionMappings = array('language' => 'core.language', 'version' => 'core.version', 'characterEncoding' => 'core.encoding', 'decodeUTF8Input' => 'core.decode_utf8', 'requestURI' => 'core.request.uri', 'defaultMode' => 'core.request.mode', 'defaultMethod' => 'core.request.method', 'wrapperPrefix' => array('core.prefix.function', 'core.prefix.class'), 'eventPrefix' => 'core.prefix.event', 'timeout' => 'core.process.timeout', 'cleanBuffer' => 'core.process.clean_buffer', 'exitAllowed' => 'core.process.exit_after', 'errorHandler' => 'core.error.handle', 'logFile' => 'core.error.log_file', 'debug' => 'core.debug.on', 'verboseDebug' => 'core.debug.verbose', 'debugOutputID' => 'js.lib.output_id', 'responseQueueSize' => 'js.lib.queue_size', 'scriptLoadTimeout' => 'js.lib.load_timeout', 'waitCursor' => 'js.lib.show_cursor', 'statusMessages' => 'js.lib.show_status', 'javascript URI' => array('js.app.uri', 'js.lib.uri'), 'javascript Dir' => 'js.app.dir', 'deferScriptGeneration' => array('js.app.export', 'js.app.minify'), 'deferDirectory' => 'js.app.dir', 'scriptDefferal' => 'js.app.options'); }
/** * Call the specified method of the registered callable object using the specified array of arguments * * @param string $sMethod The name of the method to call * @param array $aArgs The arguments to pass to the method * * @return void */ public function call($sMethod, $aArgs) { if (!$this->hasMethod($sMethod)) { return; } $reflectionMethod = $this->reflectionClass->getMethod($sMethod); ResponseManager::getInstance()->append($reflectionMethod->invokeArgs($this->callableObject, $aArgs)); }