PHP Class Nexcessnet_Turpentine_Helper_Cron

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Inheritance: extends Mage_Core_Helper_Abstract
Afficher le fichier Open project: nexcess/magento-turpentine

Protected Properties

Свойство Type Description
$_crawlerClient Varien_Http_Client Crawler client singleton

Méthodes publiques

Méthode Description
addCategoryToCrawlerQueue ( Mage_Catalog_Model_Category $category ) : integer Add URLs to the queue by category model
addCmsPageToCrawlerQueue ( integer $cmsPageId ) : integer Add URLs to queue by CMS page ID
addProductToCrawlerQueue ( Mage_Catalog_Model_Product $product ) : integer Add URLs to the queue by product model
addUrlToCrawlerQueue ( string $url ) : boolean Add a single URL to the queue, returns whether it was actually added to the queue or not (false if it was already in the queue)
addUrlsToCrawlerQueue ( array $urls ) : integer Add a list of URLs to the queue, returns how many unique URLs were actually added to the queue
getAllUrls ( ) : array Get the list of all URLs
getAllowedRunTime ( ) : integer Get the max execution time (or 0 if unlimited)
getCrawlerBatchSize ( ) : integer Get number of urls to crawl per batch
getCrawlerClient ( ) : Varien_Http_Client Get the crawler http client
getCrawlerDebugEnabled ( ) : boolean Get if crawler debugging is enabled
getCrawlerEnabled ( ) : boolean Get if the crawler is enabled
getCrawlerWaitPeriod ( ) : integer Get time in seconds to wait between url batches
getNextUrl ( ) : string | null Pop a URL to crawl off the queue, or null if no URLs left
getRunTime ( ) : integer Get the execution time used so far
getUrlQueue ( ) : array Get the current URL queue

Méthodes protégées

Méthode Description
_readUrlQueue ( ) : array Get the crawler URL queue from the cache
_writeUrlQueue ( array $urls ) : null Save the crawler URL queue to the cache

Method Details

_readUrlQueue() protected méthode

Get the crawler URL queue from the cache
protected _readUrlQueue ( ) : array
Résultat array

_writeUrlQueue() protected méthode

Save the crawler URL queue to the cache
protected _writeUrlQueue ( array $urls ) : null
$urls array
Résultat null

addCategoryToCrawlerQueue() public méthode

Add URLs to the queue by category model
public addCategoryToCrawlerQueue ( Mage_Catalog_Model_Category $category ) : integer
$category Mage_Catalog_Model_Category
Résultat integer

addCmsPageToCrawlerQueue() public méthode

Add URLs to queue by CMS page ID
public addCmsPageToCrawlerQueue ( integer $cmsPageId ) : integer
$cmsPageId integer
Résultat integer

addProductToCrawlerQueue() public méthode

Add URLs to the queue by product model
public addProductToCrawlerQueue ( Mage_Catalog_Model_Product $product ) : integer
$product Mage_Catalog_Model_Product
Résultat integer

addUrlToCrawlerQueue() public méthode

Add a single URL to the queue, returns whether it was actually added to the queue or not (false if it was already in the queue)
public addUrlToCrawlerQueue ( string $url ) : boolean
$url string
Résultat boolean

addUrlsToCrawlerQueue() public méthode

Add a list of URLs to the queue, returns how many unique URLs were actually added to the queue
public addUrlsToCrawlerQueue ( array $urls ) : integer
$urls array
Résultat integer

getAllUrls() public méthode

Get the list of all URLs
public getAllUrls ( ) : array
Résultat array

getAllowedRunTime() public méthode

Get the max execution time (or 0 if unlimited)
public getAllowedRunTime ( ) : integer
Résultat integer

getCrawlerBatchSize() public méthode

Get number of urls to crawl per batch
public getCrawlerBatchSize ( ) : integer
Résultat integer

getCrawlerClient() public méthode

Get the crawler http client
public getCrawlerClient ( ) : Varien_Http_Client
Résultat Varien_Http_Client

getCrawlerDebugEnabled() public méthode

Get if crawler debugging is enabled
public getCrawlerDebugEnabled ( ) : boolean
Résultat boolean

getCrawlerEnabled() public méthode

Get if the crawler is enabled
public getCrawlerEnabled ( ) : boolean
Résultat boolean

getCrawlerWaitPeriod() public méthode

Get time in seconds to wait between url batches
public getCrawlerWaitPeriod ( ) : integer
Résultat integer

getNextUrl() public méthode

Pop a URL to crawl off the queue, or null if no URLs left
public getNextUrl ( ) : string | null
Résultat string | null

getRunTime() public méthode

Get the execution time used so far
public getRunTime ( ) : integer
Résultat integer

getUrlQueue() public méthode

Get the current URL queue
public getUrlQueue ( ) : array
Résultat array

Property Details

$_crawlerClient protected_oe property

Crawler client singleton
protected Varien_Http_Client $_crawlerClient
Résultat Varien_Http_Client