本文整理汇总了PHP中loader::bootstrap方法的典型用法代码示例。如果您正苦于以下问题:PHP loader::bootstrap方法的具体用法?PHP loader::bootstrap怎么用?PHP loader::bootstrap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类loader
的用法示例。
在下文中一共展示了loader::bootstrap方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elFinderIsAuthed
/**
* Transler bridge
*/
function elFinderIsAuthed()
{
if (!defined('ELFIINDER_AUTHED')) {
require_once dirname(__FILE__) . '/../../../modules/core/loader.php';
loader::bootstrap();
/** @var users_item */
$user = core::lib('auth')->get_user();
$authed = $user->level >= 50;
define('ELFIINDER_AUTHED', $authed);
}
return ELFIINDER_AUTHED;
}
示例2: array
<?php
/**
* Front entry point
*
* @package SatCMS
* @author Golovkin Vladimir <r00t@skillz.ru> http://www.skillz.ru
* @copyright SurSoft (C) 2008
* @version $Id: index.php,v 1.3.2.1 2010/08/07 22:50:40 surg30n Exp $
*/
require 'modules/core/loader.php';
loader::bootstrap(array(loader::OPTION_AUTORUN => true, loader::OPTION_CORE_PARAMS => array()));
示例3: array
/**
* Entry point for editor interface
*
* @package SatCMS
* @author Golovkin Vladimir <r00t@skillz.ru> http://www.skillz.ru
* @copyright SurSoft (C) 2008
* @version $Id: index.php,v 1.3.2.2.4.6 2012/10/25 09:57:45 Vova Exp $
*/
// @fixme multifileuploader ua check fix
if (!empty($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT'] == 'Shockwave Flash' && isset($_POST['_ua'])) {
$_SERVER['HTTP_USER_AGENT'] = $_POST['_ua'];
$_COOKIE['vidz0xoid'] = $_POST['_sid'];
$_REQUEST['with_ajax'] = 1;
}
require '../modules/core/loader.php';
loader::bootstrap(array(loader::OPTION_CORE_PARAMS => array('editor' => true)));
// disable cache
functions::headers_no_cache();
/** @var tf_editor $editor */
$editor = core::lib('editor');
if (!core::lib('auth')->logged_in()) {
core::dprint('Please login!');
$editor->on_exception('Not logged in');
functions::redirect('/editor/in/');
return;
}
$core = core::selfie();
/** @var user_item */
$user = core::lib('auth')->get_user();
$path = @$_GET['req'];
// allow ng-redirect
示例4: array
#!/usr/bin/env php
<?php
use Symfony\Component\Console\Application;
use Symfony\Component\Finder\Finder;
// use SatCMS\Modules\Sat\Commands\TestCommand;
require "public/modules/core/loader.php";
$BOOT_OPTIONS = array(loader::OPTION_TESTING => true, loader::OPTION_NO_INIT => true, loader::OPTION_CORE_PARAMS => array());
loader::bootstrap($BOOT_OPTIONS);
$application = new Application();
$root = __DIR__ . '/src/Modules/*/Commands';
$finder = new Finder();
$finder->files()->in($root)->name('*.php')->depth('== 0');
$commands = [];
/** @var \SplFileInfo $file */
foreach ($finder as $file) {
// ... do something
preg_match('@(?<mod>\\w+)[\\\\/]Commands[\\\\/](?<cmd>\\w+)\\.php$@', $file->getPathname(), $matches);
$commands[] = 'SatCMS\\Modules\\' . ucfirst($matches['mod']) . '\\Commands\\' . ucfirst($matches['cmd']);
// . 'Command';
}
foreach ($commands as $command) {
$check = new ReflectionClass($command);
if ($check && !$check->isAbstract()) {
$application->add(new $command());
}
}
$application->run();
示例5: die
#!/usr/local/bin/php
<?php
/**
* Cron entry point
*
* @package SatCMS
* @author Golovkin Vladimir <r00t@skillz.ru> http://www.skillz.ru
* @copyright SurSoft (C) 2008
* @version $Id: cron.php,v 1.2 2010/07/21 17:57:14 surg30n Exp $
*/
// run crontab on single module
if (empty($_SERVER['argv'])) {
die('Crontab direct access disabled');
}
set_time_limit(0);
require 'modules/core/loader.php';
loader::bootstrap(array(loader::OPTION_CRONJOB => true, loader::OPTION_CORE_PARAMS => array('debug' => 666)));
// force debug
core::set_debug(666);
ini_set('display_errors', 'on');
error_reporting(E_ALL);
//
$module = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : false;
loader::core()->crontab($module);
// done
示例6: url
<?php
/**
* Login gate
*/
require '../../modules/core/loader.php';
loader::bootstrap();
core::get_instance(true);
if (core::lib('auth')->logged_in()) {
return functions::redirect('../');
}
$token = '<input type="hidden" name="x_token" value="' . core::lib('auth')->token() . '" />';
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Панель управления сайтом</title>
<link href="/vendor/bootstrap/dist/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="/vendor/toastr/toastr.css" rel="stylesheet" type="text/css" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<style>
html,body {
height:100%;
background: url("/editor/templates/img/bg.png") repeat scroll 0 0 gray;
margin:0;
padding:0;