當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。