public function testExecuteController() { $logger = $this->getMock('Conpago\\Logging\\Contract\\ILogger'); $response = $this->getMock('Conpago\\Helpers\\Contract\\IResponse'); $requestDataReader = $this->getMock('Conpago\\Helpers\\Contract\\IRequestDataReader'); $requestData = $this->getMock('Conpago\\Helpers\\Contract\\IRequestData'); $requestDataReader->expects($this->any())->method('getRequestData')->willReturn($requestData); $controller = $this->getMock('Conpago\\Presentation\\Contract\\IController'); $controller->expects($this->once())->method('execute')->with($requestData); $appConfig = $this->getMock('Conpago\\Config\\Contract\\IAppConfig'); $webApp = new WebApp($requestDataReader, $controller, $response, $logger, $appConfig); $webApp->run(); }
<?php require_once 'core/webapp.php'; $topmodul = 'gnopaste'; $app = new WebApp(array('topmodul' => $topmodul, 'skip' => array('auth', 'bench', 'test'), 'loglevel' => 3)); $app->run($topmodul);
<?php define('APP_NAME', 'web'); define('PI_ROOT', dirname(dirname(dirname(__FILE__))) . '/pi/'); define('APP_ROOT', dirname(dirname(__FILE__)) . '/'); define('COM_ROOT', APP_ROOT . 'com/'); define('APP_CTR_ROOT', APP_ROOT . APP_NAME . '/ctr/'); define('LOG_PATH', dirname(dirname(dirname(__FILE__))) . '/logs'); define("__PI_EN_DEBUG", 1); include PI_ROOT . 'Web.php'; //web项目需要的框架配置 Pi::set('global.logFile', 'web'); Pi::set('env', 'dev'); $app = new WebApp(); $app->run();
<?php /** * Index file for BWSC Website * * * @category WebApp.Index * @package index.php * @author Huw Jones <*****@*****.**> * @copyright 2014 Huw Jones */ /* * lib/webapp.php */ require 'lib/_init.php'; $webapp = new WebApp(); $webapp->run(); $help = file_get_contents(__LIBDIR__ . '/cli_help.txt') . PHP_EOL; function loginPrompt() { global $webapp; echo "\n===== WebApp Login =====\n"; echo "Enter your username: "******"Enter your Password: "******"Logged in!\n"; } else { echo "Invalid username/password\n"; loginPrompt(); }
<?php require_once 'core/webapp.php'; $app = new WebApp(array('topmodul' => 'yw_start', 'skip' => array('auth', 'bench', 'test'), 'loglevel' => 3)); $app->run('yw_start');
* **************************************************************************/ /** * @file index.php * @author huqingping * @date 2010/05/07 13:49:09 * @version 1.0 * @brief * **/ define('WEB_ROOT', dirname(__DIR__)); define('FR_ROOT', WEB_ROOT . '/Lessp/fr/'); define('RUN_ROOT', WEB_ROOT . '/runroot/'); define('LIB_ROOT', WEB_ROOT . '/Lessp/lib/'); define('PLUGIN_ROOT', WEB_ROOT . '/plugin/'); define('LOG_ROOT', WEB_ROOT . '/log/'); define('CONF_ROOT', WEB_ROOT . '/conf/'); define('TMP_ROOT', WEB_ROOT . '/tmp/'); define('EXLIB_ROOT', WEB_ROOT . '/exlib/'); define('PAGE_ROOT', WEB_ROOT . '/page/'); define('API_ROOT', WEB_ROOT . '/api/'); define('TOOL_ROOT', WEB_ROOT . '/bin/'); if (isset($argv)) { require_once FR_ROOT . 'app/ToolApp.php'; $obj = new ToolApp(); $obj->run(); } else { require_once FR_ROOT . 'app/WebApp.php'; $obj = new WebApp(); $obj->run(); }