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


PHP AdminHandler::getServerVersion方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     $this->connection = getConnection();
     $this->collectionHandler = new CollectionHandler($this->connection);
     $this->collectionHandler->create('ArangoDB_PHP_TestSuite_IndexTestCollection');
     $adminHandler = new AdminHandler($this->connection);
     $version = $adminHandler->getServerVersion();
     $this->hasSparseIndexes = version_compare($version, '2.5.0') >= 0;
     $this->hasSelectivityEstimates = version_compare($version, '2.5.0') >= 0;
 }
开发者ID:TomSearch,项目名称:arangodb-php-docs,代码行数:10,代码来源:CollectionBasicTest.php

示例2: setUp

 public function setUp()
 {
     $this->connection = getConnection();
     $this->collectionHandler = new CollectionHandler($this->connection);
     // clean up first
     try {
         $this->collectionHandler->drop('ArangoDB_PHP_TestSuite_TestCollection');
     } catch (\Exception $e) {
         // don't bother us, if it's already deleted.
     }
     $this->collection = new Collection();
     $this->collection->setName('ArangoDB_PHP_TestSuite_TestCollection');
     $this->collectionHandler->add($this->collection);
     $this->documentHandler = new DocumentHandler($this->connection);
     $adminHandler = new AdminHandler($this->connection);
     $version = preg_replace("/-[a-z0-9]+\$/", "", $adminHandler->getServerVersion());
     $this->hasExportApi = version_compare($version, '2.6.0') >= 0;
 }
开发者ID:vinigomescunha,项目名称:ArangoDB-Ajax-PHP-Example,代码行数:18,代码来源:ExportTest.php

示例3: testCreateAndDeleteDocumentWithSeveralKeys

 /**
  * Try to create and delete a document with several keys
  */
 public function testCreateAndDeleteDocumentWithSeveralKeys()
 {
     $connection = $this->connection;
     $collection = $this->collection;
     $documentHandler = new DocumentHandler($connection);
     $keys = array("_", "foo", "bar", "bar:bar", "baz", "1", "0", "a-b-c", "a:b", "this-is-a-test", "FOO", "BAR", "Bar", "bAr");
     $adminHandler = new AdminHandler($this->connection);
     $version = preg_replace("/-[a-z0-9]+\$/", "", $adminHandler->getServerVersion());
     if (version_compare($version, '2.6.0') >= 0) {
         // 2.6 will also allow the following document keys, while 2.5 will not
         $keys[] = ".";
         $keys[] = ":";
         $keys[] = "@";
         $keys[] = "-.:@";
         $keys[] = "foo@bar.baz.com";
         $keys[] = ":.foo@bar-bar_bar.baz.com.:";
     }
     foreach ($keys as $key) {
         $document = new Document();
         $document->someAttribute = 'someValue';
         $document->set('_key', $key);
         $documentId = $documentHandler->add($collection->getName(), $document);
         $resultingDocument = $documentHandler->get($collection->getName(), $documentId);
         $resultingAttribute = $resultingDocument->someAttribute;
         $resultingKey = $resultingDocument->getKey();
         $this->assertTrue($resultingAttribute === 'someValue', 'Resulting Attribute should be "someValue". It\'s :' . $resultingAttribute);
         $this->assertTrue($resultingKey === $key, 'Resulting Attribute should be "someValue". It\'s :' . $resultingKey);
         $documentHandler->delete($document);
     }
 }
开发者ID:vinigomescunha,项目名称:ArangoDB-Ajax-PHP-Example,代码行数:33,代码来源:DocumentBasicTest.php


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