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


PHP StorageFactory::adapterFactory方法代码示例

本文整理汇总了PHP中Zend\Cache\StorageFactory::adapterFactory方法的典型用法代码示例。如果您正苦于以下问题:PHP StorageFactory::adapterFactory方法的具体用法?PHP StorageFactory::adapterFactory怎么用?PHP StorageFactory::adapterFactory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\Cache\StorageFactory的用法示例。


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

示例1: _getSSObject

 /**
  * Enter description here...
  *
  * @return \Zend\Service\SlideShare\SlideShare
  */
 protected function _getSSObject()
 {
     $ss = new SlideShareService(TESTS_ZEND_SERVICE_SLIDESHARE_APIKEY, TESTS_ZEND_SERVICE_SLIDESHARE_SHAREDSECRET, TESTS_ZEND_SERVICE_SLIDESHARE_USERNAME, TESTS_ZEND_SERVICE_SLIDESHARE_PASSWORD, TESTS_ZEND_SERVICE_SLIDESHARE_SLIDESHOWID);
     $cache = CacheFactory::adapterFactory('memory', array('memory_limit' => 0));
     $ss->setCacheObject($cache);
     return $ss;
 }
开发者ID:bradley-holt,项目名称:zf2,代码行数:12,代码来源:SlideShareTest.php

示例2: setUp

 public function setUp()
 {
     $this->_originaltimezone = date_default_timezone_get();
     date_default_timezone_set('Europe/Paris');
     $this->_cache = CacheFactory::adapterFactory('memory', array('memory_limit' => 0));
     DateObjectTestHelper::setOptions(array('cache' => $this->_cache));
 }
开发者ID:rikaix,项目名称:zf2,代码行数:7,代码来源:DateObjectTest.php

示例3: testAdapterFactory

 public function testAdapterFactory()
 {
     $adapter1 = Cache\StorageFactory::adapterFactory('Memory');
     $this->assertInstanceOf('Zend\\Cache\\Storage\\Adapter\\Memory', $adapter1);
     $adapter2 = Cache\StorageFactory::adapterFactory('Memory');
     $this->assertInstanceOf('Zend\\Cache\\Storage\\Adapter\\Memory', $adapter2);
     $this->assertNotSame($adapter1, $adapter2);
 }
开发者ID:bradley-holt,项目名称:zf2,代码行数:8,代码来源:StorageFactoryTest.php

示例4: setUp

    /**
     * Sets up the fixture, for example, open a network connection.
     * This method is called before a test is executed.
     *
     * @return void
     */
    public function setUp()
    {
        $this->clearRegistry();

        $this->_cache = CacheFactory::adapterFactory('memory', array('memory_limit' => 0));
        Currency\Currency::setCache($this->_cache);

        $this->helper = new Helper\Currency('de_AT');
    }
开发者ID:niallmccrudden,项目名称:zf2,代码行数:15,代码来源:CurrencyTest.php

示例5: __construct

 /**
  * @param string        $apiKey
  * @param StorageInterface $cache
  */
 public function __construct($apiKey, $service, StorageInterface $cache = null)
 {
     $this->apiKey = $apiKey;
     $this->service = $service;
     if ($cache === null) {
         $cache = StorageFactory::adapterFactory('memory ', array('ttl' => 600));
     }
     $this->cache = $cache;
 }
开发者ID:antarus,项目名称:mystra-pve,代码行数:13,代码来源:ClientFactory.php

示例6: setUp

 protected function setUp()
 {
     $this->select = new Sql\Select();
     $this->select->from('test');
     $this->testCollection = range(1, 101);
     $this->paginator = new Paginator\Paginator(new Paginator\Adapter\ArrayAdapter($this->testCollection));
     $this->config = Config\Factory::fromFile(__DIR__ . '/_files/config.xml', true);
     $this->cache = CacheFactory::adapterFactory('memory', array('memory_limit' => 0));
     Paginator\Paginator::setCache($this->cache);
     $this->_restorePaginatorDefaults();
 }
开发者ID:rajanlamic,项目名称:IntTest,代码行数:11,代码来源:PaginatorTest.php

示例7: createAdapter

 private function createAdapter($name)
 {
     $name = ucfirst(strtolower($name));
     if ($name === self::ENGINE_FILE) {
         $name = self::ENGINE_FILESYSTEM;
     }
     $const = 'PHPPdf\\Cache\\CacheImpl::ENGINE_' . strtoupper($name);
     if (!defined($const)) {
         throw $this->cacheEngineDosntExistException($name);
     }
     $name = constant($const);
     return StorageFactory::adapterFactory($name);
 }
开发者ID:zhangxiaoliu,项目名称:PHPPdf,代码行数:13,代码来源:CacheImpl.php

示例8: __construct

 public function __construct($game)
 {
     $this->game = $game;
     //   $this->mock = new MockHandler([]);
     $this->client = new HttpClient();
     $adapter = new \Zend\Http\Client\Adapter\Curl();
     $adapter->setCurlOption(CURLOPT_SSL_VERIFYPEER, false);
     $this->client->setAdapter($adapter);
     // $this->client = new Client([
     //   'handler' => HandlerStack::create($this->mock)
     //]);
     $cache = StorageFactory::adapterFactory('memory ', array('ttl' => 100));
     parent::__construct('5nssdkuvwub25ydqzhwwznvzh8hh2ag9', new Region(Region::EUROPE), $cache);
 }
开发者ID:antarus,项目名称:mystra-pve,代码行数:14,代码来源:TestClient.php

示例9: setUp

 protected function setUp()
 {
     if (!extension_loaded('pdo_sqlite')) {
         $this->markTestSkipped('Pdo_Sqlite extension is not loaded');
     }
     $this->_adapter = new \Zend\Db\Adapter\Pdo\Sqlite(array('dbname' => __DIR__ . '/_files/test.sqlite'));
     $this->_query = $this->_adapter->select()->from('test');
     $this->_testCollection = range(1, 101);
     $this->_paginator = Paginator\Paginator::factory($this->_testCollection);
     $this->_config = Config\Factory::fromFile(__DIR__ . '/_files/config.xml', true);
     $this->_cache = CacheFactory::adapterFactory('memory', array('memory_limit' => 0));
     $this->_cache->clear(CacheAdapter::MATCH_ALL);
     Paginator\Paginator::setCache($this->_cache);
     $this->_restorePaginatorDefaults();
 }
开发者ID:bradley-holt,项目名称:zf2,代码行数:15,代码来源:PaginatorTest.php

示例10: setUp

 protected function setUp()
 {
     if (!extension_loaded('pdo_sqlite')) {
         $this->markTestSkipped('Pdo_Sqlite extension is not loaded');
     }
     $this->_adapter = new DbAdapter\Adapter(array('driver' => 'Pdo_Sqlite', 'database' => __DIR__ . '/_files/test.sqlite'));
     $this->_query = new Sql\Select();
     $this->_query->from('test');
     $this->_testCollection = range(1, 101);
     $this->_paginator = Paginator\Paginator::factory($this->_testCollection);
     $this->_config = Config\Factory::fromFile(__DIR__ . '/_files/config.xml', true);
     $this->_cache = CacheFactory::adapterFactory('memory', array('memory_limit' => 0));
     Paginator\Paginator::setCache($this->_cache);
     $this->_restorePaginatorDefaults();
 }
开发者ID:Rovak,项目名称:zf2,代码行数:15,代码来源:PaginatorTest.php

示例11: __construct

 public function __construct()
 {
     $this->tmpCacheDir = @tempnam(sys_get_temp_dir(), 'zend_cache_test_');
     if (!$this->tmpCacheDir) {
         $err = error_get_last();
         $this->fail("Can't create temporary cache directory-file: {$err['message']}");
     } elseif (!@unlink($this->tmpCacheDir)) {
         $err = error_get_last();
         $this->fail("Can't remove temporary cache directory-file: {$err['message']}");
     } elseif (!@mkdir($this->tmpCacheDir, 0777)) {
         $err = error_get_last();
         $this->fail("Can't create temporary cache directory: {$err['message']}");
     }
     $this->storage = StorageFactory::adapterFactory('filesystem', ['cache_dir' => $this->tmpCacheDir]);
     parent::__construct();
 }
开发者ID:stephenmoore56,项目名称:mooredatabase-laravel,代码行数:16,代码来源:FilesystemStorageAdapterBench.php

示例12: setUp

 public function setUp()
 {
     $this->_cache = CacheFactory::adapterFactory('memory', array('memory_limit' => 0));
 }
开发者ID:rajanlamic,项目名称:IntTest,代码行数:4,代码来源:MemoryManagerTest.php

示例13: testLoadingFilesIntoCacheAfterwards

    public function testLoadingFilesIntoCacheAfterwards()
    {
        $cache = CacheFactory::adapterFactory('memory', array('memory_limit' => 0));

        $this->assertFalse(Adapter\ArrayAdapter::hasCache());
        Adapter\ArrayAdapter::setCache($cache);
        $this->assertTrue(Adapter\ArrayAdapter::hasCache());

        $adapter = new Adapter\ArrayAdapter(__DIR__ . '/_files/translation_en.php', 'en');
        $cache   = Adapter\ArrayAdapter::getCache();
        $this->assertTrue($cache instanceof CacheAdapter);

        $adapter->addTranslation(__DIR__ . '/_files/translation_en.php', 'ru', array('reload' => true));
        $test = $adapter->getMessages('all');
        $this->assertEquals(6, count($test['ru']));
    }
开发者ID:niallmccrudden,项目名称:zf2,代码行数:16,代码来源:ArrayTest.php

示例14: testAdapterFactory

 public function testAdapterFactory()
 {
     $cache = Cache\StorageFactory::adapterFactory('Memory');
     $this->assertInstanceOf('Zend\\Cache\\Storage\\Adapter\\Memory', $cache);
 }
开发者ID:nevvermind,项目名称:zf2,代码行数:5,代码来源:StorageFactoryTest.php

示例15: setUp

 public function setUp()
 {
     $this->cache = CacheFactory::adapterFactory('memory', array('memory_limit' => 0));
     $this->testArray = array('foo' => 'bar', 'bar' => array('foo' => 'bar'));
 }
开发者ID:haoyanfei,项目名称:zf2,代码行数:5,代码来源:CacheTest.php


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