本文整理汇总了PHP中Q::changeIni方法的典型用法代码示例。如果您正苦于以下问题:PHP Q::changeIni方法的具体用法?PHP Q::changeIni怎么用?PHP Q::changeIni使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q
的用法示例。
在下文中一共展示了Q::changeIni方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
$dsn = Q::ini('db_dsn_pool/default');
if (empty($dsn)) {
Q::changeIni('db_dsn_pool/default', Q::ini('db_dsn_mysql'));
}
parent::__construct();
}
示例2: setUp
protected function setUp()
{
$dsn = Q::ini('db_dsn_pool/default');
if (empty($dsn)) {
Q::changeIni('db_dsn_pool/default', Q::ini('db_dsn_mysql'));
}
$this->dbo = QDB::getConn();
$this->dbo->connect();
}
示例3: setUp
protected function setUp()
{
$dsn = Q::ini('db_dsn_pool/default');
if (empty($dsn)) {
Q::changeIni('db_dsn_pool/default', Q::ini('db_dsn_mysql'));
}
$conn = QDB::getConn();
$params = array('name' => 'posts', 'pk' => 'post_id', 'conn' => $conn);
$this->table = new QDB_Table($params);
}
示例4: setUp
protected function setUp()
{
$rules = Helper_YAML::load(FIXTURE_DIR . '/mvc/routes.yaml');
foreach ($rules as $route_name => $rule) {
$index = 0;
foreach ($rule['tests_url'] as $test) {
$this->_tests_url["{$route_name}-{$index}"] = $test;
$index++;
}
unset($rules[$route_name]['tests_url']);
$index = 0;
foreach ($rule['tests_args'] as $test) {
$this->_tests_args["{$route_name}:{$index}"] = $test;
$index++;
}
unset($rules[$route_name]['tests_args']);
}
Q::changeIni('routes', $rules);
}
示例5: testChangeAndReadMultiValues
/**
* 修改和读取多个值
*/
function testChangeAndReadMultiValues($path = 'test-multi-values')
{
$values = array('value', 1234, -333, 3.54, true, 'key1' => 'value');
Q::changeIni($path, $values);
$this->assertEquals($values, Q::ini($path), "Q::ini('{$path}') multi values");
}
示例6: date_default_timezone_set
<?php
// $Id: ut_common.php 2252 2009-02-17 14:31:24Z dualface $
/**
* 单元测试公用初始化文件
*/
date_default_timezone_set('Asia/Shanghai');
error_reporting(E_ALL | E_STRICT);
require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/Framework/TestSuite.php';
require dirname(__FILE__) . '/../../library/q.php';
Q::changeIni('runtime_cache_dir', dirname(__FILE__) . '/../../tmp');
Q::changeIni('log_writer_dir', dirname(__FILE__) . '/../../tmp');
define('FIXTURE_DIR', dirname(dirname(__FILE__)) . DS . 'fixture');
/**
* 载入数据库连接信息
*/
$dsn_pool = Helper_YAML::load(FIXTURE_DIR . '/database.yaml');
Q::replaceIni('db_dsn_pool', $dsn_pool);
PHPUnit_Util_Filter::addDirectoryToFilter(dirname(dirname(__FILE__)));
abstract class QTest_UnitTest_Abstract extends PHPUnit_Framework_TestCase
{
protected function assertEmpty($var, $msg = '')
{
$this->assertTrue(empty($var), $msg);
}
protected function assertNotEmpty($var, $msg = '')
{
$this->assertTrue(!empty($var), $msg);
}
}
示例7: dirname
<?php
/**
* 创建开发者手册
*/
require dirname(__FILE__) . '/../library/q.php';
$dir = dirname(__FILE__);
Q::import($dir);
Q::import($dir . '/command');
Q::import($dir . '/command/book');
Q::import($dir . '/_vendor/zf');
Q::changeIni('vendor_dir', dirname(__FILE__) . DS . '_vendor');
if (!isset($argv[2])) {
echo <<<EOT
php gen_book.php <source_dir> <output_dir> [mode]
syntax:
mode: "online", "offline" or "chm", online is default
EOT;
exit(-1);
}
$source_dir = $argv[1];
$output_dir = $argv[2];
if (isset($argv[3])) {
$mode = strtolower(trim($argv[3]));
} else {
$mode = 'online';