IBOS open source
  • Namespace
  • Class

Namespaces

  • application
    • core
      • cache
        • driver
        • provider
      • components
      • controllers
      • engines
        • local
        • sae
      • model
      • modules
      • utils
      • widgets
    • modules
      • article
        • controllers
        • core
        • model
        • utils
      • calendar
        • controllers
        • model
        • utils
      • contact
        • controllers
        • model
        • utils
      • dashboard
        • controllers
        • model
        • utils
      • department
        • components
        • model
        • utils
      • diary
        • components
        • controllers
        • model
        • utils
        • widgets
      • email
        • controllers
        • core
        • model
        • utils
      • main
        • behaviors
        • components
        • controllers
        • model
        • utils
        • widgets
      • message
        • controllers
        • core
          • co
          • wx
            • callback
            • event
        • model
        • utils
      • mobile
        • components
        • controllers
        • utils
      • position
        • components
        • model
        • utils
      • recruit
        • components
        • controllers
        • core
        • model
        • utils
        • widgets
      • role
        • model
        • utils
      • user
        • components
        • controllers
        • model
        • utils
      • vote
        • components
        • controllers
        • model
        • utils
      • weibo
        • controllers
        • core
        • model
        • utils

Classes

  • Api
  • ApiCode
  • Attach
  • Cache
  • Cloud
  • Convert
  • Credit
  • Database
  • DateTime
  • Env
  • File
  • Ftp
  • IBOS
  • Image
  • Mail
  • Module
  • Org
  • Page
  • PHPExcel
  • String
  • System
  • Upgrade
  • Url
  • WebSite
  • Xml
  • XMLParse

Class Database

Namespace: application\core\utils
Copyright: Copyright © 2012-2013 IBOS Inc
Author: banyanCheung banyan@ibos.com.cn
Located at system/core/utils/Database.php

Methods summary

public static string
# getdbPrefix( )

获取表前缀

获取表前缀

Returns

string
public static array
# arrayKeysTo( array $array, array $key )

获取数组里$key的值到另外一个数组

获取数组里$key的值到另外一个数组

Parameters

$array
源数组
$key
要获取的值

Returns

array
过滤后的数组
public static string
# getDatabaseSize( )

获取数据库大小

获取数据库大小

Returns

string
public static array
# getTablelist( string $tablePrefix = '' )

获取全部ibos数据表的列表,过滤表前缀

获取全部ibos数据表的列表,过滤表前缀

Parameters

$tablePrefix
表前缀

Returns

array
过滤后的数据列表数组
public static array
# getTableStatus( string $tableName, boolean $formatSize = true )

获取一个表的状态

获取一个表的状态

Parameters

$tableName
表名
$formatSize
格式化表数据大小与索引大小

Returns

array
public static integer
# dropTable( string $tableName, boolean $force = false )

删除某一个表

删除某一个表

Parameters

$tableName
要删除的表名
$force
是否强制删除(非强制情况只要表存在数据将不进行删除)

Returns

integer
-1 表存在数据 1 删除成功

Author

denglh
public static boolean
# cloneTable( string $prototype, string $target )

参照某一个表的数据结构,创建一个与其一样的表

参照某一个表的数据结构,创建一个与其一样的表

Parameters

$prototype
原型表的表名
$target
目标表名

Returns

boolean
public static string
# getSqlDumpTableStruct( string $table, string $compat, string $dumpCharset, string $charset = '' )

导出数据表结构

导出数据表结构

Parameters

$table
表名
$compat
建表语句格式
$dumpCharset
输出编码
$charset
数据库编码

Returns

string
数据库表结构字符串
public static array
# databaseBackup( )

数据库备份操作

数据库备份操作

Returns

array
返回一个带有消息状态及消息内容的数组
public static string
# sqlDumpTable( string $table, integer $extendIns, integer $sizeLimit, boolean $useHex = true, integer $startFrom = 0, integer $currentSize = 0 )

导出表数据

导出表数据

Parameters

$table
表名
$extendIns
是否使用扩展插入方式
$sizeLimit
导出的条数
$useHex
是否使用16进制
$startFrom
开始导出位置
$currentSize
当前数据大小

Returns

string
public static array
# getBackupList( )

获取备份文件列表,返回数组格式

获取备份文件列表,返回数组格式

Returns

array
public static array
# getOptimizeTable( )

获取可优化的数据表列表

获取可优化的数据表列表

Returns

array
public static boolean
# optimize( array $tables )

调用数据库自带的优化命令优化数据表

调用数据库自带的优化命令优化数据表

Parameters

$tables

Returns

boolean
public static string
# getBackupDir( )

返回备份文件夹,方便其他程序调用

返回备份文件夹,方便其他程序调用

Returns

string
public static mixed
# syncTableStruct( string $sql, boolean $version, string $dbCharset )

同步数据表结构

同步数据表结构

Parameters

$sql
$version
是否更新版本的数据库
$dbCharset
数据库编码

Returns

mixed

Constants summary

string BACKUP_DIR

备份目录

备份目录

# 'data/backup'
integer OFFSET

查询备份数据偏移量

查询备份数据偏移量

# 300
IBOS open source API documentation generated by ApiGen