當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Main::start方法代碼示例

本文整理匯總了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).");
 }
開發者ID:nowelium,項目名稱:php-thread-utils,代碼行數:10,代碼來源:Future.class.php

示例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();
開發者ID:mario-bros,項目名稱:PHPDiceGame,代碼行數:22,代碼來源:Start.php

示例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;
}
開發者ID:nongfuguoyuan,項目名稱:accountant,代碼行數:29,代碼來源:index.php


注:本文中的Main::start方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。