本文整理汇总了PHP中Server::Run方法的典型用法代码示例。如果您正苦于以下问题:PHP Server::Run方法的具体用法?PHP Server::Run怎么用?PHP Server::Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server
的用法示例。
在下文中一共展示了Server::Run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testLoadServerWithNonExistentAction
public function testLoadServerWithNonExistentAction()
{
ob_start();
$_SERVER["QUERY_STRING"] = "Index/foo";
Server::Run();
$html = ob_get_contents();
ob_end_clean();
$this->assertTrue(strpos($html, "inside the view") <= 0);
}
示例2: ServerPush
<?php
require_once '../php/EventHttpServer.class.php';
class Server extends EventHttpServer
{
protected function ServerPush($Data)
{
echo "Push\n";
$ClientData = $this->getClientDataArray();
foreach ($ClientData as $SocketName => $Client) {
$this->ClientWrite($SocketName, $Data);
}
}
}
$Server = new Server();
$Server->Run();
示例3:
<?php
/*
* phpXelerator5 MVC
* Bootstrap load the Autoloader and then loads all the required directories.
* Then the constants are loaded and the Server Runs the application.
* The server instantiates the Controller based on the first parameter passed
* to Index.php, the seconds is the action and the rest are parameters.
*
* Version: 1.0 09/24/2015
*
* @author Mauricio Giraldo <mgiraldo@gmail.com>
*
*/
include_once './bootstrap.php';
Server::Run();