eZ Publish  [trunk]
eZDBGarbageCollector Class Reference

List of all members.

Public Member Functions

 collectProductCollections ($maxTime=false, $sleepTime=false, $limit=false)

Static Public Member Functions

 collectBaskets ($maxTime=false, $sleepTime=false, $limit=false)
 collectProductCollectionItemOptions ($maxTime=false, $sleepTime=false, $limit=false)
 collectProductCollectionItems ($maxTime=false, $sleepTime=false, $limit=false)

Public Attributes

const ITEM_LIMIT = 3000

Detailed Description

Definition at line 32 of file ezdbgarbagecollector.php.


Member Function Documentation

eZDBGarbageCollector::collectBaskets ( maxTime = false,
sleepTime = false,
limit = false 
) [static]

Removes all baskets which are missing a session entry. This usually means the basket was not cleaned up when the session was removed.

Parameters:
$maxTimeThe maximum number of seconds the collector should run. If set to false or true it will continue until all garbage is collected, false means to try the fastest way possible (may use lots of resources).
$sleepTimeControls how many seconds it will sleep between each batch of cleanup, setting it to false means that it should never sleep.
$limitControls how many items are cleaned in one batch operation, a value of false means to use default value.
Note:
The function will most likely use a little more time than $maxTime so don't depend on it to be accurate.
This will also remove the product collection the basket is using.
Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 60 of file ezdbgarbagecollector.php.

eZDBGarbageCollector::collectProductCollectionItemOptions ( maxTime = false,
sleepTime = false,
limit = false 
) [static]

Removes all product collection item options which are missing a product collection item.

Parameters:
$maxTimeThe maximum number of seconds the collector should run. If set to false or true it will continue until all garbage is collected, false means to try the fastest way possible (may use lots of resources).
$sleepTimeControls how many seconds it will sleep between each batch of cleanup, setting it to false means that it should never sleep.
$limitControls how many items are cleaned in one batch operation, a value of false means to use default value.
Note:
The function will most likely use a little more time than $maxTime so don't depend on it to be accurate.
Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 353 of file ezdbgarbagecollector.php.

eZDBGarbageCollector::collectProductCollectionItems ( maxTime = false,
sleepTime = false,
limit = false 
) [static]

Removes all product collection items which are missing a product collection.

Parameters:
$maxTimeThe maximum number of seconds the collector should run. If set to false or true it will continue until all garbage is collected, false means to try the fastest way possible (may use lots of resources).
$sleepTimeControls how many seconds it will sleep between each batch of cleanup, setting it to false means that it should never sleep.
$limitControls how many items are cleaned in one batch operation, a value of false means to use default value.
Note:
The function will most likely use a little more time than $maxTime so don't depend on it to be accurate.
This will also remove the product collection item option the item is using.
Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 268 of file ezdbgarbagecollector.php.

eZDBGarbageCollector::collectProductCollections ( maxTime = false,
sleepTime = false,
limit = false 
)

Removes entries from ezproductcollection which is missing relations to other tables.

Parameters:
$maxTimeThe maximum number of seconds the collector should run. If set to false or true it will continue until all garbage is collected, false means to try the fastest way possible (may use lots of resources).
$sleepTimeControls how many seconds it will sleep between each batch of cleanup, setting it to false means that it should never sleep.
$limitControls how many items are cleaned in one batch operation, a value of false means to use default value.
Note:
The function will most likely use a little more time than $maxTime so don't depend on it to be accurate.
The current code hardcodes the related tables.
Warning:
This code may be very slow on large sites.
Note:
Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Definition at line 153 of file ezdbgarbagecollector.php.


Member Data Documentation

Controls the default value for how many items are cleaned in one batch operation.

Definition at line 37 of file ezdbgarbagecollector.php.

Referenced by collectBaskets(), collectProductCollectionItemOptions(), collectProductCollectionItems(), and collectProductCollections().


The documentation for this class was generated from the following file: