本文整理汇总了PHP中utility::loadSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP utility::loadSettings方法的具体用法?PHP utility::loadSettings怎么用?PHP utility::loadSettings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utility
的用法示例。
在下文中一共展示了utility::loadSettings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
define('DB_PORT', '3306');
// check if database connection constants are undefined
if (!defined('DB_NAME')) {
define('DB_NAME', 'senayandb');
}
if (!defined('DB_USERNAME')) {
define('DB_USERNAME', 'senayanuser');
}
if (!defined('DB_PASSWORD')) {
define('DB_PASSWORD', 'password_senayanuser');
}
// database connection
// we prefer to use mysqli extensions if its available
if (extension_loaded('mysqli')) {
/* MYSQLI */
$dbs = @new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME, DB_PORT);
if (mysqli_connect_error()) {
die('<div style="border: 1px dotted #FF0000; color: #FF0000; padding: 5px;">Error Connecting to Database. Please check your configuration</div>');
}
} else {
/* MYSQL */
// require the simbio mysql class
include SIMBIO_BASE_DIR . 'simbio_DB/mysql/simbio_mysql.inc.php';
// make a new connection object that will be used by all applications
$dbs = @new simbio_mysql(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME, DB_PORT);
}
/* Force UTF-8 for MySQL connection */
$dbs->query('SET NAMES \'utf8\'');
// load global settings from database. Uncomment below lines if you dont want to load it
utility::loadSettings($dbs);