PHP Класс FOF30\Utils\FilesCheck

You need a file called fileslist.php in your component's administrator root directory with the following contents: $phpFileChecker = array( 'version' => 'revCEE2DAB', 'date' => '2014-10-16', 'directories' => array( 'administrator/components/com_foobar', .... ), 'files' => array( 'administrator/components/com_foobar/access.xml' => array('705', '09aa0351a316bf011ecc8c1145134761', 'b95f00c7b49a07a60570dc674f2497c45c4e7152'), .... ) ); All directory and file paths are relative to the site's root The directories array is a list of directories which must exist. The files array has the file paths as keys. The value is a simple array containing the following elements in this order: file size in bytes, MD5 checksum, SHA1 checksum.
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$date Current component release date
$dirList List of directories to check that exist
$fileList List of files to check as filepath => (filesize, md5, sha1)
$option The name of the component
$version Current component version
$wrongComponentVersion Is the reported component version different than the version of the #__extensions table?
$wrongFilesVersion Is the fileslist.php reporting a version different than the reported component version?

Открытые методы

Метод Описание
__construct ( string $option, string $version, string $date ) Create and initialise the object
fastCheck ( ) : boolean Performs a fast check of file and folders. If even one of the files/folders doesn't exist, or even one file has the wrong file size it will return false.
isWrongComponentVersion ( ) : boolean Is the reported component version different than the version of the #__extensions table?
isWrongFilesVersion ( ) : boolean Is the fileslist.php reporting a version different than the reported component version?
slowCheck ( integer $idx ) : array Performs a slow, thorough check of all files and folders (including MD5/SHA1 sum checks)

Описание методов

__construct() публичный Метод

Create and initialise the object
public __construct ( string $option, string $version, string $date )
$option string Component name, e.g. com_foobar
$version string The current component version, as reported by the component
$date string The current component release date, as reported by the component

fastCheck() публичный Метод

Performs a fast check of file and folders. If even one of the files/folders doesn't exist, or even one file has the wrong file size it will return false.
public fastCheck ( ) : boolean
Результат boolean False when there are mismatched files and directories

isWrongComponentVersion() публичный Метод

Is the reported component version different than the version of the #__extensions table?
public isWrongComponentVersion ( ) : boolean
Результат boolean

isWrongFilesVersion() публичный Метод

Is the fileslist.php reporting a version different than the reported component version?
public isWrongFilesVersion ( ) : boolean
Результат boolean

slowCheck() публичный Метод

Performs a slow, thorough check of all files and folders (including MD5/SHA1 sum checks)
public slowCheck ( integer $idx ) : array
$idx integer The index from where to start
Результат array Progress report

Описание свойств

$date защищенное свойство

Current component release date
protected $date

$dirList защищенное свойство

List of directories to check that exist
protected $dirList

$fileList защищенное свойство

List of files to check as filepath => (filesize, md5, sha1)
protected $fileList

$option защищенное свойство

The name of the component
protected $option

$version защищенное свойство

Current component version
protected $version

$wrongComponentVersion защищенное свойство

Is the reported component version different than the version of the #__extensions table?
protected $wrongComponentVersion

$wrongFilesVersion защищенное свойство

Is the fileslist.php reporting a version different than the reported component version?
protected $wrongFilesVersion