本文整理汇总了PHP中Main::start方法的典型用法代码示例。如果您正苦于以下问题:PHP Main::start方法的具体用法?PHP Main::start怎么用?PHP Main::start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main::start方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _main
public static function _main()
{
self::$printer = new FuturePrinter();
$main = new Main();
$main->start();
echo Thread::code(), " is printing...", PHP_EOL;
self::$printer->_print("Hello, world (1).");
self::$printer->_print("Hello, world (2).");
self::$printer->_print("Hello, world (3).");
}
示例2: start
<?php
include_once 'Game.php';
include_once 'Player.php';
include_once 'Dice.php';
class Main
{
public function start()
{
// 1. The game contains
$playerA = new Player('Player A');
$playerB = new Player('Player B');
$playerC = new Player('Player C');
$playerD = new Player('Player D');
// 4 players.
$playerInstances = [$playerA, $playerB, $playerC, $playerD];
$game = new Game($playerInstances);
$game->start();
}
}
$main = new Main();
$main->start();
示例3: die
<?php
if (version_compare(PHP_VERSION, "5.3.0", "<")) {
die("require PHP > 5.3.0!");
}
// header('Access-Control-Allow-Origin: *');
// header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
// header('Access-Control-Allow-Methods: GET, POST, PUT');
// header("Content-type:text/plain");
error_reporting(E_ERROR | E_WARNING);
// error_reporting(E_ALL);
session_start();
require "config.php";
require "log.php";
require M_PATH . 'function.php';
if (preg_match("/.*\\/v\\d+\\//", $_SERVER['REQUEST_URI'])) {
require CUSTOMER . "/engine/commonmodel.php";
require CUSTOMER . "/engine/dispatch.php";
$dispatch = new Dispatch();
echo $dispatch->start();
} else {
require M_PATH . 'model.php';
require C_PATH . 'zjhcontroller.php';
require CONFIG_PATH . "permission.php";
require M_PATH . "Main.php";
$main = new Main();
$result = $main->start();
echo $result;
}