예제 #1
0
 public function __construct($registry)
 {
     $config = $registry->get('config');
     $currency = $registry->get('currency');
     $this->request = $registry->get('request');
     $this->store_id = $config->get('config_store_id');
     $this->language_id = $config->get('config_language_id');
     $this->currency_id = $currency->getCode();
     if (self::$mobile_detect->isMobile()) {
         if (self::$mobile_detect->isTablet()) {
             self::$device = 'tablet';
         } else {
             self::$device = 'mobile';
         }
     }
     $this->logged_in = $registry->get('customer')->isLogged() ? 1 : 0;
     $this->price = $config->get('config_customer_price') && $registry->get('customer')->isLogged() || !$config->get('config_customer_price') ? 'price' : 'noprice';
     $this->hostname = md5(Journal2Utils::getHostName());
 }
예제 #2
0
 private function getHash($files, $ext, $language = '')
 {
     $hash = '';
     if (is_array($files)) {
         foreach ($files as $file) {
             $hash .= $file;
         }
     } else {
         $hash = $files;
     }
     $hash .= JOURNAL_VERSION;
     $hash .= Journal2Utils::getHostName();
     $hash .= $language;
     return md5($hash) . '.' . $ext;
 }