本文整理汇总了PHP中Solar::start方法的典型用法代码示例。如果您正苦于以下问题:PHP Solar::start方法的具体用法?PHP Solar::start怎么用?PHP Solar::start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Solar
的用法示例。
在下文中一共展示了Solar::start方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetTextRaw_badLocaleKey
public function testGetTextRaw_badLocaleKey()
{
Solar::start(false);
$actual = $this->_view->getTextRaw('no such "locale" key');
$expect = 'no such "locale" key';
$this->assertSame($actual, $expect);
}
示例2: setup
public function setup()
{
Solar::start(false);
// to get the $locale object
parent::setup();
// when running from the command line, these elements are empty.
// add them so that web-like testing can occur.
$this->_request->server['HTTP_HOST'] = 'example.com';
$this->_request->server['SCRIPT_NAME'] = '/path/to/index.php';
$this->_request->server['PATH_INFO'] = '/appname/action';
$this->_request->server['QUERY_STRING'] = '';
$this->_request->server['REQUEST_URI'] = $this->_request->server['SCRIPT_NAME'] . $this->_request->server['PATH_INFO'] . '?' . $this->_request->server['QUERY_STRING'];
// emulate GET vars from the URI and inject to $this->_request
parse_str($this->_request->server['QUERY_STRING'], $this->_request->get);
}
示例3: dirname
*
* When you're ready to really get going, point your web server document root
* to `system/docroot/` and turn on mod_rewrite.
*
*/
// Solar system directory
$system = dirname(__FILE__);
// set the include-path
set_include_path("{$system}/include");
// load Solar
require_once 'Solar.php';
// get the system config array
$config = (require "{$system}/config.php");
// force the Action and Public URI path configs, overwriting anything from
// the original config
$path = $_SERVER['REQUEST_URI'];
$pos = strpos($path, "/index.php");
if ($pos !== false) {
// strip "/index.php" and everything after it
$path = substr($path, 0, $pos);
}
$path = rtrim($path, '/');
$config['Solar_Uri_Action']['path'] = "{$path}/index.php";
$config['Solar_Uri_Public']['path'] = "{$path}/docroot/public";
// start Solar with the modified config values
Solar::start($config);
// instantiate and run the front controller
$front = Solar_Registry::get('controller_front');
$front->display();
// Done!
Solar::stop();
示例4: setup
public function setup()
{
Solar::start(false);
// to get the $locale object
parent::setup();
}
示例5: set_include_path
<?php
set_include_path('../include');
require_once 'Solar.php';
$config_file = '../config/JForg.conf.php';
Solar::start($config_file);
$front = Solar::factory('Solar_Controller_Front');
$front->display();
Solar::stop();
示例6: define
<?php
/**
*
* Copy this file, edit the SOLAR_CONFIG_PATH to point to your
* config file, then run from the command line.
*
*/
define('SOLAR_CONFIG_PATH', '/path/to/Solar.config.php');
require 'Solar.php';
Solar::start();
$sql = Solar::factory('Solar_Sql');
// DROP INDEX nodes__unique_in_area__i ON nodes;
$sql->dropIndex('nodes', 'unique_in_area');
// CREATE UNIQUE INDEX nodes__area_type_name__i ON nodes (area_id, type, name);
$sql->createIndex('nodes', 'area_type_name', true, array('area_id', 'type', 'name'));
// done!
echo "Done!\n";
示例7: setUp
public function setUp()
{
Solar::start('config.inc.php');
}
示例8: setUp
public function setUp()
{
Solar::start('config.inc.php');
$this->_view = Solar::factory('Solar_View');
}