当前位置: 首页>>代码示例>>PHP>>正文


PHP lmb_var_dir函数代码示例

本文整理汇总了PHP中lmb_var_dir函数的典型用法代码示例。如果您正苦于以下问题:PHP lmb_var_dir函数的具体用法?PHP lmb_var_dir怎么用?PHP lmb_var_dir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了lmb_var_dir函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _createIniFileNames

 function _createIniFileNames()
 {
     $name = mt_rand();
     $file = lmb_var_dir() . '/tmp_ini/' . $name . '.ini';
     $override_file = lmb_var_dir() . '/tmp_ini/' . $name . '.override.ini';
     return array($file, $override_file);
 }
开发者ID:anykey84,项目名称:YaBackup,代码行数:7,代码来源:lmbIniOverrideTest.class.php

示例2: testCacheCreation

 function testCacheCreation()
 {
     $cache_dir = lmb_var_dir() . '/some_dir';
     $cache = lmbCacheFactory::createConnection('file://' . $cache_dir);
     $this->assertEqual('file', $cache->getType());
     $this->assertEqual($cache_dir, $cache->getCacheDir());
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:7,代码来源:lmbCacheFactoryTest.class.php

示例3: aggregate

 function aggregate()
 {
     if (!rename($this->log_file, $new_name = tempnam(lmb_var_dir(), 'cache_log_aggregator'))) {
         throw new lmbException('Can\'t move file', array('source' => $this->log_file, 'destination' => $new_name));
     }
     $cmd = "cat " . $new_name . ' | awk \' {if($NF>1){data[$2"/"$1]++;}} END{for(i in data){print i"/"data[i];}}\'';
     $output = array();
     exec($cmd, $output);
     unlink($new_name);
     $info = array();
     foreach ($output as $string) {
         list($cache_name, $result, $count) = explode('/', $string);
         if (!isset($info[$cache_name])) {
             $info[$cache_name] = array();
         }
         if (lmbCacheLog::PREFIX_HIT === $result) {
             $info[$cache_name]['hits_count'] = $count;
         } elseif (lmbCacheLog::PREFIX_MISS === $result) {
             $info[$cache_name]['misses_count'] = $count;
         } else {
             throw new lmbException('WTF?', array($string));
         }
     }
     return $info;
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:25,代码来源:lmbCacheLogAggregator.class.php

示例4: setUp

 function setUp()
 {
     parent::setUp();
     $this->conn = lmbToolkit::instance()->getDefaultDbConnection();
     $dir_for_tests = lmb_var_dir() . '/constructor/';
     $this->dir_for_test_case = $dir_for_tests . '/' . get_class($this);
     lmbFs::mkdir($this->dir_for_test_case);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:8,代码来源:lmbConstructorUnitTestCase.class.php

示例5: _createIniFile

 function _createIniFile($contents, &$override_file = null)
 {
     $name = mt_rand();
     $file = lmb_var_dir() . '/tmp_ini/' . $name . '.ini';
     $override_file = lmb_var_dir() . '/tmp_ini/' . $name . '.override.ini';
     file_put_contents($file, $contents);
     return $file;
 }
开发者ID:anykey84,项目名称:YaBackup,代码行数:8,代码来源:lmbCachedIniCachingTest.class.php

示例6: testPackageInclude_CustomPath

 function testPackageInclude_CustomPath()
 {
     $this->createPackageMainFile('include_custom', lmb_var_dir());
     lmb_package_require('include_custom', lmb_var_dir());
     $this->assertTrue(lmb_package_registered('include_custom'));
     $this->assertTrue(lmb_Var_dir() . '/include_custom', lmb_package_get_path('include_custom'));
     $this->assertIdentical(1, lmbPackagesFunctionsTest::$counter);
 }
开发者ID:anykey84,项目名称:YaBackup,代码行数:8,代码来源:lmbPackagesTest.class.php

示例7: lmb_tests_init_var_dir

function lmb_tests_init_var_dir($value)
{
    if (file_exists($value)) {
        lmbFs::rm($value);
    }
    lmbFs::mkdir($value);
    $real = realpath($value) . '/';
    lmb_var_dir($real);
}
开发者ID:knevcher,项目名称:limb,代码行数:9,代码来源:init.inc.php

示例8: testWrite

 function testWrite()
 {
     $dsn = new lmbUri('file://' . lmb_var_dir() . '/logs/error' . uniqid() . '.log');
     $writer = new lmbLogFileWriter($dsn);
     $entry = new lmbLogEntry(LOG_ERR, 'foo');
     $writer->write($entry);
     $content = file_get_contents($writer->getLogFile());
     $this->assertPattern('/Error/', $content);
     $this->assertPattern('/foo/', $content);
 }
开发者ID:knevcher,项目名称:limb,代码行数:10,代码来源:lmbLogFileWriterTest.class.php

示例9: testWrite

 function testWrite()
 {
     $php_log = lmb_var_dir() . '/php.log';
     ini_set('error_log', $php_log);
     $writer = new lmbLogPHPLogWriter(new lmbUri());
     $writer->write(new lmbLogEntry(LOG_ERR, 'foo'));
     $content = file_get_contents($php_log);
     $this->assertPattern('/Error/', $content);
     $this->assertPattern('/foo/', $content);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:10,代码来源:lmbLogPHPLogWriterTest.class.php

示例10: testParse

 function testParse()
 {
     $dsn = lmb_var_dir() . '/input_stream';
     $params = 'foo_1=bar_1&foo_2=bar_2';
     file_put_contents($dsn, $params);
     $input_stream_parser = new lmbInputStreamParser();
     $parsed_params = $input_stream_parser->parse($dsn);
     $this->assertEqual($parsed_params['foo_1'], 'bar_1');
     $this->assertEqual($parsed_params['foo_2'], 'bar_2');
 }
开发者ID:anykey84,项目名称:YaBackup,代码行数:10,代码来源:lmbInputStreamParserTest.class.php

示例11: setUp

 function setUp()
 {
     if (!is_dir(lmb_var_dir())) {
         mkdir(lmb_var_dir());
     }
     $this->tmp_dir = lmb_var_dir() . '/lmb_require/';
     $this->_rm($this->tmp_dir);
     mkdir($this->tmp_dir);
     $this->env = $_ENV;
 }
开发者ID:anykey84,项目名称:YaBackup,代码行数:10,代码来源:lmbRequireBaseTest.class.php

示例12: setUp

 function setUp()
 {
     lmbToolkit::save();
     $this->toolkit = lmbToolkit::merge(new lmbConfTools());
     $this->application_configs_dir = lmb_var_dir() . '/app/settings';
     lmbFs::mkdir($this->application_configs_dir);
     $this->package_configs_dir = lmb_var_dir() . '/package/settings';
     lmbFs::mkdir($this->package_configs_dir);
     $tests_include_apth = $this->application_configs_dir . ';' . $this->package_configs_dir;
     $this->toolkit->setConfIncludePath($tests_include_apth);
 }
开发者ID:anykey84,项目名称:YaBackup,代码行数:11,代码来源:lmbConfToolsTest.class.php

示例13: setUp

 function setUp()
 {
     $this->base_dir = lmb_var_dir() . '/tpl';
     $this->tpl_dir = $this->base_dir;
     $this->cache_dir = $this->base_dir . '/compiled';
     $this->tags_dir = dirname(__FILE__) . '/../../src/tags';
     $this->filters_dir = dirname(__FILE__) . '/../../src/filters';
     lmbFs::rm(lmb_var_dir());
     lmbFs::mkdir(lmb_var_dir());
     lmbFs::mkdir($this->base_dir);
     lmbFs::mkdir($this->tpl_dir);
     lmbFs::mkdir($this->cache_dir);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:13,代码来源:lmbBaseMacroTest.class.php

示例14: testWrite_SetEntryTitle

 function testWrite_SetEntryTitle()
 {
     $toolkit = lmbToolkit::instance();
     $toolkit->setLogEntryTitle('some_title');
     $dsn = new lmbUri('file://' . lmb_var_dir() . '/logs/info' . uniqid() . '.log');
     $conf = array('logs' => array('foo' => $dsn));
     $toolkit->setConf('log', $conf);
     $toolkit->log('message', $level = LOG_INFO, $params = array(), null, $log_name = 'foo');
     $writers = $toolkit->getLog('foo')->getWriters();
     $this->assertIsA($writers[0], 'lmbLogFileWriter');
     $content = file_get_contents($writers[0]->getLogFile());
     $this->assertPattern('/some_title/', $content);
     $this->assertPattern('/Info/', $content);
     $this->assertPattern('/message/', $content);
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:15,代码来源:lmbLogFileWriterTest.class.php

示例15: lmb_tests_init_db_dsn

function lmb_tests_init_db_dsn()
{
    lmb_env_set('LIMB_CACHE_DB_META_IN_FILE', false);
    if (lmbToolkit::instance()->isDefaultDbDSNAvailable()) {
        $dsn = lmbToolkit::instance()->getDefaultDbDSN();
        static $reported_about;
        if (is_null($reported_about) || $reported_about != $dsn) {
            $pass = $dsn->_getUri()->getPassword();
            $masked_dsn = str_replace($pass, str_pad('*', strlen($pass), '*'), $dsn->toString());
            echo "INFO: Using database '{$masked_dsn}'\n";
            $reported_about = $dsn;
        }
    } else {
        $default_value = 'sqlite://localhost/' . lmb_var_dir() . '/sqlite_tests.db';
        $dsn = lmb_env_get('LIMB_TEST_DB_DSN', $default_value);
        lmbToolkit::instance()->setDefaultDbDSN($dsn);
        echo "INFO: Using default test database '{$dsn}'\n";
    }
}
开发者ID:snowjobgit,项目名称:limb,代码行数:19,代码来源:init.inc.php


注:本文中的lmb_var_dir函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。