[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/includes/domit/ -> php_text_cache.php (sommaire)

PHP Text Cache is a simple caching class for for saving/retrieving local copies of url data

Author: John Heinstein <johnkarl@nbnet.nb.ca>
Copyright: (C) 2004 John Heinstein. All rights reserved
License: http://www.gnu.org/copyleft/lesser.html LGPL License
Version: 0.3-pre
Poids: 192 lignes (6 kb)
Inclus ou requis: 1 fois
Référencé: 0 fois
Nécessite: 3 fichiers
 includes/domit/php_http_connector.php
 includes/domit/php_file_utilities.php
 includes/domit/php_http_client_generic.php

Définit 1 class

php_text_cache:: (9 méthodes):
  php_text_cache()
  setTimeout()
  getData()
  getCacheFileName()
  establishConnection()
  useHTTPClient()
  fromURL()
  fromCache()
  fromFile()


Classe: php_text_cache  - X-Ref

A simple caching class for saving/retrieving local copies of url data

php_text_cache($cacheDir = './', $cacheTime = -1, $timeout = 0)   X-Ref
Constructor

param: string Directory in which to store the cache files
param: int Expiry time for cache file (-1 signifies no expiry limit)
param: int Time in seconds to disconnect after attempting an http connection

setTimeout($timeout)   X-Ref
Specifies the default timeout value for connecting to a host

param: int The number of seconds to timeout when attempting to connect to a server

getData($url)   X-Ref
Gets data from an url, or its cache file

param: string The url of the data
return: string The data at the specified url

getCacheFileName($url)   X-Ref
Given an url, returns the path to the cache file

Uses an md5 hash of the url. This can be
overridden if a different approach is required

param: string The url of the data
return: string The cache file name

establishConnection($url)   X-Ref
Establishes a connection, given an url

param: string The url of the data

useHTTPClient($truthVal)   X-Ref
Specifies whether an HTTP client should be used to establish a connection

param: boolean True if an HTTP client is to be used to establish the connection

fromURL($url, $cacheFile)   X-Ref
Gets data from an url and caches a copy of the data

param: string The url for the data
param: string The cache file path
return: string The contents of the url

fromCache($cacheFile)   X-Ref
Get text from cache file

param: string The file path
return: string The text contained in the file, or an empty string

fromFile($filename)   X-Ref
Get text from an url or file

param: string The url or file path
return: string The text contained in the url or file, or an empty string



Généré le : Wed Nov 21 14:43:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics