本文整理汇总了PHP中bootstrap函数的典型用法代码示例。如果您正苦于以下问题:PHP bootstrap函数的具体用法?PHP bootstrap怎么用?PHP bootstrap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bootstrap函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: plugin
protected function plugin()
{
// functions used as part of constructor
Mock::wpPassthruFunction('untrailingslashit');
Mock::wpFunction('plugin_dir_path', array('args' => bootstrap()->get_framework_path() . '/woocommerce/class-sv-wc-plugin.php', 'return' => bootstrap()->get_framework_path() . '/woocommerce'));
Mock::wpFunction('is_admin', array('return' => true));
Mock::wpPassthruFunction('plugin_basename');
Mock::wpFunction('has_action', array('return' => true));
$args = array('mock', '7.7.7', 'woocommerce-mock', 'args' => array('dependencies' => 'json', 'function_dependencies' => 'ftp_ssl_connect'));
return $this->getMockBuilder('SV_WC_Plugin')->setConstructorArgs($args)->getMockForAbstractClass();
}
开发者ID:shredzjc,项目名称:wc-plugin-framework,代码行数:11,代码来源:plugin.php
示例2: run_preflight
/**
* Perform preflight checks for Mercator
*
* Checks that we can actually run SSO, then attaches the relevant actions
* and filters to make it useful.
*/
function run_preflight()
{
if (!is_enabled()) {
return;
}
// Check for COOKIE_DOMAIN definition
//
// Note that this can't be an admin notice, as you'd never be able to log in
// to see it.
if (defined('COOKIE_DOMAIN')) {
status_header(500);
header('X-Mercator: COOKIE_DOMAIN');
wp_die('The constant <code>COOKIE_DOMAIN</code> is defined (probably in <code>wp-config.php</code>). Please remove or comment out that <code>define()</code> line.');
}
// E: There's no reason to become alarmed, and we hope you'll enjoy the
// rest of your flight.
//
// E: By the way, is there anyone on board who knows how to fly a plane?
bootstrap();
}
开发者ID:fansided,项目名称:Mercator,代码行数:26,代码来源:sso.php
示例3: bootstrap
* @package Filter Search Community Edition
* @version v2.1 Final
*
*/
function bootstrap()
{
if (isset($_GET['act'])) {
include realpath(dirname(__FILE__) . '/../../../../') . '/config/config.inc.php';
include realpath(dirname(__FILE__) . '/../../../../') . '/init.php';
if (!class_exists('ProCoreApi', FALSE)) {
include realpath(dirname(__FILE__) . '/../../libraries/') . '/procore.api.php';
}
if (!class_exists('FilterSearch', FALSE)) {
include realpath(dirname(__FILE__) . '/../../modules/') . '/filtersearch/filtersearch.module.php';
}
$api = new ProCoreApi();
$filter = new FilterSearch(TRUE);
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$perpage = isset($_GET['page']) ? $_GET['perpage'] : 10;
$orderby = isset($_GET['orderby']) ? $_GET['orderby'] : 'newest';
$orderway = isset($_GET['orderway']) ? $_GET['orderway'] : 'desc';
if ($_GET['act'] == 'filter') {
$output = $filter->performSearch($smarty, $page, $perpage, $orderby, $orderway);
} elseif ($_GET['act'] == 'tabs') {
$output = array('tabs' => $filter->sortByTabs($smarty));
}
return json_encode($output);
}
}
print bootstrap();
开发者ID:Eximagen,项目名称:3m,代码行数:30,代码来源:filtersearch.json.php
示例4: ariPageHeader
/**
* Set HTTP headers in preparation for a page response.
*
* TODO: Figure out caching
*/
function ariPageHeader()
{
bootstrap();
}
开发者ID:carriercomm,项目名称:Freeside,代码行数:9,代码来源:bootstrap.php
示例5: dirname
<?php
/**
* This file is part of the sfSearch package.
* (c) Carl Vondrick <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require dirname(__FILE__) . '/../bootstrap/functional.php';
bootstrap('frontend');
$b = new xfTestBrowser();
$b->getAndCheck('search', 'search')->checkResponseElement('title', 'Search')->checkResponseElement('h2', 'Search', array('position' => 0))->checkResponseElement('form[method="get"]', true)->checkResponseElement('form label[for="search_query"]', 'Query')->checkResponseElement('form input[id="search_query"]', true)->checkResponseElement('form input[type="submit"]', true);
开发者ID:nurfiantara,项目名称:ehri-ica-atom,代码行数:13,代码来源:xfControlsTest.php
示例6: index
<?php
include "lib/_inc.php";
class CameraController extends Controller
{
public function index()
{
return $this->renderView("camera/index", array("page" => "camera", "streamUrl" => Storage::get("camera")->streamUrl));
}
}
bootstrap(CameraController::class);
开发者ID:dmeijboom,项目名称:RaspberryWebInterface,代码行数:11,代码来源:camera.php
示例7: exit
print "FATAL: You must be in group 'fossy' to update the FOSSology database.\n";
exit(1);
}
/* Initialize the program configuration variables */
$SysConf = array();
// fo system configuration variables
$PG_CONN = 0;
// Database connection
$Plugins = array();
/* defaults */
$Verbose = false;
$DatabaseName = "fossology";
$UpdateLiceneseRef = false;
$sysconfdir = '/usr/local/etc/fossology';
/* Set SYSCONFDIR and set global (for backward compatibility) */
$SysConf = bootstrap($sysconfdir);
// don't think we want all the other common libs
require_once "{$MODDIR}/lib/php/common.php";
/* Initialize global system configuration variables $SysConfig[] */
ConfigInit($SYSCONFDIR, $SysConf);
/* migration */
require_once "./dbmigrate_2.1-2.2.php";
print "Migrate data from 2.1 to 2.2 \n";
Migrate_21_22($Verbose);
exit(0);
/************************************************/
/****** From src/lib/php/bootstrap.php ********/
/** Included here so that fossinit can run from any directory **/
/**
* \brief Bootstrap the fossology php library.
* - Determine SYSCONFDIR
开发者ID:pombredanne,项目名称:fossology-test,代码行数:31,代码来源:migratetest.php
示例8: array
* Sample Output:
* $ ./regressiontest.php -w "http://bobg.fc.hp.com/trunk"
* Regression found: Baseline is regression/good//?mod=browse&upload=1&item=1, new content is regression/output_29370/?mod=browse&upload=1&item=1
* Total files checked: 3
* No regression in: 2
* Regression found in: 1
*/
// $DATAROOTDIR and $PROJECT come from Makefile
//require_once "$DATAROOTDIR/$PROJECT/lib/php/bootstrap.php";
require_once "/usr/local/share/fossology/lib/php/bootstrap.php";
$SysConf = array();
// fo system configuration variables
$PG_CONN = 0;
// Database connection
/* Set SYSCONFDIR and set global (for backward compatibility) */
$SysConf = bootstrap();
/* Initialize global system configuration variables $SysConfig[] */
ConfigInit($SYSCONFDIR, $SysConf);
/* Directories */
$GoodDir = "regression/good/";
$PostDir = "regression/post/";
$OutputDirTemplate = "regression/output_";
/* output dir is suffixed with pid */
$OutputDir = $OutputDirTemplate . posix_getpid();
/* -h webhost
*/
$Options = getopt("hw:");
if (array_key_exists('h', $Options)) {
Usage($argc, $argv);
exit(0);
}
开发者ID:DanielDobre,项目名称:fossology,代码行数:31,代码来源:regressiontest.php
示例9: add
<?php
include "lib/_inc.php";
use matuck\DelugeApi\Client\HTTPClient;
class TorrentController extends Controller
{
public function add()
{
$page = isset($_GET["page"]) ? intval($_GET["page"]) : 1;
$order = isset($_GET["order"]) ? $_GET["order"] : "date_added";
$search = isset($_GET["q"]) ? $_GET["q"] : null;
return $this->renderView("torrent/add", array("movies" => YTS::getMovies($page, 8, $order, "desc", $search), "page" => $page, "order" => $order, "search" => $search));
}
public function download()
{
$contents = Http::get($_GET["url"]);
$fileInfo = new SplFileInfo($_GET["fname"]);
// Add the torrent to deluge using the RPC api
$tconfig = Storage::get("torrents");
$client = new HTTPClient((array) $tconfig->deluge);
$client->core->add_torrent_file($tconfig->dropPath . "/" . $fileInfo->getFilename() . ".torrent", base64_encode($contents), null);
return $this->redirect("/?alert=" . urlencode("Torrent download started"));
}
public function dashboard()
{
return $this->renderView("torrent/dashboard");
}
}
bootstrap(TorrentController::class);
开发者ID:dmeijboom,项目名称:RaspberryWebInterface,代码行数:29,代码来源:torrent.php
示例10: define
<?php
// $Id$
/**
* 脚本开始运行时间
*/
define('DIDA_START_TIME', microtime(true));
/**
* 工作目录
* 建议包含文件,使用绝对路径。
*/
define('DIDA_ROOT', getcwd());
require_once DIDA_ROOT . '/includes/bootstrap.inc';
// 程序初始化
bootstrap('full');
// 获取当前路径($_GET['q'])输出
$return = menu_get_item();
// 针对当前路径,所有模块输出完成,触发 hook_exit()
module_invoke_all('exit', 'full');
if (is_int($return)) {
switch ($return) {
case MENU_ACCESS_DENIED:
// 无权限访问
dd_get_access();
break;
case MENU_NOT_FOUND:
// 路径未定义
dd_get_not();
}
exit;
}
开发者ID:didaah,项目名称:dida,代码行数:31,代码来源:index.php
示例11: _getTorrents
<?php
include "lib/_inc.php";
use matuck\DelugeApi\Client\HTTPClient;
class DashboardController extends Controller
{
private function _getTorrents()
{
$tconfig = Storage::get("torrents");
$client = new HTTPClient((array) $tconfig->deluge);
return $client->core->get_torrents_status([], ["name", "total_size", "files", "progress"]);
}
public function index()
{
return $this->renderView("dashboard/index", array("volumes" => Storage::get("volumes"), "torrents" => $this->_getTorrents(), "page" => "dashboard", "alertEnabled" => isset($_GET["alert"]), "alertText" => isset($_GET["alert"]) ? urldecode($_GET["alert"]) : null));
}
}
bootstrap(DashboardController::class);
开发者ID:dmeijboom,项目名称:RaspberryWebInterface,代码行数:18,代码来源:index.php
示例12: header
break;
case 'cli-server':
if (is_file($_SERVER['DOCUMENT_ROOT'] . $_SERVER['REQUEST_URI'])) {
return FALSE;
}
header('HTTP/1.0 500 Internal Server Error');
$_SERVER['SCRIPT_URL'] = substr($_SERVER['REQUEST_URI'], 0, strcspn($_SERVER['REQUEST_URI'], '?#'));
$_SERVER['SERVER_PROFILE'] = getenv('SERVER_PROFILE');
define('STDIN', fopen('php://stdin', 'rb'));
define('STDOUT', fopen('php://stdout', 'wb'));
define('STDERR', fopen('php://stderr', 'wb'));
break;
default:
header('HTTP/1.0 500 Internal Server Error');
}
ini_set('error_prepend_string', '<xmp>');
ini_set('error_append_string', '</xmp>');
ini_set('html_errors', 0);
// Bootstrap
if (!(include __DIR__ . DIRECTORY_SEPARATOR . 'lang.base.php')) {
trigger_error('[bootstrap] Cannot determine boot class path', E_USER_ERROR);
exit(0x3d);
}
// Set up class path
$paths = array();
$scan = explode(PATH_SEPARATOR . PATH_SEPARATOR, get_include_path());
foreach (explode(PATH_SEPARATOR, $scan[0]) as $path) {
$paths[] = '~' === $path[0] ? str_replace('~', $webroot, $path) : $path;
}
bootstrap(scanpath($paths, $webroot) . (isset($scan[1]) ? $scan[1] : ''));
exit(\xp\scriptlet\Runner::main(array($webroot, $configd, $_SERVER['SERVER_PROFILE'], $_SERVER['SCRIPT_URL'])));
开发者ID:melogamepay,项目名称:xp-framework,代码行数:31,代码来源:web.php
示例13: ariPageHeader
/**
* Set HTTP headers in preparation for a page response.
*
* TODO: Figure out caching
*/
function ariPageHeader()
{
header('Content-type: text/html; charset=utf-8');
bootstrap();
}
开发者ID:hardikk,项目名称:HNH,代码行数:10,代码来源:bootstrap.php
示例14: header
case 'cli-server':
if (is_file($_SERVER['DOCUMENT_ROOT'] . $_SERVER['REQUEST_URI'])) {
return FALSE;
}
header('HTTP/1.0 500 Internal Server Error');
$_SERVER['SCRIPT_URL'] = substr($_SERVER['REQUEST_URI'], 0, strcspn($_SERVER['REQUEST_URI'], '?#'));
$_SERVER['SERVER_PROFILE'] = getenv('SERVER_PROFILE');
define('STDIN', fopen('php://stdin', 'rb'));
define('STDOUT', fopen('php://stdout', 'wb'));
define('STDERR', fopen('php://stderr', 'wb'));
break;
default:
header('HTTP/1.0 500 Internal Server Error');
}
ini_set('error_prepend_string', '<xmp>');
ini_set('error_append_string', '</xmp>');
ini_set('html_errors', 0);
// Bootstrap
if (!(include __DIR__ . DIRECTORY_SEPARATOR . 'lang.base.php')) {
trigger_error('[bootstrap] Cannot determine boot class path', E_USER_ERROR);
exit(0x3d);
}
// Set up class path
$paths = array();
list($use, $include) = explode(PATH_SEPARATOR . PATH_SEPARATOR, get_include_path());
foreach (explode(PATH_SEPARATOR, $use) as $path) {
$paths[] = '~' == $path[0] ? str_replace('~', $webroot, $path) : $path;
}
bootstrap(scanpath($paths, $webroot) . $include);
uses('xp.scriptlet.Runner');
exit(xp·scriptlet·Runner::main(array($webroot, $configd, $_SERVER['SERVER_PROFILE'], $_SERVER['SCRIPT_URL'])));
开发者ID:Gamepay,项目名称:xp-framework,代码行数:31,代码来源:web.php
示例15: markdownfile
}
public function markdownfile($data, $file)
{
$parser = new \cebe\markdown\GithubMarkdown();
$parser->html5 = true;
$data["contents"] = $parser->parse(file_get_contents($file->getRealPath()));
return $this->renderView("file/text", $data);
}
public function excelFile($data, $file)
{
try {
$inputFileType = PHPExcel_IOFactory::identify($file->getRealPath());
$objReader = PHPExcel_IOFactory::createReader("Excel2007");
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load($file->getRealPath());
} catch (Exception $e) {
exit("Error loading file..");
}
$sheet = $objPHPExcel->getSheet(0);
$highestRow = $sheet->getHighestRow();
$highestColumn = $sheet->getHighestColumn();
$rows = [];
for ($row = 1; $row <= $highestRow; $row++) {
$rows[] = $sheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, null, true, false)[0];
}
$data["rows"] = array("headers" => array_shift($rows), "data" => $rows);
return $this->renderView("file/table", $data);
}
}
bootstrap(FileController::class);
开发者ID:dmeijboom,项目名称:RaspberryWebInterface,代码行数:30,代码来源:file.php
示例16: array
$settings['enabled_modules'] = array('admin', 'user', 'schemaManager', 'fieldManager', 'themer', 'fileManager');
$settings['installed_modules'] = array('admin', 'user', 'schemaManager', 'fieldManager', 'themer', 'fileManager');
$settings['module_versions'] = array('admin' => '.1', 'user' => '.1', 'schemaManager' => '.3', 'fieldManager' => '.2', 'fileManager' => '.3', 'themer' => '.1');
$settings['module_data']['admin']['path'] = 'modules/admin/';
$settings['module_data']['user']['path'] = 'modules/user/';
$settings['module_data']['schemaManager']['path'] = 'modules/schemaManager/';
$settings['module_data']['fieldManager']['path'] = 'modules/fieldManager/';
$settings['module_data']['fileManager']['path'] = 'modules/fileManager/';
$settings['module_data']['themer']['path'] = 'modules/themer/';
$settings['home_page'] = 'user/login';
$settings['default_theme'] = 'default';
$settings['clean_urls'] = FALSE;
$settings['footer_message'] = "running_on_agave();";
$settings['sess_method'] = 'database';
//ROUTE INSTALL PROCESS
if (bootstrap()) {
$mode = $_SESSION['install-mode'];
if (!isset($mode)) {
install_begin();
} else {
switch ($mode) {
case 'core':
install_core();
break;
case 'user':
install_user();
break;
case 'info':
install_site_info();
break;
case 'finish':
开发者ID:jwarchal,项目名称:Agave,代码行数:31,代码来源:install.php
示例17: bootstrap
*/
function bootstrap($configuration_array)
{
$config = new \Pste\Config($configuration_array);
\Pste\Registry::getInstance()->config = $config;
$route = new \Pste\Route();
$route->setTemplatePath($config->template);
\Pste\Registry::getInstance()->route = $route;
}
function __autoload($class)
{
$nsSplit = explode('\\', $class);
if (count($nsSplit) >= 2 && $nsSplit[0] == 'Pste') {
if (count($nsSplit) == 3) {
// some special rules for components and models
if ($nsSplit[1] == 'Component') {
require_once 'components/' . $nsSplit[2] . '.php';
} else {
if ($nsSplit[1] == 'Model') {
require_once 'models/' . $nsSplit[2] . '.php';
} else {
require_once implode('/', $nsSplit) . '.php';
}
}
} else {
require_once implode('/', $nsSplit) . '.php';
}
}
}
bootstrap($CONF);
开发者ID:nicolask,项目名称:Indechse-pste,代码行数:30,代码来源:bootstrap.php
示例18: ini_set
if ('cgi' === PHP_SAPI || 'cgi-fcgi' === PHP_SAPI) {
ini_set('html_errors', 0);
define('STDIN', fopen('php://stdin', 'rb'));
define('STDOUT', fopen('php://stdout', 'wb'));
define('STDERR', fopen('php://stderr', 'wb'));
} else {
if ('cli' !== PHP_SAPI) {
trigger_error('[bootstrap] Cannot be run under ' . PHP_SAPI . ' SAPI', E_USER_ERROR);
exit(0x3d);
}
}
if (!(include __DIR__ . DIRECTORY_SEPARATOR . 'lang.base.php')) {
trigger_error('[bootstrap] Cannot determine boot class path', E_USER_ERROR);
exit(0x3d);
}
$home = getenv('HOME');
list($use, $include) = explode(PATH_SEPARATOR . PATH_SEPARATOR, get_include_path());
bootstrap(scanpath(explode(PATH_SEPARATOR, substr($use, 2) . PATH_SEPARATOR . '.'), $home) . $include);
uses('util.cmd.ParamString', 'util.cmd.Console');
ini_set('error_prepend_string', EPREPEND_IDENTIFIER);
set_exception_handler('__except');
ob_start('__output');
array_shift($_SERVER['argv']);
try {
exit(XPClass::forName($argv[1])->getMethod('main')->invoke(NULL, array(array_slice($argv, 2))));
} catch (SystemExit $e) {
if ($message = $e->getMessage()) {
echo $message, "\n";
}
exit($e->getCode());
}
开发者ID:Gamepay,项目名称:xp-framework,代码行数:31,代码来源:class.php
示例19: DirectoryIterator
}
}
$folder = new DirectoryIterator($volume->path . $root);
$files = array();
foreach ($folder as $file) {
if ($file->isDot()) {
continue;
}
$icon = "file-o";
$iconMap = array("pdf" => "file-pdf-o", "jpg" => "file-image-o", "png" => "file-image-o", "jpeg" => "file-image-o", "gif" => "file-image-o", "bmp" => "file-image-o", "php" => "file-code-o", "xml" => "file-code-o", "html" => "file-code-o", "cs" => "file-code-o", "js" => "file-code-o", "ts" => "file-code-o", "xls" => "file-excel-o", "xlsx" => "file-excel-o", "doc" => "file-word-o", "docx" => "file-word-o", "ppt" => "file-powerpoint-o", "pptx" => "file-powerpoint-o", "mp3" => "file-audio-o", "mpeg" => "file-audio-o", "flac" => "file-audio-o", "txt" => "file-text-o");
if ($file->isDir()) {
$icon = "folder-o";
} else {
if (isset($iconMap[$file->getExtension()])) {
$icon = $iconMap[$file->getExtension()];
}
}
$files[] = array("name" => $file->getBasename(), "type" => $file->isDir() ? "dir" : "file", "icon" => $icon, "path" => $root . $file->getFilename(), "is_image" => strrpos($icon, "image") > -1);
}
usort($files, function ($a, $b) {
return $b["type"] === "dir";
});
$up_path = pathinfo($root)["dirname"];
if (substr($up_path, strlen($up_path) - 1, 1) !== "/") {
$up_path .= "/";
}
return $this->renderView("volume/details", array("volume" => $volume, "page" => "volume", "files" => $files, "path" => $root, "up_path" => $up_path));
}
}
bootstrap(VolumeController::class);
开发者ID:dmeijboom,项目名称:RaspberryWebInterface,代码行数:30,代码来源:volume.php
示例20: header
header('Content-Type: text/plain; charset=utf8');
if (version_compare('5.5.0', PHP_VERSION, '<=')) {
exit('Версия PHP: ' . PHP_VERSION . ' необходимо 5.5.0 и ниже.');
}
define('CURRENT_VERSION', '1.1.beta');
$config = array();
$config_js = array();
$menu = array();
$user = new stdClass();
define('DROOT', __DIR__);
include DROOT . '/config.php';
$config = !empty($config[$_SERVER['HTTP_HOST']]) ? $config[$_SERVER['HTTP_HOST']] : $config['default'];
$request_path = trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');
include DROOT . '/tools/common.php';
include DROOT . '/src/menu.php';
bootstrap();
if ($request_path != FALSE) {
$args = explode('/', $request_path);
$data = array();
$item = get_menu();
if ($item === FALSE) {
header('HTTP/1.1 404 Not Found');
exit;
}
menu_execute($item);
ob_clean();
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0', FALSE);
header('Pragma: no-cache');
header('Content-Type: application/javascript; charset=utf8');
exit(json_encode($data));
开发者ID:artem0793,项目名称:orangutan,代码行数:31,代码来源:index.php
注:本文中的bootstrap函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论