本文整理匯總了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();