Oxid6 Upload
This commit is contained in:
bovenliggende
b60afb7eae
commit
e86445951b
26
copy_this/modules/proudsourcing/psCacheWarmer/application/controllers/pscachewarmer.php → Application/Controller/CacheWarmer.php
Executable file → Normal file
26
copy_this/modules/proudsourcing/psCacheWarmer/application/controllers/pscachewarmer.php → Application/Controller/CacheWarmer.php
Executable file → Normal file
@ -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;
|
@ -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,13 +12,13 @@ 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
|
||||
|
||||
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
|
||||
|
||||
|
33
composer.json
Normal file
33
composer.json
Normal file
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Metadata version
|
||||
*/
|
||||
$sVendorMetadataVersion = '1.0';
|
Voor Breedte: | Hoogte: | Grootte: 13 KiB Na Breedte: | Hoogte: | Grootte: 13 KiB |
@ -14,7 +14,7 @@
|
||||
/**
|
||||
* Metadata version
|
||||
*/
|
||||
$sMetadataVersion = '1.1';
|
||||
$sMetadataVersion = '2.0';
|
||||
|
||||
/**
|
||||
* Module information
|
||||
@ -29,14 +29,14 @@ $aModule = array(
|
||||
<b>URL:</b> <a href="'.oxRegistry::getConfig()->getConfigParam('sShopURL').'?cl=psCacheWarmer&key='.oxRegistry::getConfig()->getShopConfVar('psCacheWarmerKey', oxRegistry::getConfig()->getShopId()).'" target="_blank">'.oxRegistry::getConfig()->getConfigParam('sShopURL').'?cl=psCacheWarmer&key='.oxRegistry::getConfig()->getShopConfVar('psCacheWarmerKey', oxRegistry::getConfig()->getShopId()).'</a>',
|
||||
),
|
||||
'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(
|
||||
),
|
Laden…
x
Verwijs in nieuw issue
Block a user