本文整理汇总了PHP中Wind::application方法的典型用法代码示例。如果您正苦于以下问题:PHP Wind::application方法的具体用法?PHP Wind::application怎么用?PHP Wind::application使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wind
的用法示例。
在下文中一共展示了Wind::application方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: routerShutdown
public function routerShutdown(Yaf\Request_Abstract $request, Yaf\Response_Abstract $response)
{
if ($request->controller == 'Api') {
require \Yaf\Registry::get('config')->application->phpwind->wekit_bin;
Wekit::init('phpwind');
$application = Wind::application('phpwind', Wekit::S());
}
}
示例2: provideApp
private function provideApp()
{
$_SERVER['SCRIPT_FILENAME'] = "index.php";
$_SERVER['SCRIPT_NAME'] = 'index.php';
$_SERVER['HTTP_HOST'] = 'localhost';
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_FILENAME'] . '?c=long&a=noPrint';
Wind::application("long", array('web-apps' => array('long' => array('modules' => array('default' => array('controller-path' => 'data', 'controller-suffix' => 'Controller', 'error-handler' => 'TEST:data.ErrorControllerTest'))))))->run();
}
示例3: setUp
/**
* Prepares the environment before running a test.
*/
protected function setUp()
{
parent::setUp();
require_once 'base\\WindFactory.php';
require_once 'data\\ForWindFactoryTest.php';
Wind::application()->createApplication();
$this->factory || ($this->factory = Wind::getApp()->getWindFactory());
}
示例4: run
/**
* 运行当前应用
*
* @param string $name 应用名称默认‘phpwind’
* @param array $components 组建配置信息 该组建配置将会覆盖原组建配置,默认为空
*/
public static function run($name = 'phpwind', $components = array()) {
self::init($name);
if (!empty($components)) self::$_sc['components'] = (array)$components + self::$_sc['components'];
/* @var $application WindWebFrontController */
$application = Wind::application($name, self::$_sc);
$application->registeFilter(new PwFrontFilters($application));
$application->run();
}
示例5: setUp
/**
* Prepares the environment before running a test.
*/
protected function setUp()
{
parent::setUp();
require_once 'web\\WindWebApplication.php';
require_once 'web\\WindForward.php';
require_once 'base\\WindFactory.php';
require_once 'data\\ForWindFactoryTest.php';
$this->front = Wind::application("long", array('web-apps' => array('long' => array('modules' => array('default' => array('controller-path' => 'data', 'controller-suffix' => 'Controller', 'error-handler' => 'TEST:data.ErrorControllerTest'))))));
}
示例6: setUp
/**
* Prepares the environment before running a test.
*/
protected function setUp()
{
parent::setUp();
require_once 'base\\WindModule.php';
require_once 'data\\TestFrontController.php';
require_once 'data\\ForWindFactoryTest.php';
require_once 'data\\LongController.php';
Wind::application()->createApplication();
$this->WindModule = new LongController();
}
示例7: run
/**
* 运行当前应用
*
* @param string $name 应用名称默认‘phpwind’
* @param array $components 组建配置信息 该组建配置将会覆盖原组建配置,默认为空
*/
public static function run($name = 'phpwind', $components = array())
{
$config = WindUtility::mergeArray(include WEKIT_PATH . '../conf/application/default.php', include WEKIT_PATH . '../conf/application/' . $name . '.php');
if (!empty($components)) {
$config['components'] = (array) $components + $config['components'];
}
/* @var $application WindWebFrontController */
$application = Wind::application($name, $config);
$application->registeFilter(new PwFrontFilters($application));
$application->run();
}
示例8: testFormFilter
public function testFormFilter()
{
$_SERVER['SCRIPT_FILENAME'] = "index.php";
$_SERVER['SCRIPT_NAME'] = 'index.php';
$_SERVER['HTTP_HOST'] = 'localhost';
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_FILENAME'] . '?c=long&a=test';
$_POST['shi'] = 'shi';
$_POST['long'] = 'long';
Wind::application('EnableValidata', $this->getConfigData())->run();
$testForm = Wind::getApp()->getRequest()->getAttribute("testForm");
$this->assertEquals("shi", $testForm->getShi());
$this->assertEquals("long", $testForm->getLong());
}
示例9: testDispatch
/**
* Tests WindDispatcher->dispatch()
*/
public function testDispatch()
{
$_SERVER['SCRIPT_FILENAME'] = "index.php";
$_SERVER['SCRIPT_NAME'] = 'index.php';
$_SERVER['HTTP_HOST'] = 'localhost';
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_FILENAME'] . '?c=long&a=noPrint';
$front = Wind::application('long', array('web-apps' => array('long' => array('modules' => array('default' => array('controller-path' => 'data', 'controller-suffix' => 'Controller', 'error-handler' => 'TEST:data.ErrorControllerTest'))))))->run();
$forward = new WindForward();
$forward->setIsReAction(true);
$forward->setAction('/long/test');
ob_start();
Wind::getApp()->doDispatch($forward);
$this->assertEquals(ob_get_clean(), 'LongController-test');
}
示例10: testErrorHandler
public function testErrorHandler()
{
$front = Wind::application("WindError", array('web-apps' => array('WindError' => array('modules' => array('default' => array('controller-path' => 'data', 'controller-suffix' => 'Controller', 'error-handler' => 'TEST:data.ErrorControllerTest', 'compile-dir' => 'data'))))));
$_SERVER['SCRIPT_FILENAME'] = "index.php";
$_SERVER['SCRIPT_NAME'] = 'index.php';
$_SERVER['HTTP_HOST'] = 'localhost';
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_FILENAME'] . '?a=shi&c=long';
try {
$front->run();
} catch (Exception $e) {
$this->assertEquals("error handled", $e->getMessage());
return;
}
$this->fail("Error Handler Test Error");
}
示例11: setUp
/**
* Prepares the environment before running a test.
*/
protected function setUp()
{
parent::setUp();
$this->WindFrontController = Wind::application("long", array('web-apps' => array('long' => $this->appConfigData())));
}
示例12: error_reporting
<?php
error_reporting(0);
@header("Content-Type:text/html; charset=utf-8");
define('SCR', 'aCloud_index');
define('WIND_DEBUG', 0);
require_once '.././src/wekit.php';
$front = Wind::application('acloud', WEKIT_PATH . 'aCloud/aCloudConfig.php');
// $front->createApplication();
Wekit::createapp('acloud');
$config = (include WEKIT_PATH . '../conf/application/default.php');
Wekit::app()->charset = $config['web-apps']['default']['charset'];
require_once WEKIT_PATH . 'aCloud/aCloud.php';
$router = new ACloudRouter();
$router->run();
示例13: error_reporting
<?php
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
require './src/wekit.php';
/* @var $application WindWebFrontController */
Wind::application('install', WindUtility::mergeArray(include WEKIT_PATH . '../conf/application/default.php', include WEKIT_PATH . '../conf/application/install.php'))->run();
示例14: testResolveActionFilter
public function testResolveActionFilter()
{
require_once 'data/Listener.php';
Wind::application()->createApplication();
$errorMessage = new WindErrorMessage("shi");
$this->testController->setErrorMessage($errorMessage);
$forward = new WindForward();
$forward->setAction("long");
$this->testController->setForward($forward);
$_GET['name'] = 'shilong';
$this->testController->setGlobal('shilong', 'name');
$forward->setVars('name', 'xxxxx');
$_GET['wuq'] = 'wuq';
$this->testController->resolveActionFilter($this->dataForResolveActionFilter());
$this->assertEquals("post_post_post_pre_pre_pre_shi", $errorMessage->getError(0));
$this->assertEquals("post_post_post_pre_pre_pre_long", $forward->getAction());
}
示例15: error_reporting
<?php
error_reporting(E_ALL);
//define('WIND_DEBUG', 0);
require_once '../../wind/Wind.php';
Wind::application()->run();