當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sDB::object方法代碼示例

本文整理匯總了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());
 }
開發者ID:crunnells,項目名稱:shopp,代碼行數:30,代碼來源:Install.php

示例2: instance

 public static function instance()
 {
     return sDB::object();
 }
開發者ID:crunnells,項目名稱:shopp,代碼行數:4,代碼來源:DB.php

示例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');
 }
開發者ID:BlessySoftwares,項目名稱:anvelocom,代碼行數:31,代碼來源:Session.php


注:本文中的sDB::object方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。