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


PHP Registry::set方法代码示例

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


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

示例1: process

    protected function process() {
      $OSCOM_MessageStack = Registry::get('MessageStack');

      $this->_page_title = OSCOM::getDef('heading_title');

      if ( isset($_GET['cid']) && is_numeric($_GET['cid']) ) {
        $this->_category_id = $_GET['cid'];
      }

      $this->_tree = new CategoryTree();
      Registry::set('CategoryTree', $this->_tree);

      Registry::set('Currencies', new Currencies());

      Registry::set('Tax', new Tax());

      Registry::set('Image', new Image());

// check if the products image directory exists
      if ( is_dir(OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'products') ) {
        if ( !is_writeable(OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'products') ) {
          $OSCOM_MessageStack->add('header', sprintf(OSCOM::getDef('ms_error_image_directory_not_writable'), OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'products'), 'error');
        }
      } else {
        $OSCOM_MessageStack->add('header', sprintf(OSCOM::getDef('ms_error_image_directory_non_existant'), OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'products'), 'error');
      }

// check for imagemagick or GD
      if ( !Image::hasGDSupport() && ((strlen(CFG_APP_IMAGEMAGICK_CONVERT) < 1) || !file_exists(CFG_APP_IMAGEMAGICK_CONVERT)) ) {
        $OSCOM_MessageStack->add('header', OSCOM::getDef('ms_warning_image_processor_not_available'), 'warning');
      }
    }
开发者ID:haraldpdl,项目名称:oscommerce,代码行数:32,代码来源:Controller.php

示例2: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_Template = Registry::get('Template');
     $OSCOM_Customer = Registry::get('Customer');
     global $osC_oiAddress;
     // HPDL
     $application->setPageTitle(OSCOM::getDef('shipping_method_heading'));
     $application->setPageContent('shipping.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_checkout_shipping'), OSCOM::getLink(null, null, 'Shipping', 'SSL'));
     }
     // load shipping address page if no default address exists
     if (!$OSCOM_ShoppingCart->hasShippingAddress()) {
         $application->setPageTitle(OSCOM::getDef('shipping_address_heading'));
         $application->setPageContent('shipping_address.php');
         $OSCOM_Template->addJavascriptFilename(OSCOM::getPublicSiteLink('javascript/checkout_shipping_address.js'));
         $OSCOM_Template->addJavascriptPhpFilename(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/assets/form_check.js.php');
         if (!$OSCOM_Customer->isLoggedOn()) {
             $osC_oiAddress = new ObjectInfo($OSCOM_ShoppingCart->getShippingAddress());
         }
     } else {
         $OSCOM_Template->addJavascriptFilename(OSCOM::getPublicSiteLink('javascript/checkout_shipping.js'));
         // load all enabled shipping modules
         Registry::set('Shipping', new ShippingClass(), true);
     }
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:29,代码来源:Shipping.php

示例3: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $application->setPageTitle(sprintf(OSCOM::getDef('index_heading'), STORE_NAME));
     $application->setPageContent('product_listing.php');
     if (is_numeric($_GET['Manufacturers'])) {
         Registry::set('Manufacturer', new Manufacturer($_GET['Manufacturers']));
         $OSCOM_Manufacturer = Registry::get('Manufacturer');
         $application->setPageTitle($OSCOM_Manufacturer->getTitle());
         // HPDL        $application->setPageImage('manufacturers/' . $OSCOM_Manufacturer->getImage());
         if ($OSCOM_Service->isStarted('Breadcrumb')) {
             $OSCOM_Breadcrumb->add($OSCOM_Manufacturer->getTitle(), OSCOM::getLink());
         }
         Registry::set('Products', new Products());
         $OSCOM_Products = Registry::get('Products');
         $OSCOM_Products->setManufacturer($OSCOM_Manufacturer->getID());
         if (isset($_GET['filter']) && is_numeric($_GET['filter']) && $_GET['filter'] > 0) {
             $OSCOM_Products->setCategory($_GET['filter']);
         }
         if (isset($_GET['sort']) && !empty($_GET['sort'])) {
             if (strpos($_GET['sort'], '|d') !== false) {
                 $OSCOM_Products->setSortBy(substr($_GET['sort'], 0, -2), '-');
             } else {
                 $OSCOM_Products->setSortBy($_GET['sort']);
             }
         }
     } else {
         osc_redirect(OSCOM::getLink(OSCOM::getDefaultSite(), OSCOM::getDefaultSiteApplication()));
     }
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:31,代码来源:Manufacturers.php

示例4: isValid

 public static function isValid(Product $OSCOM_Product)
 {
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     if ($OSCOM_ShoppingCart->hasBillingAddress() === false) {
         if ($OSCOM_Customer->hasDefaultAddress()) {
             $OSCOM_ShoppingCart->setBillingAddress($OSCOM_Customer->getDefaultAddressID());
             $OSCOM_ShoppingCart->resetBillingMethod();
         } elseif ($OSCOM_ShoppingCart->hasShippingAddress()) {
             $OSCOM_ShoppingCart->setBillingAddress($OSCOM_ShoppingCart->getShippingAddress());
             $OSCOM_ShoppingCart->resetBillingMethod();
         }
     }
     if ($OSCOM_ShoppingCart->hasBillingMethod() === false) {
         if (Registry::exists('Payment') === false) {
             Registry::set('Payment', new Payment());
         }
         $OSCOM_Payment = Registry::get('Payment');
         $OSCOM_Payment->loadAll();
         if ($OSCOM_Payment->hasActive()) {
             $payment_modules = $OSCOM_Payment->getActive();
             $payment_module = $payment_modules[0];
             $OSCOM_PaymentModule = Registry::get('Payment_' . $payment_module);
             $OSCOM_ShoppingCart->setBillingMethod(array('id' => $OSCOM_PaymentModule->getCode(), 'title' => $OSCOM_PaymentModule->getMethodTitle()));
         }
     }
     return $OSCOM_ShoppingCart->hasBillingAddress() && $OSCOM_ShoppingCart->hasBillingMethod();
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:28,代码来源:RequireBilling.php

示例5: load

 public function load($module)
 {
     if (in_array($module, $this->_modules)) {
         $module_class = 'osCommerce\\OM\\Core\\Site\\Shop\\Module\\Payment\\' . $module;
         Registry::set('PaymentModule', new $module_class(), true);
     }
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:7,代码来源:Payment.php

示例6: execute

 public static function execute($search, $parent_id = 0)
 {
     if (Registry::exists('CategoryTree')) {
         $OSCOM_CategoryTree = Registry::get('CategoryTree');
     } else {
         $OSCOM_CategoryTree = new CategoryTree();
         Registry::set('CategoryTree', $OSCOM_CategoryTree);
     }
     $OSCOM_CategoryTree->reset();
     $OSCOM_CategoryTree->setRootCategoryID($parent_id);
     $OSCOM_CategoryTree->setBreadcrumbUsage(false);
     $categories = array();
     foreach ($OSCOM_CategoryTree->getArray() as $c) {
         if (stripos($c['title'], $search) !== false) {
             if ($c['id'] != $parent_id) {
                 $category_path = $OSCOM_CategoryTree->getPathArray($c['id']);
                 $top_category_id = $category_path[0]['id'];
                 if (!in_array($top_category_id, $categories)) {
                     $categories[] = $top_category_id;
                 }
             }
         }
     }
     $result = array('entries' => array());
     foreach ($categories as $c) {
         $result['entries'][] = array('id' => $OSCOM_CategoryTree->getData($c, 'id'), 'title' => $OSCOM_CategoryTree->getData($c, 'name'), 'products' => $OSCOM_CategoryTree->getData($c, 'count'));
     }
     $result['total'] = count($result['entries']);
     return $result;
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:30,代码来源:find.php

示例7: start

 public static function start()
 {
     $OSCOM_Service = Registry::get('Service');
     Registry::set('RecentlyVisited', new RecentlyVisitedClass());
     $OSCOM_Service->addCallBeforePageContent('RecentlyVisited', 'initialize');
     return true;
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:7,代码来源:RecentlyVisited.php

示例8: execute

 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_NavigationHistory = Registry::get('NavigationHistory');
     $OSCOM_MessageStack = Registry::get('MessageStack');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     if (ALLOW_GUEST_TO_TELL_A_FRIEND == '-1' && $OSCOM_Customer->isLoggedOn() === false) {
         $OSCOM_NavigationHistory->setSnapshot();
         osc_redirect(OSCOM::getLink(null, 'Account', 'LogIn', 'SSL'));
     }
     $requested_product = null;
     $product_check = false;
     if (count($_GET) > 3) {
         $requested_product = basename(key(array_slice($_GET, 3, 1, true)));
         if ($requested_product == 'Write') {
             unset($requested_product);
             if (count($_GET) > 4) {
                 $requested_product = basename(key(array_slice($_GET, 4, 1, true)));
             }
         }
     }
     if (isset($requested_product)) {
         if (Product::checkEntry($requested_product)) {
             $product_check = true;
         }
     }
     if ($product_check === false) {
         $application->setPageContent('not_found.php');
         return false;
     }
     Registry::set('Product', new Product($requested_product));
     $OSCOM_Product = Registry::get('Product');
     if (empty($_POST['from_name'])) {
         $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_customers_name_empty'));
     }
     if (!osc_validate_email_address($_POST['from_email_address'])) {
         $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_invalid_customers_email_address'));
     }
     if (empty($_POST['to_name'])) {
         $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_friends_name_empty'));
     }
     if (!osc_validate_email_address($_POST['to_email_address'])) {
         $OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_invalid_friends_email_address'));
     }
     if ($OSCOM_MessageStack->size('TellAFriend') < 1) {
         $email_subject = sprintf(OSCOM::getDef('email_tell_a_friend_subject'), osc_sanitize_string($_POST['from_name']), STORE_NAME);
         $email_body = sprintf(OSCOM::getDef('email_tell_a_friend_intro'), osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['from_name']), $OSCOM_Product->getTitle(), STORE_NAME) . "\n\n";
         if (!empty($_POST['message'])) {
             $email_body .= osc_sanitize_string($_POST['message']) . "\n\n";
         }
         $email_body .= sprintf(OSCOM::getDef('email_tell_a_friend_link'), OSCOM::getLink(null, null, $OSCOM_Product->getKeyword(), 'NONSSL', false)) . "\n\n" . sprintf(OSCOM::getDef('email_tell_a_friend_signature'), STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");
         osc_email(osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['to_email_address']), $email_subject, $email_body, osc_sanitize_string($_POST['from_name']), osc_sanitize_string($_POST['from_email_address']));
         $OSCOM_MessageStack->add('header', sprintf(OSCOM::getDef('success_tell_a_friend_email_sent'), $OSCOM_Product->getTitle(), osc_output_string_protected($_POST['to_name'])), 'success');
         osc_redirect(OSCOM::getLink(null, null, $OSCOM_Product->getKeyword()));
     }
     $application->setPageTitle($OSCOM_Product->getTitle());
     $application->setPageContent('tell_a_friend.php');
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:59,代码来源:Process.php

示例9: start

 public static function start()
 {
     Registry::set('Breadcrumb', new BreadcrumbClass());
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_top'), OSCOM::getLink(OSCOM::getDefaultSite(), OSCOM::getDefaultSiteApplication()));
     $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_shop'), OSCOM::getLink('Shop', 'Index'));
     return true;
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:8,代码来源:Breadcrumb.php

示例10: execute

 public static function execute($data)
 {
     if ($OSCOM_PDO = PDO::initialize($data['server'], $data['username'], $data['password'], null, $data['port'], $data['class'])) {
         Registry::set('PDO', $OSCOM_PDO);
         OSCOM::callDB('Setup\\Install\\CreateDB', array('database' => $data['database']));
     }
     return PDO::initialize($data['server'], $data['username'], $data['password'], $data['database'], $data['port'], $data['class']);
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:8,代码来源:checkDB.php

示例11: start

 public static function start()
 {
     Registry::set('Banner', new BannerClass());
     $OSCOM_Banner = Registry::get('Banner');
     $OSCOM_Banner->activateAll();
     $OSCOM_Banner->expireAll();
     return true;
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:8,代码来源:Banner.php

示例12: start

 public static function start()
 {
     Registry::set('Specials', new SpecialsClass());
     $OSCOM_Specials = Registry::get('Specials');
     $OSCOM_Specials->activateAll();
     $OSCOM_Specials->expireAll();
     return true;
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:8,代码来源:Specials.php

示例13: initialize

 public static function initialize()
 {
     Registry::set('MessageStack', new MessageStack());
     Registry::set('Cache', new Cache());
     Registry::set('PDO', PDO::initialize());
     foreach (OSCOM::callDB('Shop\\GetConfiguration', null, 'Site') as $param) {
         define($param['cfgKey'], $param['cfgValue']);
     }
     Registry::set('Session', Session::load('adminSid'));
     Registry::get('Session')->start();
     Registry::get('MessageStack')->loadFromSession();
     Registry::set('Language', new Language());
     if (!self::hasAccess(OSCOM::getSiteApplication())) {
         Registry::get('MessageStack')->add('header', 'No access.', 'error');
         OSCOM::redirect(OSCOM::getLink(null, OSCOM::getDefaultSiteApplication()));
     }
     $application = 'osCommerce\\OM\\Core\\Site\\Admin\\Application\\' . OSCOM::getSiteApplication() . '\\Controller';
     Registry::set('Application', new $application());
     Registry::set('Template', new Template());
     Registry::get('Template')->setApplication(Registry::get('Application'));
     // HPDL move following checks elsewhere
     // check if a default currency is set
     if (!defined('DEFAULT_CURRENCY')) {
         Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_error_no_default_currency'), 'error');
     }
     // check if a default language is set
     if (!defined('DEFAULT_LANGUAGE')) {
         Registry::get('MessageStack')->add('header', ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
     }
     if (function_exists('ini_get') && (bool) ini_get('file_uploads') == false) {
         Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_warning_uploads_disabled'), 'warning');
     }
     // check if Work directories are writable
     $work_dirs = array();
     foreach (array('Cache', 'CoreUpdate', 'Database', 'Logs', 'Session', 'Temp') as $w) {
         if (!is_writable(OSCOM::BASE_DIRECTORY . 'Work/' . $w)) {
             $work_dirs[] = $w;
         }
     }
     if (!empty($work_dirs)) {
         Registry::get('MessageStack')->add('header', sprintf(OSCOM::getDef('ms_error_work_directories_not_writable'), OSCOM::BASE_DIRECTORY . 'Work/', implode(', ', $work_dirs)), 'error');
     }
     if (!OSCOM::configExists('time_zone', 'OSCOM')) {
         Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_warning_time_zone_not_defined'), 'warning');
     }
     if (!OSCOM::configExists('dir_fs_public', 'OSCOM') || !file_exists(OSCOM::getConfig('dir_fs_public', 'OSCOM'))) {
         Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_warning_dir_fs_public_not_defined'), 'warning');
     }
     // check if the upload directory exists
     if (is_dir(OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload')) {
         if (!is_writeable(OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload')) {
             Registry::get('MessageStack')->add('header', sprintf(OSCOM::getDef('ms_error_upload_directory_not_writable'), OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload'), 'error');
         }
     } else {
         Registry::get('MessageStack')->add('header', sprintf(OSCOM::getDef('ms_error_upload_directory_non_existant'), OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload'), 'error');
     }
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:57,代码来源:Controller.php

示例14: process

 protected function process()
 {
     $OSCOM_ShoppingCart = Registry::get('ShoppingCart');
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_MessageStack = Registry::get('MessageStack');
     // redirect to shopping cart if shopping cart is empty
     if (!$OSCOM_ShoppingCart->hasContents()) {
         osc_redirect(OSCOM::getLink(null, 'Cart'));
     }
     // check for e-mail address
     if (!$OSCOM_Customer->hasEmailAddress()) {
         if (isset($_POST['email']) && strlen(trim($_POST['email'])) >= ACCOUNT_EMAIL_ADDRESS) {
             if (osc_validate_email_address($_POST['email'])) {
                 $OSCOM_Customer->setEmailAddress(trim($_POST['email']));
             } else {
                 $OSCOM_MessageStack->add('Cart', OSCOM::getDef('field_customer_email_address_check_error'));
                 osc_redirect(OSCOM::getLink(null, 'Cart'));
             }
         } else {
             $OSCOM_MessageStack->add('Cart', sprintf(OSCOM::getDef('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS));
             osc_redirect(OSCOM::getLink(null, 'Cart'));
         }
     }
     // check product type perform_order conditions
     foreach ($OSCOM_ShoppingCart->getProducts() as $product) {
         $OSCOM_Product = new Product($product['id']);
         $OSCOM_Product->isTypeActionAllowed('PerformOrder');
     }
     $OSCOM_Language->load('checkout');
     $OSCOM_Language->load('order');
     $this->_page_title = OSCOM::getDef('confirmation_heading');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_checkout_confirmation'), OSCOM::getLink(null, 'Checkout', null, 'SSL'));
     }
     if (isset($_POST['comments']) && isset($_SESSION['comments']) && empty($_POST['comments'])) {
         unset($_SESSION['comments']);
     } elseif (!empty($_POST['comments'])) {
         $_SESSION['comments'] = osc_sanitize_string($_POST['comments']);
     }
     if (DISPLAY_CONDITIONS_ON_CHECKOUT == '1') {
         if (!isset($_POST['conditions']) || $_POST['conditions'] != '1') {
             $OSCOM_MessageStack->add('Checkout', OSCOM::getDef('error_conditions_not_accepted'), 'error');
         }
     }
     if (Registry::exists('Payment') === false) {
         Registry::set('Payment', new Payment());
     }
     if ($OSCOM_ShoppingCart->hasBillingMethod()) {
         $OSCOM_Payment = Registry::get('Payment');
         $OSCOM_Payment->load($OSCOM_ShoppingCart->getBillingMethod('id'));
     }
 }
开发者ID:kdexter,项目名称:oscommerce,代码行数:55,代码来源:Controller.php

示例15: execute

 public static function execute($data)
 {
     Registry::set('PDO', PDO::initialize($data['server'], $data['username'], $data['password'], $data['database'], $data['port'], $data['class']));
     OSCOM::setConfig('db_table_prefix', $data['table_prefix'], 'Admin');
     OSCOM::setConfig('db_table_prefix', $data['table_prefix'], 'Shop');
     OSCOM::setConfig('db_table_prefix', $data['table_prefix'], 'Setup');
     $cfg_data = array(array('key' => 'STORE_NAME', 'value' => $data['shop_name']), array('key' => 'STORE_OWNER', 'value' => $data['shop_owner_name']), array('key' => 'STORE_OWNER_EMAIL_ADDRESS', 'value' => $data['shop_owner_email']), array('key' => 'EMAIL_FROM', 'value' => '"' . $data['shop_owner_name'] . '" <' . $data['shop_owner_email'] . '>'));
     OSCOM::callDB('Admin\\UpdateConfigurationParameters', $cfg_data, 'Site');
     $admin_data = array('username' => $data['admin_username'], 'password' => $data['admin_password'], 'modules' => array('0'));
     Administrators::save($admin_data);
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:11,代码来源:configureShop.php


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