当前位置: 首页>>代码示例>>PHP>>正文


PHP Registry::get方法代码示例

本文整理汇总了PHP中OSC\OM\Registry::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Registry::get方法的具体用法?PHP Registry::get怎么用?PHP Registry::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OSC\OM\Registry的用法示例。


在下文中一共展示了Registry::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: substr

 function __construct($module, $user_id = null, $user_name = null)
 {
     global $PHP_SELF;
     $this->lang = Registry::get('Language');
     $module = HTML::sanitize(str_replace(' ', '', $module));
     if (defined('MODULE_ACTION_RECORDER_INSTALLED') && tep_not_null(MODULE_ACTION_RECORDER_INSTALLED)) {
         if (tep_not_null($module) && in_array($module . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1), explode(';', MODULE_ACTION_RECORDER_INSTALLED))) {
             if (!class_exists($module)) {
                 if (is_file(OSCOM::getConfig('dir_root', 'Shop') . 'includes/modules/action_recorder/' . $module . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1))) {
                     $this->lang->loadDefinitions('Shop/modules/action_recorder/' . $module);
                     include OSCOM::getConfig('dir_root', 'Shop') . 'includes/modules/action_recorder/' . $module . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1);
                 } else {
                     return false;
                 }
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
     $this->_module = $module;
     if (!empty($user_id) && is_numeric($user_id)) {
         $this->_user_id = $user_id;
     }
     if (!empty($user_name)) {
         $this->_user_name = $user_name;
     }
     $GLOBALS[$this->_module] = new $module();
     $GLOBALS[$this->_module]->setIdentifier();
 }
开发者ID:haraldpdl,项目名称:oscommerce2,代码行数:31,代码来源:action_recorder.php

示例2: __construct

 public final function __construct()
 {
     $this->setInfo();
     $this->db = Registry::get('Db');
     $this->lang = Registry::get('Language');
     $this->init();
 }
开发者ID:haraldpdl,项目名称:oscommerce2,代码行数:7,代码来源:AppAbstract.php

示例3: record

 function record($success = true)
 {
     $OSCOM_Db = Registry::get('Db');
     if (tep_not_null($this->_module)) {
         $OSCOM_Db->save('action_recorder', ['module' => $this->_module, 'user_id' => (int) $this->_user_id, 'user_name' => $this->_user_name, 'identifier' => $this->getIdentifier(), 'success' => $success == true ? 1 : 0, 'date_added' => 'now()']);
     }
 }
开发者ID:haraldpdl,项目名称:oscommerce2,代码行数:7,代码来源:action_recorder.php

示例4: query

 function query($order_id)
 {
     $OSCOM_Db = Registry::get('Db');
     $OSCOM_Language = Registry::get('Language');
     $Qorder = $OSCOM_Db->get(['orders o', 'orders_status s'], ['o.*', 's.orders_status_name'], ['o.orders_id' => (int) $order_id, 'o.orders_status' => ['rel' => 's.orders_status_id'], 's.language_id' => $OSCOM_Language->getId()]);
     $Qtotals = $OSCOM_Db->get('orders_total', ['title', 'text', 'class'], ['orders_id' => (int) $order_id], 'sort_order');
     while ($Qtotals->fetch()) {
         $this->totals[] = ['title' => $Qtotals->value('title'), 'text' => $Qtotals->value('text'), 'class' => $Qtotals->value('class')];
     }
     $this->info = array('id' => $Qorder->valueInt('orders_id'), 'total' => null, 'currency' => $Qorder->value('currency'), 'currency_value' => $Qorder->value('currency_value'), 'payment_method' => $Qorder->value('payment_method'), 'cc_type' => $Qorder->value('cc_type'), 'cc_owner' => $Qorder->value('cc_owner'), 'cc_number' => $Qorder->value('cc_number'), 'cc_expires' => $Qorder->value('cc_expires'), 'date_purchased' => $Qorder->value('date_purchased'), 'status' => $Qorder->value('orders_status_name'), 'orders_status' => $Qorder->value('orders_status'), 'last_modified' => $Qorder->value('last_modified'));
     foreach ($this->totals as $t) {
         if ($t['class'] == 'ot_total') {
             $this->info['total'] = $t['text'];
             break;
         }
     }
     $this->customer = array('name' => $Qorder->value('customers_name'), 'company' => $Qorder->value('customers_company'), 'street_address' => $Qorder->value('customers_street_address'), 'suburb' => $Qorder->value('customers_suburb'), 'city' => $Qorder->value('customers_city'), 'postcode' => $Qorder->value('customers_postcode'), 'state' => $Qorder->value('customers_state'), 'country' => $Qorder->value('customers_country'), 'format_id' => $Qorder->value('customers_address_format_id'), 'telephone' => $Qorder->value('customers_telephone'), 'email_address' => $Qorder->value('customers_email_address'));
     $this->delivery = array('name' => $Qorder->value('delivery_name'), 'company' => $Qorder->value('delivery_company'), 'street_address' => $Qorder->value('delivery_street_address'), 'suburb' => $Qorder->value('delivery_suburb'), 'city' => $Qorder->value('delivery_city'), 'postcode' => $Qorder->value('delivery_postcode'), 'state' => $Qorder->value('delivery_state'), 'country' => $Qorder->value('delivery_country'), 'format_id' => $Qorder->value('delivery_address_format_id'));
     $this->billing = array('name' => $Qorder->value('billing_name'), 'company' => $Qorder->value('billing_company'), 'street_address' => $Qorder->value('billing_street_address'), 'suburb' => $Qorder->value('billing_suburb'), 'city' => $Qorder->value('billing_city'), 'postcode' => $Qorder->value('billing_postcode'), 'state' => $Qorder->value('billing_state'), 'country' => $Qorder->value('billing_country'), 'format_id' => $Qorder->value('billing_address_format_id'));
     $index = 0;
     $Qproducts = $OSCOM_Db->get('orders_products', ['orders_products_id', 'products_name', 'products_model', 'products_price', 'products_tax', 'products_quantity', 'final_price'], ['orders_id' => (int) $order_id]);
     while ($Qproducts->fetch()) {
         $this->products[$index] = array('qty' => $Qproducts->value('products_quantity'), 'name' => $Qproducts->value('products_name'), 'model' => $Qproducts->value('products_model'), 'tax' => $Qproducts->value('products_tax'), 'price' => $Qproducts->value('products_price'), 'final_price' => $Qproducts->value('final_price'));
         $subindex = 0;
         $Qattributes = $OSCOM_Db->get('orders_products_attributes', ['products_options', 'products_options_values', 'options_values_price', 'price_prefix'], ['orders_id' => (int) $order_id, 'orders_products_id' => $Qproducts->valueInt('orders_products_id')]);
         if ($Qattributes->fetch() !== false) {
             do {
                 $this->products[$index]['attributes'][$subindex] = array('option' => $Qattributes->value('products_options'), 'value' => $Qattributes->value('products_options_values'), 'prefix' => $Qattributes->value('price_prefix'), 'price' => $Qattributes->value('options_values_price'));
                 $subindex++;
             } while ($Qattributes->fetch());
         }
         $index++;
     }
 }
开发者ID:haraldpdl,项目名称:oscommerce2,代码行数:34,代码来源:order.php

示例5: execute

 public function execute()
 {
     global $login_customer_id;
     $OSCOM_Db = Registry::get('Db');
     if (is_int($login_customer_id) && $login_customer_id > 0) {
         if (SESSION_RECREATE == 'True') {
             tep_session_recreate();
         }
         $Qcustomer = $OSCOM_Db->prepare('select c.customers_firstname, c.customers_default_address_id, ab.entry_country_id, ab.entry_zone_id from :table_customers c left join :table_address_book ab on (c.customers_id = ab.customers_id and c.customers_default_address_id = ab.address_book_id) where c.customers_id = :customers_id');
         $Qcustomer->bindInt(':customers_id', $login_customer_id);
         $Qcustomer->execute();
         $_SESSION['customer_id'] = $login_customer_id;
         $_SESSION['customer_default_address_id'] = $Qcustomer->valueInt('customers_default_address_id');
         $_SESSION['customer_first_name'] = $Qcustomer->value('customers_firstname');
         $_SESSION['customer_country_id'] = $Qcustomer->valueInt('entry_country_id');
         $_SESSION['customer_zone_id'] = $Qcustomer->valueInt('entry_zone_id');
         $Qupdate = $OSCOM_Db->prepare('update :table_customers_info set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1, password_reset_key = null, password_reset_date = null where customers_info_id = :customers_info_id');
         $Qupdate->bindInt(':customers_info_id', $_SESSION['customer_id']);
         $Qupdate->execute();
         // reset session token
         $_SESSION['sessiontoken'] = md5(tep_rand() . tep_rand() . tep_rand() . tep_rand());
         // restore cart contents
         $_SESSION['cart']->restore_contents();
         if (count($_SESSION['navigation']->snapshot) > 0) {
             $origin_href = OSCOM::link($_SESSION['navigation']->snapshot['page'], tep_array_to_string($_SESSION['navigation']->snapshot['get'], array(session_name())), $_SESSION['navigation']->snapshot['mode']);
             $_SESSION['navigation']->clear_snapshot();
             HTTP::redirect($origin_href);
         }
         OSCOM::redirect('index.php');
     }
 }
开发者ID:tiansiyuan,项目名称:oscommerce2,代码行数:31,代码来源:Process.php

示例6: time

 function _sess_gc($maxlifetime)
 {
     $OSCOM_Db = Registry::get('Db');
     $Qdel = $OSCOM_Db->prepare('delete from :table_sessions where expiry < :expiry');
     $Qdel->bindValue(':expiry', time() - $maxlifetime);
     $Qdel->execute();
     return $Qdel->rowCount();
 }
开发者ID:tiansiyuan,项目名称:oscommerce2,代码行数:8,代码来源:sessions.php

示例7: array

 function __construct()
 {
     $OSCOM_Db = Registry::get('Db');
     $this->currencies = array();
     $Qcurrencies = $OSCOM_Db->query('select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from :table_currencies');
     while ($Qcurrencies->fetch()) {
         $this->currencies[$Qcurrencies->value('code')] = array('title' => $Qcurrencies->value('title'), 'symbol_left' => $Qcurrencies->value('symbol_left'), 'symbol_right' => $Qcurrencies->value('symbol_right'), 'decimal_point' => $Qcurrencies->value('decimal_point'), 'thousands_point' => $Qcurrencies->value('thousands_point'), 'decimal_places' => $Qcurrencies->valueInt('decimal_places'), 'value' => $Qcurrencies->valueDecimal('value'));
     }
 }
开发者ID:haraldpdl,项目名称:oscommerce2,代码行数:9,代码来源:currencies.php

示例8: currencies

 function currencies()
 {
     $OSCOM_Db = Registry::get('Db');
     $this->currencies = array();
     $Qcurrencies = $OSCOM_Db->get('currencies', ['code', 'title', 'symbol_left', 'symbol_right', 'decimal_point', 'thousands_point', 'decimal_places', 'value']);
     while ($Qcurrencies->fetch()) {
         $this->currencies[$Qcurrencies->value('code')] = ['title' => $Qcurrencies->value('title'), 'symbol_left' => $Qcurrencies->value('symbol_left'), 'symbol_right' => $Qcurrencies->value('symbol_right'), 'decimal_point' => $Qcurrencies->value('decimal_point'), 'thousands_point' => $Qcurrencies->value('thousands_point'), 'decimal_places' => $Qcurrencies->value('decimal_places'), 'value' => $Qcurrencies->value('value')];
     }
 }
开发者ID:haraldpdl,项目名称:oscommerce2,代码行数:9,代码来源:currencies.php

示例9: tep_expire_specials

function tep_expire_specials()
{
    $OSCOM_Db = Registry::get('Db');
    $Qspecials = $OSCOM_Db->query('select specials_id from :table_specials where status = 1 and now() >= expires_date and expires_date > 0');
    if ($Qspecials->fetch() !== false) {
        do {
            tep_set_specials_status($Qspecials->valueInt('specials_id'), 0);
        } while ($Qspecials->fetch());
    }
}
开发者ID:tiansiyuan,项目名称:oscommerce2,代码行数:10,代码来源:specials.php

示例10: tep_dt_get_tables

function tep_dt_get_tables()
{
    $OSCOM_Db = Registry::get('Db');
    $result = array();
    $Qtables = $OSCOM_Db->query('show table status');
    while ($Qtables->fetch()) {
        $result[] = $Qtables->value('Name');
    }
    return $result;
}
开发者ID:haraldpdl,项目名称:oscommerce2,代码行数:10,代码来源:database_tables.php

示例11: getBannerGroupSelection

 public static function getBannerGroupSelection($value, $key = '')
 {
     $OSCOM_Db = Registry::get('Db');
     $name = !empty($key) ? 'configuration[' . $key . ']' : 'configuration_value';
     $groups = [['id' => '', 'text' => '--None--']];
     $Qgroups = $OSCOM_Db->query('select distinct banners_group from :table_banners order by banners_group');
     while ($Qgroups->fetch()) {
         $groups[] = ['id' => $Qgroups->value('banners_group'), 'text' => $Qgroups->value('banners_group')];
     }
     return HTML::selectField($name, $groups, $value);
 }
开发者ID:haraldpdl,项目名称:oscommerce2,代码行数:11,代码来源:cm_footer_banner.php

示例12: language

 function language($lng = '')
 {
     $OSCOM_Db = Registry::get('Db');
     $this->languages = array('af' => 'af|afrikaans', 'ar' => 'ar([-_][[:alpha:]]{2})?|arabic', 'be' => 'be|belarusian', 'bg' => 'bg|bulgarian', 'br' => 'pt[-_]br|brazilian portuguese', 'ca' => 'ca|catalan', 'cs' => 'cs|czech', 'da' => 'da|danish', 'de' => 'de([-_][[:alpha:]]{2})?|german', 'el' => 'el|greek', 'en' => 'en([-_][[:alpha:]]{2})?|english', 'es' => 'es([-_][[:alpha:]]{2})?|spanish', 'et' => 'et|estonian', 'eu' => 'eu|basque', 'fa' => 'fa|farsi', 'fi' => 'fi|finnish', 'fo' => 'fo|faeroese', 'fr' => 'fr([-_][[:alpha:]]{2})?|french', 'ga' => 'ga|irish', 'gl' => 'gl|galician', 'he' => 'he|hebrew', 'hi' => 'hi|hindi', 'hr' => 'hr|croatian', 'hu' => 'hu|hungarian', 'id' => 'id|indonesian', 'it' => 'it|italian', 'ja' => 'ja|japanese', 'ko' => 'ko|korean', 'ka' => 'ka|georgian', 'lt' => 'lt|lithuanian', 'lv' => 'lv|latvian', 'mk' => 'mk|macedonian', 'mt' => 'mt|maltese', 'ms' => 'ms|malaysian', 'nl' => 'nl([-_][[:alpha:]]{2})?|dutch', 'no' => 'no|norwegian', 'pl' => 'pl|polish', 'pt' => 'pt([-_][[:alpha:]]{2})?|portuguese', 'ro' => 'ro|romanian', 'ru' => 'ru|russian', 'sk' => 'sk|slovak', 'sq' => 'sq|albanian', 'sr' => 'sr|serbian', 'sv' => 'sv|swedish', 'sz' => 'sz|sami', 'sx' => 'sx|sutu', 'th' => 'th|thai', 'ts' => 'ts|tsonga', 'tr' => 'tr|turkish', 'tn' => 'tn|tswana', 'uk' => 'uk|ukrainian', 'ur' => 'ur|urdu', 'vi' => 'vi|vietnamese', 'tw' => 'zh[-_]tw|chinese traditional', 'zh' => 'zh|chinese simplified', 'ji' => 'ji|yiddish', 'zu' => 'zu|zulu');
     $this->catalog_languages = array();
     $Qlanguages = $OSCOM_Db->query('select languages_id, name, code, image, directory from :table_languages order by sort_order');
     while ($Qlanguages->fetch()) {
         $this->catalog_languages[$Qlanguages->value('code')] = array('id' => $Qlanguages->valueInt('languages_id'), 'name' => $Qlanguages->value('name'), 'image' => $Qlanguages->value('image'), 'directory' => $Qlanguages->value('directory'));
     }
     $this->browser_languages = '';
     $this->language = '';
     $this->set_language($lng);
 }
开发者ID:tiansiyuan,项目名称:oscommerce2,代码行数:13,代码来源:language.php

示例13: pass

 function pass()
 {
     $OSCOM_Db = Registry::get('Db');
     $Qcheck = $OSCOM_Db->query('show table status');
     if ($Qcheck->fetch() !== false) {
         do {
             if ($Qcheck->hasValue('Collation') && $Qcheck->value('Collation') != 'utf8_unicode_ci') {
                 return false;
             }
         } while ($Qcheck->fetch());
     }
     return true;
 }
开发者ID:haraldpdl,项目名称:oscommerce2,代码行数:13,代码来源:mysql_utf8.php

示例14: pass

 function pass()
 {
     global $PHP_SELF;
     $OSCOM_Db = Registry::get('Db');
     if ($PHP_SELF == 'security_checks.php') {
         if (defined('MODULE_SECURITY_CHECK_EXTENDED_LAST_RUN_DATETIME')) {
             $OSCOM_Db->save('configuration', ['configuration_value' => time()], ['configuration_key' => 'MODULE_SECURITY_CHECK_EXTENDED_LAST_RUN_DATETIME']);
         } else {
             $OSCOM_Db->save('configuration', ['configuration_title' => 'Security Check Extended Last Run', 'configuration_key' => 'MODULE_SECURITY_CHECK_EXTENDED_LAST_RUN_DATETIME', 'configuration_value' => time(), 'configuration_description' => 'The date and time the last extended security check was performed.', 'configuration_group_id' => '6', 'date_added' => 'now()']);
         }
         return true;
     }
     return defined('MODULE_SECURITY_CHECK_EXTENDED_LAST_RUN_DATETIME') && MODULE_SECURITY_CHECK_EXTENDED_LAST_RUN_DATETIME > strtotime('-30 days');
 }
开发者ID:haraldpdl,项目名称:oscommerce2,代码行数:14,代码来源:extended_last_run.php

示例15: __construct

 public function __construct()
 {
     static $_category_tree_data;
     $OSCOM_Db = Registry::get('Db');
     $OSCOM_Language = Registry::get('Language');
     if (isset($_category_tree_data)) {
         $this->_data = $_category_tree_data;
     } else {
         $Qcategories = $OSCOM_Db->prepare('select c.categories_id, c.parent_id, c.categories_image, cd.categories_name from :table_categories c, :table_categories_description cd where c.categories_id = cd.categories_id and cd.language_id = :language_id order by c.parent_id, c.sort_order, cd.categories_name');
         $Qcategories->bindInt(':language_id', $OSCOM_Language->getId());
         $Qcategories->setCache('categories-lang' . $OSCOM_Language->getId());
         $Qcategories->execute();
         while ($Qcategories->fetch()) {
             $this->_data[$Qcategories->valueInt('parent_id')][$Qcategories->valueInt('categories_id')] = array('name' => $Qcategories->value('categories_name'), 'image' => $Qcategories->value('categories_image'));
         }
         $_category_tree_data = $this->_data;
     }
 }
开发者ID:haraldpdl,项目名称:oscommerce2,代码行数:18,代码来源:category_tree.php


注:本文中的OSC\OM\Registry::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。