PHP Class ForkCMS\Bundle\InstallerBundle\Service\RequirementsChecker

Show file Open project: forkcms/forkcms

Public Methods

Method Description
__construct ( $rootDir ) RequirementsChecker constructor.
getErrors ( ) : array Get all errors created by the requirements test
hasErrors ( ) : boolean Are there any issues with status error?
hasWarnings ( ) Are there any issues with status warning?
passes ( ) : boolean Are all requirements met?

Protected Methods

Method Description
checkApacheRewrites ( ) Ensure that Apache .htaccess file is written and mod_rewrite does its job
checkAvailableFiles ( )
checkAvailableFunctions ( ) Some functions should be available
checkFilePermissions ( ) Make sure the filesystem is prepared for the installation and everything can be read/ written correctly.
checkPhpExtensions ( ) A couple extensions need to be loaded in order to be able to use Fork CMS. Without these extensions, we can't guarantee that everything will work.
checkPhpIniSettings ( ) A couple of php.ini settings should be configured in a specific way to make sure that they don't intervene with Fork CMS.
checkPhpVersion ( ) * At first we're going to check to see if the PHP version meets the minimum requirements for Fork CMS. We require at least PHP 5.5.0, because we don't want to be responsible for security issues in PHP itself.
checkRequirement ( string $name, boolean $requirement, string $severity = self::STATUS_ERROR ) : boolean Check if a specific requirement is satisfied
checkRequirements ( ) : boolean Check all requirements and returns if everything has passed.
checkSubFolder ( ) Fork can't be installed in subfolders, so we should check that.

Private Methods

Method Description
isRecursivelyWritable ( string $path ) : boolean Check if a directory and its sub-directories and its subdirectories and .
isWritable ( string $path ) : boolean Check if a directory is writable.

Method Details

__construct() public method

RequirementsChecker constructor.
public __construct ( $rootDir )
$rootDir

checkApacheRewrites() protected method

Ensure that Apache .htaccess file is written and mod_rewrite does its job
protected checkApacheRewrites ( )

checkAvailableFiles() protected method

protected checkAvailableFiles ( )

checkAvailableFunctions() protected method

Some functions should be available
protected checkAvailableFunctions ( )

checkFilePermissions() protected method

Make sure the filesystem is prepared for the installation and everything can be read/ written correctly.
protected checkFilePermissions ( )

checkPhpExtensions() protected method

A couple extensions need to be loaded in order to be able to use Fork CMS. Without these extensions, we can't guarantee that everything will work.
protected checkPhpExtensions ( )

checkPhpIniSettings() protected method

A couple of php.ini settings should be configured in a specific way to make sure that they don't intervene with Fork CMS.
protected checkPhpIniSettings ( )

checkPhpVersion() protected method

We follow this timeline: http://php.net/supported-versions.php
protected checkPhpVersion ( )

checkRequirement() protected method

Check if a specific requirement is satisfied
protected checkRequirement ( string $name, boolean $requirement, string $severity = self::STATUS_ERROR ) : boolean
$name string The "name" of the check.
$requirement boolean The result of the check.
$severity string The severity of the requirement.
return boolean

checkRequirements() protected method

Check all requirements and returns if everything has passed.
protected checkRequirements ( ) : boolean
return boolean

checkSubFolder() protected method

Fork can't be installed in subfolders, so we should check that.
protected checkSubFolder ( )

getErrors() public method

Get all errors created by the requirements test
public getErrors ( ) : array
return array

hasErrors() public method

Are there any issues with status error?
public hasErrors ( ) : boolean
return boolean

hasWarnings() public method

Are there any issues with status warning?
public hasWarnings ( )

passes() public method

Are all requirements met?
public passes ( ) : boolean
return boolean