本文整理匯總了PHP中okapi\Db::connect方法的典型用法代碼示例。如果您正苦於以下問題:PHP Db::connect方法的具體用法?PHP Db::connect怎麽用?PHP Db::connect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類okapi\Db
的用法示例。
在下文中一共展示了Db::connect方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init_internals
/**
* Internal. This is called always when OKAPI core is included.
*/
public static function init_internals($allow_cronjobs = true)
{
static $init_made = false;
if ($init_made) {
return;
}
ini_set('memory_limit', '256M');
Db::connect();
if (Settings::get('TIMEZONE') !== null) {
date_default_timezone_set(Settings::get('TIMEZONE'));
}
if (!self::$data_store) {
self::$data_store = new OkapiDataStore();
}
if (!self::$server) {
self::$server = new OkapiOAuthServer(self::$data_store);
}
if ($allow_cronjobs) {
self::execute_prerequest_cronjobs();
}
$init_made = true;
}
示例2: init_internals
/**
* Internal. This is called always when OKAPI core is included.
*/
public static function init_internals($allow_cronjobs = true)
{
static $init_made = false;
if ($init_made) {
return;
}
ini_set('memory_limit', '256M');
# The memory limit is - among other - crucial for the maximum size
# of processable images; see services/logs/images/add.php: max_pixels()
Db::connect();
if (Settings::get('TIMEZONE') !== null) {
date_default_timezone_set(Settings::get('TIMEZONE'));
}
if (!self::$data_store) {
self::$data_store = new OkapiDataStore();
}
if (!self::$server) {
self::$server = new OkapiOAuthServer(self::$data_store);
}
if ($allow_cronjobs) {
self::execute_prerequest_cronjobs();
}
$init_made = true;
}