diff --git a/copy_this/modules/proudsourcing/psCacheWarmer/application/controllers/pscachewarmer.php b/Application/Controller/CacheWarmer.php old mode 100755 new mode 100644 similarity index 78% rename from copy_this/modules/proudsourcing/psCacheWarmer/application/controllers/pscachewarmer.php rename to Application/Controller/CacheWarmer.php index e9f99db..3177cc1 --- a/copy_this/modules/proudsourcing/psCacheWarmer/application/controllers/pscachewarmer.php +++ b/Application/Controller/CacheWarmer.php @@ -10,7 +10,13 @@ * @package psCacheWarmer * @version 1.0.1 **/ -class psCacheWarmer extends oxUBase + +namespace ProudCommerce\CacheWarmer\Application\Controller; + +use OxidEsales\Eshop\Core\Registry; +use OxidEsales\Eshop\Core\Controller\BaseController; + +class CacheWarmer extends BaseController { /** * Executes cache warmer @@ -21,15 +27,15 @@ class psCacheWarmer extends oxUBase if($this->_checkAuthentification()) { $aUrls = $this->_getSitemapContent(); - if(!empty(oxRegistry::getConfig()->getShopConfVar('psCacheWarmerSitemapUrl')) && count($aUrls) > 0) { + if(!empty(Registry::getConfig()->getShopConfVar('psCacheWarmerSitemapUrl')) && count($aUrls) > 0) { foreach($aUrls as $sUrl) { $oCurl = curl_init(); curl_setopt($oCurl, CURLOPT_URL, $sUrl); curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($oCurl, CURLOPT_CONNECTTIMEOUT, 25); curl_setopt($oCurl, CURLOPT_HEADER, true); - $sUsername = oxRegistry::getConfig()->getShopConfVar('psCacheWarmerUser'); - $sPassword = oxRegistry::getConfig()->getShopConfVar('psCacheWarmerPass'); + $sUsername = Registry::getConfig()->getShopConfVar('psCacheWarmerUser'); + $sPassword = Registry::getConfig()->getShopConfVar('psCacheWarmerPass'); curl_setopt($oCurl, CURLOPT_USERPWD, $sUsername . ":" . $sPassword); curl_exec($oCurl); $httpStatus = curl_getinfo($oCurl, CURLINFO_HTTP_CODE); @@ -63,8 +69,8 @@ class psCacheWarmer extends oxUBase $sSitemapUrl = $this->_getSitemapUrl(); } - $sUsername = oxRegistry::getConfig()->getShopConfVar('psCacheWarmerUser'); - $sPassword = oxRegistry::getConfig()->getShopConfVar('psCacheWarmerPass'); + $sUsername = Registry::getConfig()->getShopConfVar('psCacheWarmerUser'); + $sPassword = Registry::getConfig()->getShopConfVar('psCacheWarmerPass'); $sSitemapUrl = str_replace("://", "://".$sUsername.":".$sPassword."@", $sSitemapUrl); $sSitemapXmlData = @file_get_contents($sSitemapUrl); @@ -93,8 +99,8 @@ class psCacheWarmer extends oxUBase */ protected function _getSitemapUrl() { - $sSitemapUrl = oxRegistry::getConfig()->getConfigParam('sShopURL'); - $sSitemapUrl .= oxRegistry::getConfig()->getShopConfVar('psCacheWarmerSitemapUrl'); + $sSitemapUrl = Registry::getConfig()->getConfigParam('sShopURL'); + $sSitemapUrl .= Registry::getConfig()->getShopConfVar('psCacheWarmerSitemapUrl'); return $sSitemapUrl; } @@ -105,8 +111,8 @@ class psCacheWarmer extends oxUBase */ protected function _checkAuthentification() { - $oConfig = oxRegistry::getConfig(); - $sKey = oxRegistry::getConfig()->getRequestParameter("key"); + $oConfig = Registry::getConfig(); + $sKey = Registry::getConfig()->getRequestParameter("key"); $sSavedKey = $oConfig->getShopConfVar('psCacheWarmerKey', $oConfig->getShopId()); if($sSavedKey == $sKey) { return true; diff --git a/copy_this/modules/proudsourcing/psCacheWarmer/application/views/admin/de/pscachewarmer_lang.php b/Application/views/admin/de/pscachewarmer_lang.php similarity index 100% rename from copy_this/modules/proudsourcing/psCacheWarmer/application/views/admin/de/pscachewarmer_lang.php rename to Application/views/admin/de/pscachewarmer_lang.php diff --git a/README.md b/README.md index 86dd179..78a10e3 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ psCacheWarmer ============ Automatically calling urls using the xml-sitemap, eg. for cache warming. -Free module for OXID eshop 4.7, 4.8, 4.9 and 4.10. +Free module for OXID eshop 6. Features @@ -12,14 +12,14 @@ Features Installation - 1. copy content from copy_this folder into your shop root - 2. activate module psCacheWarmer in shop admin + 1. composer config repo.ProudCommerce/CacheWarmer git https://github.com/Josef-A-Puckl/psCacheWarmer/ + 2. composer require proudcommerce/cachewarmer -Tip: Use the [OXID module connector](https://github.com/OXIDprojects/OXID-Module-Connector) to install this module. Changelog - 2016-10-12 1.0.1 fix reading sitemap url with user/pass,fix checking sitemap object + 2019-06-26 2.0.0 OXID eShop 6 - Josef A. Puckl + 2016-10-12 1.0.1 fix reading sitemap url with user/pass,fix checking sitemap object 2016-08-25 1.0.0 module release for oxid 4.7, 4.8, 4.9, 4.10 License diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..f66d2fe --- /dev/null +++ b/composer.json @@ -0,0 +1,33 @@ +{ + "name": "proudcommerce/cachewarmer", + "version": "2.0.0", + "description": "psCacheWarmer", + "type": "oxideshop-module", + "license": [ + "proprietary" + ], + "authors": [ + { + "name": "ProudCommerce", + "homepage": "https://www.proudcommerce.com/", + "email": "welcome@proudcommerce.com", + "role": "Developer" + } + ], + "support": { + "email": "support@proudcommerce.com" + }, + "require": { + "php": ">= 7.0" + }, + "autoload": { + "psr-4": { + "ProudCommerce\\CacheWarmer\\": "../../../source/modules/proudsourcing/psCacheWarmer" + } + }, + "extra": { + "oxideshop": { + "target-directory": "proudsourcing/psCacheWarmer" + } + } +} \ No newline at end of file diff --git a/copy_this/modules/proudsourcing/vendormetadata.php b/copy_this/modules/proudsourcing/vendormetadata.php deleted file mode 100755 index 69b7025..0000000 --- a/copy_this/modules/proudsourcing/vendormetadata.php +++ /dev/null @@ -1,6 +0,0 @@ -URL: '.oxRegistry::getConfig()->getConfigParam('sShopURL').'?cl=psCacheWarmer&key='.oxRegistry::getConfig()->getShopConfVar('psCacheWarmerKey', oxRegistry::getConfig()->getShopId()).'', ), 'thumbnail' => 'logo_pc-os.jpg', - 'version' => '1.0.1', + 'version' => '2.0.0', 'author' => 'Proud Sourcing GmbH', 'url' => 'http://www.proudcommerce.com/', 'email' => 'support@proudcommerce.com', 'extend' => array( ), - 'files' => array( - 'pscachewarmer' => 'proudsourcing/psCacheWarmer/application/controllers/pscachewarmer.php', + 'controllers' => array( + 'pscachewarmer' => \ProudCommerce\CacheWarmer\Application\Controller\CacheWarmer::class, ), 'templates' => array( ), diff --git a/copy_this/modules/proudsourcing/psCacheWarmer/views/admin/de/pscachewarmer_lang.php b/views/admin/de/pscachewarmer_lang.php similarity index 100% rename from copy_this/modules/proudsourcing/psCacheWarmer/views/admin/de/pscachewarmer_lang.php rename to views/admin/de/pscachewarmer_lang.php