forked from AmpersandHQ/magento-ce-ee-config-corruption-bug
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path100-router-script.php
55 lines (46 loc) · 1.26 KB
/
100-router-script.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
$path = getenv("MAGE_PATH");
if (!file_exists($path)) {
$path = dirname(__FILE__) . '/app/Mage.php';
}
require_once($path);
$caches = array();
foreach (Mage::app()->useCache() as $type => $status) {
if ($type == 'config') {
$status = 1;
}
$caches[$type] = $status;
}
Mage::app()->saveUseCache($caches);
Mage::reset();
if (!Mage::app()->useCache('config')) {
die("Config cache needs to be enabled.");
}
/**
* Clearing every bit of cache I can get a hold of, to simulate an empty cache to begin with
*/
Mage::app()->getCacheInstance()->clean();
Mage::app()->getCacheInstance()->flush();
Mage::app()->getCache()->clean();
Mage::reset();
/**
* Warming up the cache.
*/
Mage::app();
Mage::reset();
/**
* Initialise mage app,
* sets useCache = true
*
* Removes config_global to simulate a time sensitive cache hit on the config_global.lock cache entry
*/
Mage::app()->getCacheInstance()->remove('config_global');
/**
* Recall init, which calls Mage_Core_Model_Config:;init,
* useCache is still true, but we have the hit the fake cache lock on config_global.
*/
Mage::app()->init(Mage_Core_Model_App::ADMIN_STORE_ID, 'store');
/**
* Reload a non FPC page, you should see a 100 router match iteration page / no 404 page
*/
echo "Done\n";