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


PHP JDatabaseDriver::getVersion方法代码示例

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


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

示例1: sendStats

 protected function sendStats()
 {
     $http = JHttpFactory::getHttp();
     $data = array('unique_id' => $this->params->get('unique_id'), 'php_version' => PHP_VERSION, 'db_type' => $this->db->name, 'db_version' => $this->db->getVersion(), 'cms_version' => JVERSION, 'server_os' => php_uname('s') . ' ' . php_uname('r'));
     $uri = new JUri('http://jstats.dongilbert.net/submit');
     try {
         // Don't let the request take longer than 2 seconds to avoid page timeout issues
         $status = $http->post($uri, $data, null, 2);
         if ($status->code === 200) {
             $this->writeCacheFile();
         }
     } catch (UnexpectedValueException $e) {
         // There was an error sending stats. Should we do anything?
     } catch (RuntimeException $e) {
         // There was an error connecting to the server or in the post request
     }
 }
开发者ID:roland-d,项目名称:jstats-plugin,代码行数:17,代码来源:jstats.php

示例2: sendStats

 protected function sendStats()
 {
     if (version_compare(JVERSION, '3.0', '<')) {
         JLoader::register('JHttp', dirname(__FILE__) . '/src/joomla/http/http.php');
         JLoader::register('JHttpFactory', dirname(__FILE__) . '/src/joomla/http/factory.php');
         JLoader::register('JHttpResponse', dirname(__FILE__) . '/src/joomla/http/response.php');
         JLoader::register('JHttpTransport', dirname(__FILE__) . '/src/joomla/http/transport.php');
         JLoader::register('JHttpTransportCurl', dirname(__FILE__) . '/src/joomla/http/transport/curl.php');
         JLoader::register('JHttpTransportSocket', dirname(__FILE__) . '/src/joomla/http/transport/socket.php');
         JLoader::register('JHttpTransportStream', dirname(__FILE__) . '/src/joomla/http/transport/stream.php');
     }
     $http = JHttpFactory::getHttp();
     $data = array('unique_id' => $this->params->get('unique_id'), 'php_version' => PHP_VERSION, 'db_type' => $this->db->name, 'db_version' => $this->db->getVersion(), 'cms_version' => JVERSION, 'server_os' => php_uname('s') . ' ' . php_uname('r'));
     $uri = new JUri('http://jstats.dongilbert.net/submit');
     try {
         $status = $http->post($uri, $data);
         if ($status->code === 200) {
             $this->writeCacheFile();
         }
     } catch (UnexpectedValueException $e) {
         // There was an error sending stats. Should we do anything?g
     }
 }
开发者ID:beingsane,项目名称:jstats-plugin,代码行数:23,代码来源:jstats.php

示例3: getStatsData

 /**
  * Get the data that will be sent to the stats server.
  *
  * @return  array.
  *
  * @since   3.5
  */
 private function getStatsData()
 {
     return array('unique_id' => $this->getUniqueId(), 'php_version' => PHP_VERSION, 'db_type' => $this->db->name, 'db_version' => $this->db->getVersion(), 'cms_version' => JVERSION, 'server_os' => php_uname('s') . ' ' . php_uname('r'));
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:11,代码来源:stats.php

示例4: getVersion

 /**
  * Returns the version of MySQL
  *
  * @return string
  */
 public function getVersion()
 {
     return $this->_db->getVersion();
 }
开发者ID:bobozhangshao,项目名称:HeartCare,代码行数:9,代码来源:CmsDatabaseDriver.php

示例5: bigSelects

 /**
  *  $$$ hugh - testing doing bigSelects stuff here
  *  Reason being, some folk on shared hosting plans with very restrictive MySQL
  *  setups are hitting the 'big selects' problem on Fabrik internal queries, not
  *  just on their List specific queries.  So we need to apply 'big selects' to our
  *  default connection as well, essentially enabling it for ALL queries we do.
  *
  * @param  JDatabaseDriver $fabrikDb
  *
  * @return void
  */
 public static function bigSelects($fabrikDb)
 {
     $fbConfig = JComponentHelper::getParams('com_fabrik');
     if ($fbConfig->get('enable_big_selects', 0) == '1') {
         /**
          * Use of OPTION in SET deprecated from MySQL 5.1. onward
          * http://www.fabrikar.com/forums/index.php?threads/enable-big-selects-error.39463/#post-198293
          * NOTE - technically, using verison_compare on MySQL version could fail, if it's a "gamma"
          * release, which PHP desn't grok!
          */
         if (version_compare($fabrikDb->getVersion(), '5.1.0', '>=')) {
             $fabrikDb->setQuery("SET SQL_BIG_SELECTS=1, GROUP_CONCAT_MAX_LEN=10240");
         } else {
             $fabrikDb->setQuery("SET OPTION SQL_BIG_SELECTS=1, GROUP_CONCAT_MAX_LEN=10240");
         }
         try {
             $fabrikDb->execute();
         } catch (Exception $e) {
             // Fail silently
         }
     }
 }
开发者ID:glauberm,项目名称:cinevi,代码行数:33,代码来源:parent.php

示例6: onAfterInitialise

 /**
  * Listener for the `onAfterInitialise` event
  *
  * @return  void
  *
  * @since   3.5
  */
 public function onAfterInitialise()
 {
     // Only run this in admin
     if (!$this->app->isAdmin()) {
         return;
     }
     // Do we need to run? Compare the last run timestamp stored in the plugin's options with the current
     // timestamp. If the difference is greater than the cache timeout we shall not execute again.
     $now = time();
     $last = (int) $this->params->get('lastrun', 0);
     // 12 hours - 60*60*12 = 43200
     if (!defined('PLG_SYSTEM_STATS_DEBUG') && abs($now - $last) < 43200) {
         return;
     }
     // Update last run status
     $this->params->set('lastrun', $now);
     $uniqueId = $this->params->get('unique_id', '');
     /*
      * If the unique ID is empty (because we have never submitted a piece of data before or because the refresh button
      * has been used - generate a new ID and store it in the database for future use.
      */
     if (empty($uniqueId)) {
         $uniqueId = hash('sha1', JUserHelper::genRandomPassword(28) . time());
         $this->params->set('unique_id', $uniqueId);
     }
     $query = $this->db->getQuery(true)->update($this->db->quoteName('#__extensions'))->set($this->db->quoteName('params') . ' = ' . $this->db->quote($this->params->toString('JSON')))->where($this->db->quoteName('type') . ' = ' . $this->db->quote('plugin'))->where($this->db->quoteName('folder') . ' = ' . $this->db->quote('system'))->where($this->db->quoteName('element') . ' = ' . $this->db->quote('stats'));
     try {
         // Lock the tables to prevent multiple plugin executions causing a race condition
         $this->db->lockTable('#__extensions');
     } catch (Exception $e) {
         // If we can't lock the tables it's too risky to continue execution
         return;
     }
     try {
         // Update the plugin parameters
         $result = $this->db->setQuery($query)->execute();
         $this->clearCacheGroups(array('com_plugins'), array(0, 1));
     } catch (Exception $exc) {
         // If we failed to execute
         $this->db->unlockTables();
         $result = false;
     }
     try {
         // Unlock the tables after writing
         $this->db->unlockTables();
     } catch (Exception $e) {
         // If we can't lock the tables assume we have somehow failed
         $result = false;
     }
     // Abort on failure
     if (!$result) {
         return;
     }
     $data = array('unique_id' => $uniqueId, 'php_version' => PHP_VERSION, 'db_type' => $this->db->name, 'db_version' => $this->db->getVersion(), 'cms_version' => JVERSION, 'server_os' => php_uname('s') . ' ' . php_uname('r'));
     // Don't let the request take longer than 2 seconds to avoid page timeout issues
     try {
         // Don't let the request take longer than 2 seconds to avoid page timeout issues
         JHttpFactory::getHttp()->post($this->params->get('url', 'https://developer.joomla.org/stats/submit'), $data, null, 2);
     } catch (UnexpectedValueException $e) {
         // There was an error sending stats. Should we do anything?
         JLog::add('Could not send site statistics to remote server: ' . $e->getMessage(), JLog::WARNING, 'stats');
     } catch (RuntimeException $e) {
         // There was an error connecting to the server or in the post request
         JLog::add('Could not connect to statistics server: ' . $e->getMessage(), JLog::WARNING, 'stats');
     } catch (Exception $e) {
         // An unexpected error in processing; don't let this failure kill the site
         JLog::add('Unexpected error connecting to statistics server: ' . $e->getMessage(), JLog::WARNING, 'stats');
     }
 }
开发者ID:ByteJunk,项目名称:joomla-cms,代码行数:76,代码来源:stats.php


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