当前位置: 首页>>代码示例>>PHP>>正文


PHP Yaf_Application::run方法代码示例

本文整理汇总了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());
     }
 }
开发者ID:ligboy,项目名称:yaf-phpport,代码行数:16,代码来源:ApplicationTest.php

示例2: dirname

<?php

define('APPLICATION_PATH', dirname(__FILE__));
$application = new Yaf_Application(APPLICATION_PATH . "/conf/application.ini");
$application->run();
开发者ID:denghongbo,项目名称:2016,代码行数:5,代码来源:index.php

示例3: realpath

<?php

define("APP_PATH", realpath(dirname(__FILE__) . '/../'));
/* 指向public的上一级 */
$app = new Yaf_Application(APP_PATH . "/conf/application.ini");
$app->run();
开发者ID:A-lone,项目名称:test_post,代码行数:6,代码来源:index.php

示例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();
开发者ID:godruoyi,项目名称:portal,代码行数:8,代码来源:index.php

示例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());
开发者ID:hillstill,项目名称:soohyaf,代码行数:31,代码来源:index.php


注:本文中的Yaf_Application::run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。