本文整理匯總了PHP中sDB::object方法的典型用法代碼示例。如果您正苦於以下問題:PHP sDB::object方法的具體用法?PHP sDB::object怎麽用?PHP sDB::object使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sDB
的用法示例。
在下文中一共展示了sDB::object方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: upgrades
/**
* Performs database upgrades when required
*
* @author Jonathan Davis
* @since 1.1
*
* @return void
**/
public function upgrades()
{
$installed = ShoppSettings::dbversion();
// No upgrades required
if ($installed == ShoppVersion::db()) {
return;
}
shopp_set_setting('shopp_setup', '');
shopp_set_setting('maintenance', 'on');
if ($installed < 1100) {
$this->upgrade_110();
}
if ($installed < 1200) {
$this->upgrade_120();
}
if ($installed < 1300) {
$this->upgrade_130();
}
$db = sDB::object();
file_put_contents(SHOPP_PATH . '/shopp_queries.txt', json_encode($db->queries));
ShoppSettings()->save('db_version', ShoppVersion::db());
}
示例2: instance
public static function instance()
{
return sDB::object();
}
示例3: decrypt
/**
* Decrypts the session data.
*
* The session data is passed by reference and will be decrypted
* as long as a valid encryption key is available (exists in the cookie).
*
* When no encryption key cookie is available (usually because of switching
* from HTTPS to HTTP) an unlock process is fired (handled by a concrete
* implementation).
*
* @since 1.3.6
*
* @param array $data The session data to possibly decrypt
* @return void
**/
private function decrypt(&$data)
{
$BOF = strlen(self::ENCRYPTION);
// Set the secured flag if the data is encrypted
$this->secured = self::ENCRYPTION == substr($data, 0, $BOF);
if (!$this->secured) {
return;
}
if (empty($_COOKIE[SHOPP_SECURE_KEY])) {
return $this->unlock();
}
// No encryption key available, run unlock handler
$key = $_COOKIE[SHOPP_SECURE_KEY];
$db = sDB::object();
$data = sDB::query("SELECT AES_DECRYPT('" . $db->api->escape(substr($data, $BOF)) . "','{$key}') AS data", 'auto', 'col', 'data');
}