當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Q::setIni方法代碼示例

本文整理匯總了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");
 }
開發者ID:fchaose,項目名稱:qeephp,代碼行數:8,代碼來源:config.php

示例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();
 }
開發者ID:fchaose,項目名稱:qeephp,代碼行數:8,代碼來源:links.php

示例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();
 }
開發者ID:fchaose,項目名稱:qeephp,代碼行數:9,代碼來源:_include.php

示例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();
 }
開發者ID:fchaose,項目名稱:qeephp,代碼行數:9,代碼來源:test.php

示例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);
 }
開發者ID:fchaose,項目名稱:qeephp,代碼行數:10,代碼來源:basic.php

示例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);
 }
開發者ID:fchaose,項目名稱:qeephp,代碼行數:19,代碼來源:simple.php

示例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);
    }
}
開發者ID:fchaose,項目名稱:qeephp,代碼行數:25,代碼來源:unittest_common.php


注:本文中的Q::setIni方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。