mirror of
				https://github.com/alchemy-fr/Phraseanet.git
				synced 2025-10-28 04:13:11 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			156 lines
		
	
	
		
			6.7 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			156 lines
		
	
	
		
			6.7 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| /*
 | |
|  * This file is part of Phraseanet
 | |
|  *
 | |
|  * (c) 2005-2014 Alchemy
 | |
|  *
 | |
|  * For the full copyright and license information, please view the LICENSE
 | |
|  * file that was distributed with this source code.
 | |
|  */
 | |
| 
 | |
| namespace Alchemy\Phrasea\Setup;
 | |
| 
 | |
| /**
 | |
|  * @see https://github.com/sensio/SensioDistributionBundle/blob/master/Resources/skeleton/app/SymfonyRequirements.php
 | |
|  *
 | |
|  * A RequirementCollection represents a set of Requirement instances.
 | |
|  *
 | |
|  * @author Tobias Schultze <http://tobion.de>
 | |
|  */
 | |
| interface RequirementCollectionInterface extends \IteratorAggregate
 | |
| {
 | |
|     /**
 | |
|      * Get the name of the requirement collection
 | |
|      *
 | |
|      * @return String
 | |
|      */
 | |
|     public function getName();
 | |
| 
 | |
|     /**
 | |
|      * Set a name to the requirement collection
 | |
|      *
 | |
|      * @param String $name
 | |
|      *
 | |
|      * @return RequirementCollectionInterface
 | |
|      */
 | |
|     public function setName($name);
 | |
| 
 | |
|     public function addInformation($name, $value);
 | |
| 
 | |
|     public function getInformations();
 | |
| 
 | |
|     /**
 | |
|      * Adds a RequirementInterface.
 | |
|      *
 | |
|      * @param Requirement $requirement A Requirement instance
 | |
|      */
 | |
|     public function add(RequirementInterface $requirement);
 | |
| 
 | |
|     /**
 | |
|      * Adds a mandatory requirement.
 | |
|      *
 | |
|      * @param Boolean     $fulfilled   Whether the requirement is fulfilled
 | |
|      * @param string      $testMessage The message for testing the requirement
 | |
|      * @param string      $helpHtml    The help text formatted in HTML for resolving the problem
 | |
|      * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
 | |
|      */
 | |
|     public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null);
 | |
| 
 | |
|     /**
 | |
|      * Adds an optional recommendation.
 | |
|      *
 | |
|      * @param Boolean     $fulfilled   Whether the recommendation is fulfilled
 | |
|      * @param string      $testMessage The message for testing the recommendation
 | |
|      * @param string      $helpHtml    The help text formatted in HTML for resolving the problem
 | |
|      * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
 | |
|      */
 | |
|     public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null);
 | |
| 
 | |
|     /**
 | |
|      * Adds a mandatory requirement in form of a php.ini configuration.
 | |
|      *
 | |
|      * @param string           $cfgName    The configuration name used for ini_get()
 | |
|      * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
 | |
|                                                     or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
 | |
|      * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
 | |
|                                                     This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
 | |
|                                                     Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
 | |
|      * @param string      $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
 | |
|      * @param string      $helpHtml    The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
 | |
|      * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
 | |
|      */
 | |
|     public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null);
 | |
| 
 | |
|     /**
 | |
|      * Adds an optional recommendation in form of a php.ini configuration.
 | |
|      *
 | |
|      * @param string           $cfgName    The configuration name used for ini_get()
 | |
|      * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
 | |
|                                                     or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
 | |
|      * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
 | |
|                                                     This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
 | |
|                                                     Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
 | |
|      * @param string      $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
 | |
|      * @param string      $helpHtml    The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
 | |
|      * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
 | |
|      */
 | |
|     public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null);
 | |
| 
 | |
|     /**
 | |
|      * Adds a requirement collection to the current set of requirements.
 | |
|      *
 | |
|      * @param RequirementCollection $collection A RequirementCollection instance
 | |
|      */
 | |
|     public function addCollection(RequirementCollection $collection);
 | |
| 
 | |
|     /**
 | |
|      * Returns both requirements and recommendations.
 | |
|      *
 | |
|      * @return array Array of Requirement instances
 | |
|      */
 | |
|     public function all();
 | |
| 
 | |
|     /**
 | |
|      * Returns all mandatory requirements.
 | |
|      *
 | |
|      * @return RequirementInterface[] Array of Requirement instances
 | |
|      */
 | |
|     public function getRequirements();
 | |
| 
 | |
|     /**
 | |
|      * Returns the mandatory requirements that were not met.
 | |
|      *
 | |
|      * @return array Array of Requirement instances
 | |
|      */
 | |
|     public function getFailedRequirements();
 | |
| 
 | |
|     /**
 | |
|      * Returns all optional recommmendations.
 | |
|      *
 | |
|      * @return array Array of Requirement instances
 | |
|      */
 | |
|     public function getRecommendations();
 | |
| 
 | |
|     /**
 | |
|      * Returns the recommendations that were not met.
 | |
|      *
 | |
|      * @return array Array of Requirement instances
 | |
|      */
 | |
|     public function getFailedRecommendations();
 | |
| 
 | |
|     /**
 | |
|      * Returns whether a php.ini configuration is not correct.
 | |
|      *
 | |
|      * @return Boolean php.ini configuration problem?
 | |
|      */
 | |
|     public function hasPhpIniConfigIssue();
 | |
| 
 | |
|     /**
 | |
|      * Returns the PHP configuration file (php.ini) path.
 | |
|      *
 | |
|      * @return string|false php.ini file path
 | |
|      */
 | |
|     public function getPhpIniConfigPath();
 | |
| }
 | 
