本文整理汇总了PHP中Q::setIni方法的典型用法代码示例。如果您正苦于以下问题:PHP Q::setIni方法的具体用法?PHP Q::setIni怎么用?PHP Q::setIni使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q
的用法示例。
在下文中一共展示了Q::setIni方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetIniFromValueSetByPath
function testGetIniFromValueSetByPath()
{
$value = array('item1' => 123, 'item2' => 'item2', 'item3' => array('si' => 456));
Q::setIni('the_key_2', $value);
$this->assertEquals('item2', Q::getIni('the_key_2/item2'), "Q::getIni('the_key_2/item2' == 'item2'");
$this->assertEquals($value['item3'], Q::getIni('the_key_2/item3'), "Q::getIni('the_key_2/item3') == array");
$this->assertEquals(456, Q::getIni('the_key_2/item3/si'), "Q::getIni('the_key_2/item3/si') == 456");
}
示例2: __construct
function __construct()
{
$dsn = Q::getIni('db_dsn_pool/default');
if (empty($dsn)) {
Q::setIni('db_dsn_pool/default', Q::getIni('db_dsn_mysql'));
}
parent::__construct();
}
示例3: setUp
protected function setUp()
{
$dsn = Q::getIni('db_dsn_pool/default');
if (empty($dsn)) {
Q::setIni('db_dsn_pool/default', Q::getIni('db_dsn_mysql'));
}
$this->dbo = QDB::getConn();
$this->dbo->connect();
}
示例4: setUp
protected function setUp()
{
$dsn = Q::getIni('db_dsn_pool/default');
if (empty($dsn)) {
Q::setIni('db_dsn_pool/default', Q::getIni('db_dsn_mysql'));
}
$this->_conn = QDB::getConn();
$this->_conn->startTrans();
}
示例5: setUp
protected function setUp()
{
$dsn = Q::getIni('db_dsn_pool/default');
if (empty($dsn)) {
Q::setIni('db_dsn_pool/default', Q::getIni('db_dsn_mysql'));
}
$conn = QDB::getConn();
$params = array('name' => 'posts', 'pk' => 'post_id', 'conn' => $conn);
$this->table = new QDB_Table($params);
}
示例6: setUp
protected function setUp()
{
$rules = Helper_YAML::load(FIXTURE_DIR . '/router/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::setIni('routes', $rules);
}
示例7: define
<?php
// $Id$
/**
* 单元测试公用初始化文件
*/
require_once 'PHPUnit/Framework.php';
if (defined('TEST_INIT')) {
return;
}
define('TEST_INIT', true);
date_default_timezone_set('Asia/ShangHai');
require dirname(__FILE__) . '/../../library/q.php';
spl_autoload_register(array('Q', 'loadClass'));
Q::setIni('runtime_cache_dir', dirname(__FILE__) . '/../../tmp');
Q::setIni('log_writer_dir', dirname(__FILE__) . '/../../tmp');
define('FIXTURE_DIR', dirname(dirname(__FILE__)) . DS . 'fixture');
Q::import(FIXTURE_DIR);
abstract class QTest_UnitTest_Abstract extends PHPUnit_Framework_TestCase
{
protected function assertEmpty($var, $msg = '')
{
$this->assertTrue(empty($var), $msg);
}
}