本文整理汇总了PHP中Bootstrap类的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap类的具体用法?PHP Bootstrap怎么用?PHP Bootstrap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Bootstrap类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: bootstrap
/**
* Bootstrap the application
*
* Throws Steelcode_Application_Exception if Bootstrap class
* does not extend Steelcode_Application_Bootstrap_Abstract
*
* @param array $options
* @return Stelcode_Application_Config
* @throws Steelcode_Application_Exception
*/
public function bootstrap($options = array())
{
if (!$this->_bootstrap instanceof Steelcode_Application_Bootstrap) {
throw new Steelcode_Application_Exception('Class Bootstrap does not extend Steelcode_Application_Bootstrap_Abstract');
}
return $this->_bootstrap->bootstrap($options);
}
开发者ID:ajaysreedhar,项目名称:steelcode-framework,代码行数:17,代码来源:Bootstrapper.php
示例2: generate_meta_box
/**
* generate Input type
*/
public function generate_meta_box()
{
global $post_id;
$bootstrap = new Bootstrap();
$bootstrap->load_bootstrap_css();
foreach ($this->meta_boxes["input"] as $input) {
switch ($input["type"]) {
case "text":
$this->render->view("input.text", $input, plugin_dir_path(__FILE__) . "../views/admin");
break;
case "editor":
$this->render->view("input.editor", $input, plugin_dir_path(__FILE__) . "../views/admin");
break;
case "textarea":
$this->render->view("input.textarea", $input, plugin_dir_path(__FILE__) . "../views/admin");
break;
case "email":
$this->render->view("input.email", $input, plugin_dir_path(__FILE__) . "../views/admin");
break;
case "img":
wp_enqueue_media();
$this->render->view("img", $input, plugin_dir_path(__FILE__) . "../views/admin");
break;
default:
$this->render->view($input["type"], $input, plugin_dir_path(__FILE__) . "../views/admin");
break;
}
}
}
开发者ID:Darkan35,项目名称:Wordpress-CPT-class,代码行数:32,代码来源:PluginMetaBox.php
示例3: bootstrap
public function bootstrap($bootstrap_nodes = NULL)
{
$nodes = $this->settings->kbuckets->toNodeList();
if ($bootstrap_nodes !== NULL) {
$nodes->addNodeList($bootstrap_nodes);
}
$task = new Bootstrap($this->settings, $nodes);
return $task->enqueue();
}
开发者ID:rongzedong,项目名称:kademlia.php,代码行数:9,代码来源:instance.php
示例4: run
/**
* Run the bootstrap process of the application
* Define constants, settings etc.
* Main point in index.php
*
* @return void
*/
public static function run()
{
if (self::$instance === null) {
self::$instance = new Bootstrap();
}
self::$instance->app = new \Silex\Application();
self::$instance->defineConstants();
self::$instance->includeSettingsAndRoutes();
self::$instance->app->run();
}
开发者ID:andrij2012,项目名称:silex-skeleton,代码行数:17,代码来源:Bootstrap.php
示例5: runApplication
/**
* @param string $url
* @param \Phalcon\DI\FactoryDefault $di
*/
private function runApplication($url, DI\FactoryDefault $di = null)
{
require_once dirname(__DIR__) . '/../fixtures/app/Bootstrap.php';
$config = (require dirname(__DIR__) . '/../fixtures/app/config/config.php');
$config = new \Phalcon\Config($config);
$bootstrap = new \Bootstrap($config);
if ($di != null) {
$bootstrap->setDi($di);
}
$bootstrap->setup()->run($url);
}
开发者ID:vegas-cmf,项目名称:acl,代码行数:15,代码来源:PluginTest.php
示例6: UsesBootstrapCssDependingOnSwitches
/**
* @test
* @dataProvider BootstrapCssFilenames
*/
public function UsesBootstrapCssDependingOnSwitches($cdn, $responsive, $fontawesome, $mincss, $expected_filename)
{
$component = new Bootstrap();
$component->_assetsUrl = 'assets';
$component->assetsRegistry = new FakeAssetsRegistry();
$component->enableCdn = $cdn;
$component->responsiveCss = $responsive;
$component->fontAwesomeCss = $fontawesome;
$component->minify = $mincss;
$component->registerBootstrapCss();
$this->assertEquals($expected_filename, $component->assetsRegistry->getLastRegisteredCssFile());
}
开发者ID:LumbaJack,项目名称:Mercado-BTX,代码行数:16,代码来源:BootstrapTest.php
示例7: testPostRequestDoesDispatch
/**
* @covers \Heystack\Core\Bootstrap::__construct
* @covers \Heystack\Core\Bootstrap::postRequest
* @covers \Heystack\Core\Bootstrap::doBootstrap
*/
public function testPostRequestDoesDispatch()
{
$session = $this->getSessionMock();
$sessionBackend = $this->getMock('Heystack\\Core\\State\\Backends\\Session');
$eventDispatcher = $this->getMock('Heystack\\Core\\EventDispatcher');
$sessionBackend->expects($this->once())->method('setSession')->with($session);
$eventDispatcher->expects($this->once())->method('dispatch')->with(Events::POST_REQUEST);
$this->container->expects($this->at(0))->method('get')->with(Services::BACKEND_SESSION)->will($this->returnValue($sessionBackend));
$this->container->expects($this->at(1))->method('get')->with(Services::EVENT_DISPATCHER)->will($this->returnValue($eventDispatcher));
$b = new Bootstrap($this->container);
$b->doBootstrap($session);
$b->postRequest($this->getRequestMock(), $this->getMock('SS_HTTPResponse'), $this->getMock('DataModel'));
}
开发者ID:helpfulrobot,项目名称:heystack-heystack,代码行数:18,代码来源:BootstrapTest.php
示例8: getSystemLogPath
/**
* Returns the path to system file configurated to log errors. If no paramter
* is passed, tries to load bootstrap from Agana_Util_Bootstrap, else, loads
* from parameter variable.
*
* @param Bootstrap $bootsrap
* @return string System error file path
*/
public static function getSystemLogPath($bootsrap = null)
{
if ($bootsrap) {
$options = $bootsrap->getOption('agana');
} else {
$options = Agana_Util_Bootstrap::getOption('agana');
}
if (isset($options['app']['syserrorfile'])) {
$sysLogFile = $options['app']['syserrorfile'];
} else {
$sysLogFile = APPLICATION_DATA_PATH . '/app.error.log.xml';
}
return $sysLogFile;
}
开发者ID:brunopbaffonso,项目名称:ongonline,代码行数:22,代码来源:Log.php
示例9: setUp
public function setUp()
{
$_SERVER['HTTP_HOST'] = 'vegas.dev';
$_SERVER['REQUEST_URI'] = '/';
$this->di = DI::getDefault();
$modules = (new ModuleLoader())->dump(TESTS_ROOT_DIR . '/fixtures/app', TESTS_ROOT_DIR . '/fixtures/app/config/');
$app = new Application();
$app->registerModules($modules);
require_once TESTS_ROOT_DIR . '/fixtures/app/Bootstrap.php';
$config = (require TESTS_ROOT_DIR . '/fixtures/app/config/config.php');
$config = new \Phalcon\Config($config);
$bootstrap = new \Bootstrap($config);
$bootstrap->setup();
$this->bootstrap = $bootstrap;
}
开发者ID:vegas-cmf,项目名称:apidoc,代码行数:15,代码来源:TestCase.php
示例10: init
/**
*### .init()
*
* Initializes the widget.
*/
public function init()
{
parent::init();
$classes = array('table');
if (isset($this->type)) {
if (is_string($this->type)) {
$this->type = explode(' ', $this->type);
}
if (!empty($this->type)) {
$validTypes = array(self::TYPE_STRIPED, self::TYPE_BORDERED, self::TYPE_CONDENSED, self::TYPE_HOVER);
foreach ($this->type as $type) {
if (in_array($type, $validTypes)) {
$classes[] = 'table-' . $type;
}
}
}
}
if (!empty($classes)) {
$classes = implode(' ', $classes);
if (isset($this->itemsCssClass)) {
$this->itemsCssClass .= ' ' . $classes;
} else {
$this->itemsCssClass = $classes;
}
}
$booster = Bootstrap::getBooster();
$popover = $booster->popoverSelector;
$tooltip = $booster->tooltipSelector;
$afterAjaxUpdate = "js:function() {\n\t\t\tjQuery('.popover').remove();\n\t\t\tjQuery('{$popover}').popover();\n\t\t\tjQuery('.tooltip').remove();\n\t\t\tjQuery('{$tooltip}').tooltip();\n\t\t}";
if (!isset($this->afterAjaxUpdate)) {
$this->afterAjaxUpdate = $afterAjaxUpdate;
}
}
开发者ID:xunicorn,项目名称:ebay-simple-watching,代码行数:38,代码来源:TbGridView.php
示例11: setSkin
public static function setSkin($parser, $skin)
{
/* @todo: in order to work with parsercache this needs to cache the value in wikitext and retreive it
before the skin is initialized */
Bootstrap::$pageSkin = $skin;
return true;
}
开发者ID:tsynodinos,项目名称:booty,代码行数:7,代码来源:Booty.extension.php
示例12: __construct
public function __construct()
{
$config = Config::GetConfig();
$this->_dba = DatabaseAdapter::Create($config['db_adapter']);
$this->_dba->connect($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_flags']);
// Connect to the default database
// @todo Move this decision out of this class
if (class_exists('Bootstrap', false))
{
$this->_dba->selectDatabase(Bootstrap::GetDefaultDatabase()); // @todo Abstraction violation!
}
else
{
$default_db = Config::GetValue('default_db');
if (isset($default_db))
{
$this->_dba->selectDatabase($default_db); // @todo Hack!
}
}
return;
}
开发者ID:Goodgulf,项目名称:nodemesh,代码行数:25,代码来源:class.DatabaseConnection.php
示例13: __construct
public function __construct()
{
$b = Bootstrap::getInstance();
$b->init();
$b->includeWordPress();
$this->uploadDir = wp_upload_dir();
}
开发者ID:eriktorsner,项目名称:wp-bootstrap-ui,代码行数:7,代码来源:Extractmedia.php
示例14: forge
/**
* @access public
* @static
* @param array $attrs (default: array())
* @return void
*/
public static function forge(array $attrs = array())
{
is_null(self::$helper) and self::$helper = Bootstrap::forge('html');
// increment instance num, if we need to render more tan than 1 tabs element
self::$inst_num++;
return new self($attrs);
}
开发者ID:ronan-gloo,项目名称:FuelPHP-Twitter-Bootstrap,代码行数:13,代码来源:tab.php
示例15: errorAction
public function errorAction()
{
parent::errorAction();
$this->_helper->output('proto');
$this->view->setClass('Application\\Proto\\AsyncNotification\\Service\\Response');
$this->view->reason = $this->_message;
/*
const OK = 0;
const EXPIRED = 1;
const UNKNOWN_TOKEN = 2;
const WRONG_TOKEN = 3;
const WRONG_PROTO = 4;
const WRONG_MESSAGE = 5;
const UNKNOWN = 10;
*/
// TODO: review exception
$ex = $this->_exception;
switch (true) {
case $ex instanceof Application\Model\Mapper\Exception\MissingCacheException:
$this->view->code = Application\Proto\AsyncNotification\Service\Response\Code::EXPIRED;
break;
case $ex instanceof Application\Model\Mapper\Exception\InvalidArgumentException:
$this->view->code = Application\Proto\AsyncNotification\Service\Response\Code::WRONG_TOKEN;
break;
default:
$this->view->code = Application\Proto\AsyncNotification\Service\Response\Code::UNKNOWN;
break;
}
// TODO Why is sometimes sending response twice??? :S
Bootstrap::$responseSent = true;
}
开发者ID:SandeepUmredkar,项目名称:PortalSMIP,代码行数:31,代码来源:ErrorController.php
示例16: write
/**
* @param string $file
* @param string $content
* @return boolean
*/
public function write($file, $content)
{
$pathSavePHPUnit = Bootstrap::factory()->config('config.output.phpunit');
$pathReadFiles = Bootstrap::factory()->config('config.input.selenium');
$namespaces = explode('/', str_replace(array('_de_', '_', $pathReadFiles . '/', '.selenium'), array('De', '', '', ''), $file));
$namespaces[1] = "Suite{$namespaces[1]}";
$tmplStaticPageTest = file_get_contents('templates/TemplateStaticPageTest.php');
$tmplSuitePageTest = file_get_contents('templates/TemplateSuitePageTest.php');
$tmplTestPageTest = file_get_contents('templates/TemplateTestPageTest.php');
//write function
$tmplStaticPageTest = str_replace(array('CLASS_NAME', 'FUNCTION_NAME'), array($namespaces[0], $namespaces[0]), $tmplStaticPageTest);
$s1 = @file_put_contents("{$pathSavePHPUnit}/TemplateStaticPage{$namespaces[0]}Test.php", $tmplStaticPageTest);
//write suite
$tmplSuitePageTest = str_replace(array('CLASS_NAME', 'FUNCTION_NAME', 'SUITE_NAME'), array($namespaces[0] . $namespaces[1], $namespaces[0], $namespaces[1]), $tmplSuitePageTest);
$s2 = @file_put_contents("{$pathSavePHPUnit}/TemplateSuitePage{$namespaces[1]}Test.php", $tmplSuitePageTest);
//write test
$tmplTestPageTest = str_replace(array('CONTENT_XEBIUM', 'CLASS_NAME', 'FUNCTION_NAME', 'SUITE_NAME', 'TEST_NAME'), array($content, $namespaces[0] . $namespaces[1] . $namespaces[2], $namespaces[0], "{$namespaces[1]}", $namespaces[2]), $tmplTestPageTest);
$s3 = @file_put_contents("{$pathSavePHPUnit}/TemplateTestPage{$namespaces[2]}Test.php", $tmplTestPageTest);
if (!$s1) {
throw new Exception('Ocorreu um erro na criação da classe TemplateStaticPage!');
}
if (!$s2) {
throw new Exception('Ocorreu um erro na criação da classe TemplateSuitePage!');
}
if (!$s3) {
throw new Exception('Ocorreu um erro na criação da classe TemplateTestPage!');
}
return true;
}
开发者ID:roquebrasilia,项目名称:sgdoc-codigo,代码行数:34,代码来源:Write.php
示例17: instance
public static function instance()
{
if (self::$_instance === false) {
self::$_instance = new Bootstrap();
}
return self::$_instance;
}
开发者ID:adammajchrzak,项目名称:silesiamaps,代码行数:7,代码来源:Bootstrap.php
示例18: errorAction
public function errorAction()
{
parent::errorAction();
$this->view->message = $this->_message;
$this->view->error = $this->_errorCode;
if (!empty($this->_validationEntity)) {
$this->view->entity = $this->_validationEntity;
}
if (!empty($this->_validationErrors)) {
$this->view->validationErrors = $this->_validationErrors;
}
if (!empty($this->_errorMessages)) {
$this->view->errorMessages = $this->_errorMessages;
}
if ($this->_exception instanceof Application\Model\Mapper\Exception\EricssonException) {
$this->view->reason = $this->_exception->getReason();
}
//We need a big body to avoid IE bug about error responses inside iFrame
if ($this->getRequest()->getParam('iframeHack', false)) {
$hash = md5('I hate IE');
$this->_helper->output()->setContentType('text/html');
$this->view->ieHack = str_repeat($hash, 10);
}
// TODO Why is sometimes sending response twice??? :S
Bootstrap::$responseSent = true;
}
开发者ID:SandeepUmredkar,项目名称:PortalSMIP,代码行数:26,代码来源:ErrorController.php
示例19: getGeoInfo
public function getGeoInfo($ip)
{
$cache = Cache::getInstance();
$return = $cache->get('geo:' . $ip);
if ($cache->wasResultFound()) {
if (DEBUG_BAR) {
Bootstrap::getInstance()->debugbar['messages']->addMessage("Cached GeoInfo: {$ip}");
}
return $return;
}
$client = new \GuzzleHttp\Client();
//'https://geoip.maxmind.com/geoip/v2.1/city/me
$res = $client->get($this->url . $ip, array('auth' => array($this->user, $this->password)));
$body = $res->getBody(true);
$json = json_decode($body);
$return = array('countryCode' => $json->country->iso_code, 'countryName' => $json->country->names->en, 'state' => $json->subdivisions[0]->names->en, 'city' => $json->city->names->en);
if (empty($return['city'])) {
$return['city'] = 'Unknown';
}
if (empty($return['state'])) {
$return['state'] = 'Unknown';
}
$cache->set('geo:' . $ip, $return, 3600);
return $return;
}
开发者ID:ligerzero459,项目名称:block-explorer,代码行数:25,代码来源:MaxMind.php
示例20: __construct
function __construct()
{
$this->lines = [];
$this->debug = false;
$this->verbose = false;
$this->session_id = 'USR35AVKKF2TK';
// if( ($domain = getenv('DOMAIN')) && ( $mode = getenv('MODE') ) )
// $this->url = "http://".$mode.".api.".$domain;
// else
// throw new \Exception(" error in ".__METHOD__." environment variables DOMAIN and MODE not set");
// var_dump($this->url);
// exit();
//
if (getenv('URL')) {
$url = getenv('URL');
$this->url = $url;
} else {
if (getenv('DOMAIN') && getenv('MODE')) {
$domain = getenv('DOMAIN');
$mode = getenv('MODE');
$this->url = "http://" . $mode . ".api." . $domain;
} else {
if (is_null(self::$apiUrl) && class_exists("\\Bootstrap")) {
$this->url = Bootstrap::getApiUrl();
} else {
$this->url = self::apiUrl;
}
}
}
// var_dump($this->url);
// $this->url = "http://stringy"; // The POST URL
// $this->content_type = "Content-type: application/json";
$this->content_type = "Content-type: text/plain";
$this->request_block = ['jsonrpc' => '2.0', 'id' => 'rob', 'session_id' => 'USR35AVKKF2TK'];
}
开发者ID:robertblackwell,项目名称:srmn,代码行数:35,代码来源:Requester.php
注:本文中的Bootstrap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论