当前位置: 首页>>代码示例>>PHP>>正文


PHP loader::bootstrap方法代码示例

本文整理汇总了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;
}
开发者ID:egregor-dev,项目名称:SatCMS,代码行数:15,代码来源:Authorize.php

示例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()));
开发者ID:egregor-dev,项目名称:SatCMS,代码行数:12,代码来源:index.php

示例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
开发者ID:egregor-dev,项目名称:SatCMS,代码行数:31,代码来源:index.php

示例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();
开发者ID:egregor-dev,项目名称:SatCMS,代码行数:27,代码来源:app.php

示例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
开发者ID:egregor-dev,项目名称:SatCMS,代码行数:25,代码来源:cron.php

示例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;
开发者ID:egregor-dev,项目名称:SatCMS,代码行数:31,代码来源:index.php


注:本文中的loader::bootstrap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。