本文整理汇总了PHP中Env::executeAction方法的典型用法代码示例。如果您正苦于以下问题:PHP Env::executeAction方法的具体用法?PHP Env::executeAction怎么用?PHP Env::executeAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Env
的用法示例。
在下文中一共展示了Env::executeAction方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: forward
/**
* Forward to specific controller / action
*
* @access public
* @param string $action
* @param string $controller. If this value is NULL current controller will be
* used
* @return null
*/
function forward($action, $controller = null)
{
return empty($controller) ? $this->execute($action) : Env::executeAction($controller, $action);
}
示例2: benchmark_timer_set_marker
}
// if
}
// try
// Init application
if (Env::isDebugging()) {
benchmark_timer_set_marker('Init application');
}
// if
// We need to call application.php after the routing is executed because
// some of the application classes may need CONTROLLER, ACTION or $_GET
// data collected by the matched route
require_once 'application.php';
// Set handle request timer...
if (Env::isDebugging()) {
benchmark_timer_set_marker('Handle request');
}
// if
// Get controller and action and execute...
try {
Env::executeAction(request_controller(), request_action());
} catch (Exception $e) {
if (Env::isDebugging()) {
Env::dumpError($e);
} else {
Logger::log($e, Logger::FATAL);
redirect_to(get_url('error', 'execute_action'));
}
// if
}
// try
示例3: trace
trace(__FILE__, 'FileRepository::setBackend() - use file storage');
FileRepository::setBackend(new FileRepository_Backend_FileSystem(FILES_DIR));
} else {
trace(__FILE__, 'FileRepository::setBackend() - use mysql storage');
FileRepository::setBackend(new FileRepository_Backend_MySQL(DB::connection()->getLink(), TABLE_PREFIX));
}
// if
PublicFiles::setRepositoryPath(ROOT . '/public/files');
if (trim(PUBLIC_FOLDER) == '') {
PublicFiles::setRepositoryUrl(with_slash(ROOT_URL) . 'files');
} else {
PublicFiles::setRepositoryUrl(with_slash(ROOT_URL) . PUBLIC_FOLDER . '/files');
}
// if
// Owner company or administrator doen't exist? Let the user create them
} catch (OwnerCompanyDnxError $e) {
Env::executeAction('access', 'complete_installation');
} catch (AdministratorDnxError $e) {
Env::executeAction('access', 'complete_installation');
// Other type of error? We need to break here
} catch (Exception $e) {
trace(__FILE__, '- catch ' . $e);
if (Env::isDebugging()) {
Env::dumpError($e);
} else {
Logger::log($e, Logger::FATAL);
Env::executeAction('error', 'system');
}
// if
}
// if
示例4: benchmark_timer_set_marker
require_once LIBRARY_PATH . '/utf8/utf8.php';
}
// Set handle request timer...
if (Env::isDebugging()) {
benchmark_timer_set_marker('Handle request');
}
// if
$url = urldecode($_SERVER['REQUEST_URI']);
if (preg_match('/<script[^>]*>.*(<\\/script>|$)/i', $url)) {
Logger::log("Javascript injection from " . $_SERVER['REMOTE_ADDR'] . " in URL:" . $url);
remove_scripts_and_redirect($url);
}
// Get controller and action and execute...
try {
if (!defined('CONSOLE_MODE')) {
Env::executeAction(request_controller(), request_action()) or DB::rollback();
}
} catch (Exception $e) {
if (Env::isDebugging()) {
Logger::log($e, Logger::FATAL);
Env::dumpError($e);
} else {
Logger::log($e, Logger::FATAL);
redirect_to(get_url('error', 'execute_action'));
}
// if
}
// try
if (Env::isDebuggingTime()) {
TimeIt::stop();
$report = TimeIt::getTimeReportByType();