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


PHP jDb::getProfile方法代码示例

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


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

示例1: execSQLScript

 /**
  * import a sql script into the given profile.
  *
  * The name of the script should be store in install/sql/$name.databasetype.sql
  * in the directory of the component. (replace databasetype by mysql, pgsql etc.)
  * 
  * @param string $name the name of the script, without suffixes
  */
 public function execSQLScript($name, $profile = '')
 {
     $tools = jDb::getTools($profile);
     $p = jDb::getProfile($profile);
     $driver = $p['driver'];
     if ($driver == 'pdo') {
         preg_match('/^(\\w+)\\:.*$/', $p['dsn'], $m);
         $driver = $m[1];
     }
     $tools->execSQLScript($this->path . 'install/sql/' . $name . '.' . $driver . '.sql');
 }
开发者ID:alienpham,项目名称:helenekling,代码行数:19,代码来源:jInstallerBase.class.php

示例2: getProfile

 /**
  * return the profile name used for jacl connection
  * @return string profile name
  */
 public static function getProfile()
 {
     static $profile = '';
     if ($profile == '') {
         try {
             $prof = jDb::getProfile('jacl_profile', true);
         } catch (Exception $e) {
             $prof = jDb::getProfile();
         }
         $profile = $prof['name'];
     }
     return $profile;
 }
开发者ID:alienpham,项目名称:helenekling,代码行数:17,代码来源:jAcl2Db.class.php

示例3: __construct

 function __construct($sel, $driver, $isprofile = true)
 {
     if ($isprofile) {
         $p = jDb::getProfile($driver);
         if ($p['driver'] == 'pdo') {
             $this->driver = substr($p['dsn'], 0, strpos($p['dsn'], ':'));
         } else {
             $this->driver = $p['driver'];
         }
     } else {
         $this->driver = $driver;
     }
     $this->_compiler = 'jDaoCompiler';
     $this->_compilerPath = JELIX_LIB_PATH . 'dao/jDaoCompiler.class.php';
     parent::__construct($sel);
 }
开发者ID:alienpham,项目名称:helenekling,代码行数:16,代码来源:jSelectorDao.class.php

示例4: dbSize

 /**
  * Size of the database
  * @return array the total size and record of the database
  */
 public static function dbSize()
 {
     $profile = jDb::getProfile();
     $con = jDb::getConnection();
     $totalRecords = $totalSize = 0;
     if ($profile['driver'] == 'mysql' or $profile['driver'] == 'mysqli') {
         $results = $con->query('SHOW TABLE STATUS FROM `' . $profile['database'] . '`');
         foreach ($results as $status) {
             $totalRecords += $status->Rows;
             $totalSize += $status->Data_length + $status->Index_length;
         }
         $totalSize = $totalSize / 1024;
         if ($totalSize > 1024) {
             $totalSize = round($totalSize / 1024, 2) . ' MB';
         } else {
             $totalSize = round($totalSize, 2) . ' KB';
         }
     }
     return array($totalRecords, $totalSize);
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:24,代码来源:serverinfos.class.php


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