class PurgePurgerBundleProcess in Purge 7.2
Class definition for the runtime bundle. This class is used for processing the purge requests during runtine.
Hierarchy
- class \Purge
- class \PurgePurger
- class \PurgePurgerBundle
- class \PurgePurgerBundleProcess
- class \PurgePurgerBundle
- class \PurgePurger
Expanded class hierarchy of PurgePurgerBundleProcess
File
- includes/
purge.class.inc, line 927 - Contains all class and interface definitions for Purge.
View source
class PurgePurgerBundleProcess extends PurgePurgerBundle {
public $purgeables;
/**
* Constructor for the Configuration bundle.
*/
public function __construct() {
$runtime_data = array();
// First check if the data is in cache.
// If not, get from parent.
$all_data = $this
->get_data();
// Create the types and keep the data for caching.
$this
->set_types($all_data);
$runtime_data['type'] = $all_data['type'];
// For loop through the set_data and collect active items.
$data['purger'] = array();
foreach ($all_data['purger'] as $purger_name => $purger_data) {
// check if the purger is enabled.
if (strpos($purger_data, "s:7:\"enabled\";i:1")) {
$data['purger'][$purger_name] = $purger_data;
// Create the purger object.
$this->purger[$purger_name] = unserialize($purger_data);
// Now loop through the pointers
foreach ($this->purger[$purger_name]->pointers as $pointer_type => $item_names) {
foreach ($item_names as $item_name) {
$item_data = $all_data[$pointer_type][$item_name];
// Check in the data if the item is enabled.
if (strpos($item_data, "s:7:\"enabled\";i:1")) {
// Check if the item object isn't allready there.
if (isset($this->{$pointer_type}[$item_name])) {
// If so just link the pointer to it.
$this->purger[$purger_name]->{$pointer_type}[$item_name] = $this->{$pointer_type}[$item_name];
}
else {
// Create the object from data
$this->{$pointer_type}[$item_name] = unserialize($item_data);
// Check if it item has cacheable data
if ($this->{$pointer_type}[$item_name] instanceof PurgeCacheable) {
$this->{$pointer_type}[$item_name]
->cache();
}
// And link the pointer
$this->purger[$purger_name]->{$pointer_type}[$item_name] = $this->{$pointer_type}[$item_name];
// And keep the item data
$data[$pointer_type][$item_name] = $item_data;
}
}
}
}
}
}
}
/**
* Process all requests.
*/
public function process() {
// Walk the purgeables.
foreach ($this->purgeables as $purgeable_type_name => $purgeables) {
foreach ($purgeables as $purgeable) {
// Pass all purgers.
foreach ($this->purger as $purger_name => $purger) {
// Handle purgeable URLs.
if ($purgeable_type_name == 'urls') {
if ($this->purger[$purger_name] instanceof PurgeProcessableUrl) {
// Process the Purgeable URL.
$this->purger[$purger_name]
->process_url($purgeable);
}
}
}
}
}
// Now process the queues.
foreach ($this->queue as $queue) {
//if (count($queue->queue) > 0) {
$queue
->process();
// }
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Purge:: |
public | property | ||
Purge:: |
public | property | ||
Purge:: |
public | property | ||
Purge:: |
public | property | ||
Purge:: |
public | property | ||
Purge:: |
public | property | ||
Purge:: |
public | property | ||
Purge:: |
public | property | ||
Purge:: |
public | function | Does basic dependency checks for builtin dependencies. | 5 |
PurgePurger:: |
public | property | ||
PurgePurger:: |
public | property | ||
PurgePurger:: |
public | property | ||
PurgePurger:: |
public | property | ||
PurgePurger:: |
public | property | ||
PurgePurgerBundle:: |
public | property | ||
PurgePurgerBundle:: |
public | function | Function to select data from the dataset. | |
PurgePurgerBundle:: |
public | function | Function to set the type objects. | |
PurgePurgerBundle:: |
public | function |
Override for parents sleep to make sure we include the bundled objects. Overrides Purge:: |
|
PurgePurgerBundle:: |
public | function | Set the item objects linked in this bundle when waking up. | |
PurgePurgerBundleProcess:: |
public | property | ||
PurgePurgerBundleProcess:: |
public | function | Process all requests. | |
PurgePurgerBundleProcess:: |
public | function | Constructor for the Configuration bundle. |