本文整理汇总了PHP中Bootstrap::boot方法的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap::boot方法的具体用法?PHP Bootstrap::boot怎么用?PHP Bootstrap::boot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bootstrap
的用法示例。
在下文中一共展示了Bootstrap::boot方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* 初始化框架
*
* @param unknown_type $appPath
*/
public function init($appPath)
{
define('DS', DIRECTORY_SEPARATOR);
define('PS', PATH_SEPARATOR);
$libs = dirname(dirname(__FILE__));
//注册自动加载并加载框架运行的必须类
$this->_autoload($libs);
$dr = $_SERVER['DOCUMENT_ROOT'] . DS;
$dr = Hi_Tool_Dir::standard($dr);
$appPath = realpath($appPath);
define('DOC_ROOT', $dr);
Hi_Env::$DOC_ROOT = $dr;
$this->_setApp($appPath);
if (class_exists('Bootstrap') && is_subclass_of('Bootstrap', 'Hi_Bootstrap')) {
Bootstrap::boot();
}
}
示例2: dirname
* Movim's core is designed to ease the implementation of XMPP web-based clients,
* using massively asynchronous javascript and abstracting XMPP calls into an
* events-based API.
*/
define('DOCUMENT_ROOT', dirname(__FILE__));
require_once DOCUMENT_ROOT . '/bootstrap.php';
use Monolog\Logger;
use Monolog\Handler\SyslogHandler;
try {
if (isset($_GET['q']) && $_GET['q'] == 'admin' || isset($_GET['query']) && $_GET['query'] == 'admin') {
define('FAIL_SAFE', true);
} else {
define('FAIL_SAFE', false);
}
$bootstrap = new Bootstrap();
$bootstrap->boot();
$rqst = new FrontController();
$rqst->handle();
WidgetWrapper::getInstance(false);
// Closing stuff
WidgetWrapper::destroyInstance();
} catch (Exception $e) {
$log = new Logger('movim');
$log->pushHandler(new SyslogHandler('movim'));
$log->addInfo($e->getMessage());
if (ENVIRONMENT === 'development' && !FAIL_SAFE) {
?>
<div id="final_exception" class="error debug">
<h2>An error happened</h2>
<p><?php
print $e->getMessage();
示例3: dirname
<?php
require __DIR__ . '/vendor/autoload.php';
define('DOCUMENT_ROOT', dirname(__FILE__));
require_once DOCUMENT_ROOT . '/bootstrap.php';
gc_enable();
$bootstrap = new Bootstrap();
$booted = $bootstrap->boot();
$loop = React\EventLoop\Factory::create();
$dnsResolverFactory = new React\Dns\Resolver\Factory();
$dns = $dnsResolverFactory->createCached('8.8.8.8', $loop);
$connector = new React\SocketClient\Connector($loop, $dns);
$stdin = new React\Stream\Stream(STDIN, $loop);
fwrite(STDERR, colorize(getenv('sid'), 'yellow') . " widgets before : " . \sizeToCleanSize(memory_get_usage()) . "\n");
// We load and register all the widgets
$wrapper = WidgetWrapper::getInstance();
$wrapper->registerAll(true);
fwrite(STDERR, colorize(getenv('sid'), 'yellow') . " widgets : " . \sizeToCleanSize(memory_get_usage()) . "\n");
$conn = null;
$parser = new \Moxl\Parser();
$buffer = '';
$stdin_behaviour = function ($data) use(&$conn, $loop, &$buffer, &$connector, &$xmpp_behaviour, &$parser) {
if (substr($data, -1) == "") {
$messages = explode("", $buffer . substr($data, 0, -1));
$buffer = '';
foreach ($messages as $message) {
#fwrite(STDERR, colorize($message, 'yellow')." : ".colorize('received from the browser', 'green')."\n");
$msg = json_decode($message);
if (isset($msg)) {
if ($msg->func == 'message' && $msg->body != '') {
$msg = $msg->body;
示例4: chdir
* If we are run from another directory, try to change the current
* working directory to a directory the script is in
*/
if (@(!file_exists(getcwd() . '/' . basename($argv[0])))) {
chdir(dirname(__FILE__));
}
# if
require_once "lib/SpotClassAutoload.php";
SpotClassAutoload::register();
require_once "lib/Bootstrap.php";
/*
* Create a DAO factory. We cannot use the bootstrapper here,
* because it validates for a valid settings etc. version.
*/
$bootstrap = new Bootstrap();
list($settings, $daoFactory, $req) = $bootstrap->boot();
/* Retrieve the current list */
$conn = $daoFactory->getConnection();
$resultList = $conn->arrayQuery("SELECT mc.tmdb_id\n FROM mastercollections mc\n WHERE tmdb_id IS NOT NULL\n ORDER BY tmdb_id");
$startTime = time();
$counter = 0;
$svcTmdbInfo = new Services_MediaInformation_TheMovieDb($daoFactory, $settings);
$daoTmdb = $daoFactory->getTmdbInfo();
$prevTmdbId = null;
foreach ($resultList as $mc) {
if ($prevTmdbId != $mc['tmdb_id']) {
echo "Fetching TMDB id: " . $mc['tmdb_id'] . ", ";
$svcTmdbInfo->setSearchid($mc['tmdb_id']);
$tmdb = $svcTmdbInfo->retrieveInfo();
$counter++;
if ($tmdb !== null) {
示例5: dirname
<?php
/**
* Global parameters
* Do NOT use global variables, it makes baby Jesus cry. Use Config!
*
* @author Christophe Gosiau <christophe@tigron.be>
* @author Gerry Demaret <gerry@tigron.be>
* @author David Vandemaele <david@tigron.be>
*/
require_once dirname(__FILE__) . '/../lib/base/Bootstrap.php';
Bootstrap::boot();