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


PHP resource::getAttribute方法代码示例

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


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

示例1: setDriver

 /**
  * @param \Zend\Db\Adapter\Driver\Sqlsrv\Sqlsrv|\Zend\Db\Adapter\Driver\Pdo\Pdo|resource|\PDO $driver
  * @throws \Zend\Db\Adapter\Exception\InvalidArgumentException
  *
  * @return self
  */
 public function setDriver($driver)
 {
     // handle Zend\Db drivers
     if ($driver instanceof Pdo\Pdo && in_array($driver->getDatabasePlatformName(), ['SqlServer', 'Dblib']) || $driver instanceof \PDO && in_array($driver->getAttribute(\PDO::ATTR_DRIVER_NAME), ['sqlsrv', 'dblib'])) {
         $this->resource = $driver;
         return $this;
     }
     throw new Exception\InvalidArgumentException('$driver must be a Sqlsrv PDO Zend\\Db\\Adapter\\Driver or Sqlsrv PDO instance');
 }
开发者ID:zendframework,项目名称:zend-db,代码行数:15,代码来源:SqlServer.php

示例2: parseProperty

 /**
  * Parses the Property element.
  *
  * The Property element can be a child of either the root XRD
  * element or the Link element
  *
  * @param array &$el the parent JRD element
  */
 private function parseProperty(&$el)
 {
     $type = $this->reader->getAttribute('type');
     if ($this->reader->getAttributeNs('nil', self::XSI_NS)) {
         $value = null;
     } else {
         $value = $this->reader->readString();
     }
     $el[$this->reader->getAttribute('type')] = $value;
     $this->reader->next();
 }
开发者ID:kelvinmo,项目名称:simplexrd,代码行数:19,代码来源:simplexrd.class.php

示例3: __construct

 /**
  * Constructor
  *
  * @param resource $pdooci    PDOOCI connection
  * @param string   $statement sql statement
  *
  * @return Statement $statement created
  */
 public function __construct($pdooci, $statement)
 {
     try {
         $this->_pdooci = $pdooci;
         $this->_con = $pdooci->getConnection();
         $this->_statement = Statement::insertMarks($statement);
         $this->_stmt = \oci_parse($this->_con, $this->_statement);
         $this->_fetch_sty = \PDO::FETCH_BOTH;
         $this->_case = $pdooci->getAttribute(\PDO::ATTR_CASE);
     } catch (\Exception $e) {
         throw new \PDOException($e->getMessage());
     }
 }
开发者ID:taq,项目名称:pdooci,代码行数:21,代码来源:Statement.php

示例4: setDriver

 /**
  * @param \Zend\Db\Adapter\Driver\Sqlsrv\Sqlsrv|\Zend\Db\Adapter\Driver\Pdo\Pdo||resource|\PDO $driver
  * @throws \Zend\Db\Adapter\Exception\InvalidArgumentException
  * @return $this
  */
 public function setDriver($driver)
 {
     // handle Zend_Db drivers
     if ($driver instanceof Pdo\Pdo && $driver->getDatabasePlatformName() == 'Sqlsrv') {
         /** @var $driver \Zend\Db\Adapter\Driver\DriverInterface */
         $this->resource = $driver->getConnection()->getResource();
         return $this;
     }
     // handle
     if ($driver instanceof \PDO && $driver->getAttribute(\PDO::ATTR_DRIVER_NAME) == 'sqlsrv') {
         $this->resource = $driver;
         return $this;
     }
     throw new Exception\InvalidArgumentException('$driver must be a Sqlsrv PDO Zend\\Db\\Adapter\\Driver or Sqlsrv PDO instance');
 }
开发者ID:totolouis,项目名称:ZF2-Auth,代码行数:20,代码来源:SqlServer.php

示例5: catch

 function __construct($db = null)
 {
     if (class_exists('jqGridDB') && $db) {
         $interface = jqGridDB::getInterface();
     } else {
         $interface = 'chartarray';
     }
     $this->conn = $db;
     if ($interface == 'pdo') {
         try {
             $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
             $this->dbtype = $this->conn->getAttribute(PDO::ATTR_DRIVER_NAME);
         } catch (Exception $e) {
         }
     } else {
         $this->dbtype = $interface;
     }
     # Set Default Values
     $this->coptions['credits']['enabled'] = false;
     $this->coptions['chart']['renderTo'] = '';
     $this->coptions['series'] = array();
     $this->i_serie_index = 0;
     $this->jscode = false;
 }
开发者ID:Russell-IO,项目名称:php-syslog-ng,代码行数:24,代码来源:jqChart.php

示例6: createMetaData

 /**
  * Creates a meta data object based on the driver of given connection and
  * $schema name.
  *
  * @param PDO|resource $connection
  * @param string $schema
  * @return PHPUnit_Extensions_Database_DB_IMetaData
  */
 public static function createMetaData($connection, $schema)
 {
     // for PDO use PHPUnit_Extensions_Database_DB_IMetaData
     if ($connection instanceof PDO) {
         $driverName = $connection->getAttribute(PDO::ATTR_DRIVER_NAME);
         // register overloaded classes maps for pdo
         if (isset(self::$metaDataClassMap[$driverName])) {
             $className = self::$metaDataClassMap[$driverName];
             PHPUnit_Extensions_Database_DB_MetaData::registerClassWithDriver($className, $driverName);
         }
         return PHPUnit_Extensions_Database_DB_MetaData::createMetaData($connection, $connection);
     }
     $driverName = 'oracle';
     if (isset(self::$metaDataClassMap[$driverName])) {
         $className = self::$metaDataClassMap[$driverName];
         if ($className instanceof ReflectionClass) {
             return $className->newInstance($connection, $schema);
         } else {
             return self::registerClassWithDriver($className, $driverName)->newInstance($connection, $schema);
         }
     } else {
         throw new Exception("Could not find a meta data driver for {$driverName} driver.");
     }
 }
开发者ID:cwcw,项目名称:cms,代码行数:32,代码来源:MetaData.php

示例7: getServerInfo

 /**
  *   Gets the mysql client info in period (.) delimited
  */
 public function getServerInfo()
 {
     return $this->connection->getAttribute(PDO::ATTR_SERVER_VERSION);
 }
开发者ID:mvnp,项目名称:Simple-MVC-Framework,代码行数:7,代码来源:Database.class.php

示例8: getDatabaseServer

 /**
  * Get the database server, namely mysql, pgsql, or mssql.
  * @return string
  */
 public function getDatabaseServer()
 {
     return $this->dbConn->getAttribute(PDO::ATTR_DRIVER_NAME);
 }
开发者ID:racontemoi,项目名称:shibuichi,代码行数:8,代码来源:PDODatabase.php


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