Overview

Namespaces

  • None
  • PHP

Classes

  • Breadcrumb
  • Breadcrumbs
  • CacheFile
  • Comment
  • CommentArray
  • CommentFilter
  • CommentForm
  • CommentList
  • Config
  • Database
  • DatabaseQuery
  • DatabaseQuerySelect
  • DatabaseQuerySelectFulltext
  • DatabaseStopwords
  • Debug
  • Field
  • Fieldgroup
  • Fieldgroups
  • FieldgroupsArray
  • Fields
  • FieldsArray
  • Fieldtype
  • FieldtypeMulti
  • Fieldtypes
  • FileLog
  • FilenameArray
  • Fuel
  • HookEvent
  • ImageSizer
  • Inputfield
  • InputfieldsArray
  • InputfieldWrapper
  • Language
  • LanguageParser
  • Languages
  • LanguagesPageFieldValue
  • LanguageSupportInstall
  • LanguageTranslator
  • Markdown_Parser
  • MarkdownExtra_Parser
  • ModuleJS
  • ModulePlaceholder
  • Modules
  • Notice
  • NoticeError
  • NoticeMessage
  • Notices
  • NullPage
  • Page
  • PageArray
  • Pagefile
  • Pagefiles
  • PagefilesManager
  • PageFinder
  • Pageimage
  • Pageimages
  • PagerNav
  • PagerNavItem
  • Pages
  • PagesAccess
  • PagesSortfields
  • PagesType
  • Paths
  • Permission
  • Permissions
  • Process
  • ProcessController
  • ProcessWire
  • Role
  • Roles
  • Sanitizer
  • Selector
  • SelectorBitwiseAnd
  • SelectorContains
  • SelectorContainsLike
  • SelectorContainsWords
  • SelectorEnds
  • SelectorEqual
  • SelectorGreaterThan
  • SelectorGreaterThanEqual
  • SelectorLessThan
  • SelectorLessThanEqual
  • SelectorNotEqual
  • Selectors
  • SelectorStarts
  • Session
  • SessionCSRF
  • SmartyPants_Parser
  • SmartyPantsTypographer_Parser
  • SystemUpdate1
  • Template
  • TemplateFile
  • Templates
  • TemplatesArray
  • Textformatter
  • Textile
  • User
  • Users
  • Wire
  • WireArray
  • WireData
  • WireInput
  • WireInputData
  • WireSaveableItems
  • WireSaveableItemsLookup
  • WireUpload

Interfaces

  • CommentFormInterface
  • CommentListInterface
  • ConfigurableModule
  • FieldtypeLanguageInterface
  • FieldtypePageTitleCompatible
  • HasLookupItems
  • HasRoles
  • InputfieldHasArrayValue
  • Module
  • Saveable
  • TrackChanges

Exceptions

  • ProcessController404Exception
  • ProcessControllerPermissionException
  • Wire404Exception
  • WireDatabaseException
  • WireException
  • WirePermissionException

Functions

  • __
  • _n
  • _x
  • fuel
  • identify_modifier_markdown
  • Markdown
  • mdwp_add_p
  • mdwp_hide_tags
  • mdwp_show_tags
  • mdwp_strip_p
  • ProcessWireClassLoader
  • ProcessWireHostSiteConfig
  • ProcessWireShutdown
  • removeNewlines
  • SmartDashes
  • SmartEllipsis
  • SmartQuotes
  • smarty_modifier_markdown
  • smarty_modifier_smartypants
  • SmartyPants
  • tabIndent
  • unregisterGLOBALS
  • wire
  • wireDecodeJSON
  • wireEncodeJSON
  • wireMkdir
  • Overview
  • Namespace
  • Class
  • Tree
  • Download

Class Database

Database class provides a layer on top of mysqli

mysqli
Extended by Database
Located at core/Database.php
Methods summary
public
# __construct( string|$config $host = 'localhost', string $user = null, string $pass = null, string $db = null, integer $port = null, string $socket = null )

Construct the Database

Construct the Database

Since this extends MySQL all the MySQL construct params are kept in tact. However, you may just supply an object with the following properties if you prefer: $o->dbUser, $o->dbPass, $o->dbHost, $o->dbName, $config->dbPort, $config->dbSocket (optional). This would usually be from a ProcessWire Config ($config) API var, but kept as generic object in case someone wants to use this class elsewhere.

Parameters

$host
string|$config
Hostname or object with config properties.
$user
string
Username
$pass
string
Password
$db
string
Database name
$port
integer
Port
$socket
string
Socket
public mixed
# query( string $sql, integer $resultmode = MYSQLI_STORE_RESULT )

Overrides default mysqli query method so that it also records and times queries.

Overrides default mysqli query method so that it also records and times queries.

Parameters

$sql
string
SQL Query
$resultmode
integer
See http://www.php.net/manual/en/mysqli.query.php

Returns

mixed
Returns FALSE on failure. For successful SELECT, SHOW, DESCRIBE or EXPLAIN queries mysqli_query() will return a MySQLi_Result object. For other successful queries mysqli_query() will return TRUE.
public static array
# getQueryLog( )

Get an array of all queries that have been executed thus far

Get an array of all queries that have been executed thus far

Active in ProcessWire debug mode only

Returns

array
public array
# getTables( )

Get array of all tables in this database.

Get array of all tables in this database.

Returns

array
public boolean
# isOperator( string $str )

Is the given string a database comparison operator?

Is the given string a database comparison operator?

Parameters

$str
string
1-2 character opreator to test

Returns

boolean
public
# setThrowExceptions( boolean $throwExceptions = true )

Set whether Exceptions should be thrown on query errors

Set whether Exceptions should be thrown on query errors

Parameters

$throwExceptions
boolean
Default is true
Properties summary
protected static array $queryLog array()
#

Log of all queries performed in this instance

Log of all queries performed in this instance

protected boolean $throwExceptions true
#

Should WireDatabaseException be thrown on error?

Should WireDatabaseException be thrown on error?

ProcessWire API documentation generated by ApiGen 2.6.0