當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JDatabase::getConnectors方法代碼示例

本文整理匯總了PHP中JDatabase::getConnectors方法的典型用法代碼示例。如果您正苦於以下問題:PHP JDatabase::getConnectors方法的具體用法?PHP JDatabase::getConnectors怎麽用?PHP JDatabase::getConnectors使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JDatabase的用法示例。


在下文中一共展示了JDatabase::getConnectors方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getOptions

 /**
  * Method to get the list of database options.
  *
  * This method produces a drop down list of available databases supported
  * by JDatabase drivers that are also supported by the application.
  *
  * @return  array    The field option objects.
  *
  * @since   11.3
  * @see		JDatabase
  */
 protected function getOptions()
 {
     // Initialize variables.
     // This gets the connectors available in the platform and supported by the server.
     $available = JDatabase::getConnectors();
     /**
      * This gets the list of database types supported by the application.
      * This should be entered in the form definition as a comma separated list.
      * If no supported databases are listed, it is assumed all available databases
      * are supported.
      */
     $supported = $this->element['supported'];
     if (!empty($supported)) {
         $supported = explode(',', $supported);
         foreach ($supported as $support) {
             if (in_array($support, $available)) {
                 $options[$support] = ucfirst($support);
             }
         }
     } else {
         foreach ($available as $support) {
             $options[$support] = ucfirst($support);
         }
     }
     // This will come into play if an application is installed that requires
     // a database that is not available on the server.
     if (empty($options)) {
         $options[''] = JText::_('JNONE');
     }
     return $options;
 }
開發者ID:jimyb3,項目名稱:mathematicalteachingsite,代碼行數:42,代碼來源:databaseconnection.php

示例2: getPhpOptions

 /**
  * Gets PHP options.
  *
  * @return	array
  * @since	1.6
  */
 public function getPhpOptions()
 {
     // Initialise variables.
     $options = array();
     // Check the PHP Version.
     $option = new stdClass();
     $option->label = JText::_('INSTL_PHP_VERSION') . ' >= 5.2.4';
     $option->state = version_compare(PHP_VERSION, '5.2.4', '>=');
     $option->notice = null;
     $options[] = $option;
     // Check for zlib support.
     $option = new stdClass();
     $option->label = JText::_('INSTL_ZLIB_COMPRESSION_SUPPORT');
     $option->state = extension_loaded('zlib');
     $option->notice = null;
     $options[] = $option;
     // Check for XML support.
     $option = new stdClass();
     $option->label = JText::_('INSTL_XML_SUPPORT');
     $option->state = extension_loaded('xml');
     $option->notice = null;
     $options[] = $option;
     // Check for database support.
     // We are satisfied if there is at least one database driver available.
     $available = JDatabase::getConnectors();
     $option = new stdClass();
     $option->label = JText::_('INSTL_DATABASE_SUPPORT');
     $option->label .= '<br />(' . implode(', ', $available) . ')';
     $option->state = count($available);
     $option->notice = null;
     $options[] = $option;
     // Check for mbstring options.
     if (extension_loaded('mbstring')) {
         // Check for default MB language.
         $option = new stdClass();
         $option->label = JText::_('INSTL_MB_LANGUAGE_IS_DEFAULT');
         $option->state = strtolower(ini_get('mbstring.language')) == 'neutral';
         $option->notice = $option->state ? null : JText::_('INSTL_NOTICEMBLANGNOTDEFAULT');
         $options[] = $option;
         // Check for MB function overload.
         $option = new stdClass();
         $option->label = JText::_('INSTL_MB_STRING_OVERLOAD_OFF');
         $option->state = ini_get('mbstring.func_overload') == 0;
         $option->notice = $option->state ? null : JText::_('INSTL_NOTICEMBSTRINGOVERLOAD');
         $options[] = $option;
     }
     // Check for a missing native parse_ini_file implementation
     $option = new stdClass();
     $option->label = JText::_('INSTL_PARSE_INI_FILE_AVAILABLE');
     $option->state = $this->getIniParserAvailability();
     $option->notice = null;
     $options[] = $option;
     // Check for missing native json_encode / json_decode support
     $option = new stdClass();
     $option->label = JText::_('INSTL_JSON_SUPPORT_AVAILABLE');
     $option->state = function_exists('json_encode') && function_exists('json_decode');
     $option->notice = null;
     $options[] = $option;
     // Check for configuration file writeable.
     $option = new stdClass();
     $option->label = 'configuration.php ' . JText::_('INSTL_WRITABLE');
     $option->state = is_writable('../configuration.php') || !file_exists('../configuration.php') && is_writable('../');
     $option->notice = $option->state ? null : JText::_('INSTL_NOTICEYOUCANSTILLINSTALL');
     $options[] = $option;
     return $options;
 }
開發者ID:cwcw,項目名稱:cms,代碼行數:72,代碼來源:setup.php


注:本文中的JDatabase::getConnectors方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。