本文整理汇总了PHP中Yaf_Application::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Yaf_Application::run方法的具体用法?PHP Yaf_Application::run怎么用?PHP Yaf_Application::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Yaf_Application
的用法示例。
在下文中一共展示了Yaf_Application::run方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCase022
/**
* @runInSeparateProcess
*/
public function testCase022()
{
$config = array("application" => array("directory" => TEST_APPLICATION_PATH, "dispatcher" => array("catchException" => 0, "throwException" => 0)));
$app = new Yaf_Application($config);
$this->assertEquals(rtrim(TEST_APPLICATION_PATH, DIRECTORY_SEPARATOR), $app->getAppDirectory());
$app->setAppDirectory('/tmp');
$this->assertEquals('/tmp', $app->getAppDirectory());
try {
$app->run();
} catch (PHPUnit_Framework_Error $e) {
$this->assertContains('Could not find controller script /tmp/controllers/Index.php', $e->getMessage());
}
}
示例2: dirname
<?php
define('APPLICATION_PATH', dirname(__FILE__));
$application = new Yaf_Application(APPLICATION_PATH . "/conf/application.ini");
$application->run();
示例3: realpath
<?php
define("APP_PATH", realpath(dirname(__FILE__) . '/../'));
/* 指向public的上一级 */
$app = new Yaf_Application(APP_PATH . "/conf/application.ini");
$app->run();
示例4: array
<?php
//require bootstarap file, must .
require './www/bootstrap.php';
$yaf = new Yaf_Application(array('application' => array('directory' => ROOT_APP, 'modules' => '')));
$dispatcher = $yaf->getDispatcher();
$dispatcher->autoRender(FALSE);
$yaf->run();
示例5: dirname
define("APP_PATH", dirname(__DIR__));
/* 指向public的上一级 */
if (!defined('SOOH_INDEX_FILE')) {
define('SOOH_INDEX_FILE', 'index.php');
}
define('SOOH_ROUTE_VAR', '__');
error_log("-------------------------------------------------------tart:route=" . $_GET['__'] . " cmd=" . $_GET['cmd'] . " pid=" . getmypid());
include dirname(__DIR__) . '/conf/globals.php';
$ini = \Sooh\Base\Ini::getInstance();
$app = new Yaf_Application(APP_PATH . "/conf/application.ini");
$dispatcher = $app->getDispatcher();
if (!empty($reqeustReal)) {
$dispatcher->setRequest($reqeustReal);
}
$view = \SoohYaf\SoohPlugin::initYafBySooh($dispatcher);
$dispatcher->returnResponse(TRUE);
try {
$response = $app->run();
} catch (\ErrorException $e) {
$view->assign('code', $e->getCode());
$view->assign('msg', $e->getMessage());
error_log("Error Caught at index.php:" . $e->getMessage() . "\n" . \Sooh\DB\Broker::lastCmd() . "\n" . $e->getTraceAsString() . "\n");
$response = new Yaf_Response_Http();
$response->setBody($view->render('ctrl/action.phtml'));
}
if ($ini->viewRenderType() === 'json') {
header('Content-type: application/json');
}
$response->response();
\Sooh\Base\Ini::registerShutdown(null, null);
error_log("====================================================================end:route=" . $_GET['__'] . " cmd=" . $_GET['cmd'] . " pid=" . getmypid());