Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
43a04d23
Commit
43a04d23
authored
May 11, 2013
by
Klimov Paul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Doc comments for "YiiRequirementChecker" have been updated.
parent
653b4d1f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
8 deletions
+56
-8
YiiRequirementCheckerTest.php
...unit/framework/requirements/YiiRequirementCheckerTest.php
+3
-3
YiiRequirementChecker.php
yii/requirements/YiiRequirementChecker.php
+52
-4
yiirequirements.php
yii/requirements/yiirequirements.php
+1
-1
No files found.
tests/unit/framework/requirements/YiiRequirementCheckerTest.php
View file @
43a04d23
...
...
@@ -5,7 +5,7 @@ require_once(realpath(__DIR__.'/../../../../yii/requirements/YiiRequirementCheck
use
yiiunit\TestCase
;
/**
* Test case for
{@link YiiRequirementChecker}
.
* Test case for
[[YiiRequirementChecker]]
.
* @see YiiRequirementChecker
*/
class
YiiRequirementCheckerTest
extends
TestCase
...
...
@@ -134,7 +134,7 @@ class YiiRequirementCheckerTest extends TestCase
}
/**
* Data provider for
{@link testGetByteSize()}
.
* Data provider for
[[testGetByteSize()]]
.
* @return array
*/
public
function
dataProviderGetByteSize
()
...
...
@@ -164,7 +164,7 @@ class YiiRequirementCheckerTest extends TestCase
}
/**
* Data provider for
{@link testCompareByteSize()}
* Data provider for
[[testCompareByteSize()]]
* @return array
*/
public
function
dataProviderCompareByteSize
()
...
...
yii/requirements/YiiRequirementChecker.php
View file @
43a04d23
...
...
@@ -11,9 +11,40 @@ if (version_compare(PHP_VERSION, '4.3', '<')) {
}
/**
* YiiRequirementChecker allows checking, if current system meets the requirements for running the application.
* YiiRequirementChecker allows checking, if current system meets the requirements for running the Yii application.
* This class allows rendering of the check report for the web and console application interface.
*
* @property array|null $result the check results.
* Example:
* <code>
* require_once('path/to/YiiRequirementChecker.php');
* $requirementsChecker = YiiRequirementChecker();
* $requirements = array(
* array(
* 'name' => 'PHP Some Extension',
* 'mandatory' => true,
* 'condition' => extension_loaded('some_extension'),
* 'by' => 'Some application feature',
* 'memo' => 'PHP extension "some_extension" required',
* ),
* );
* $requirementsChecker->checkYii()->check($requirements)->render();
* <code>
*
* If you wish to render the report with your own representation, use [[getResult()]] instead of [[render()]]
*
* Requirement condition could be in format "eval:PHP expression".
* In this case specified PHP expression will be evaluated in the context of this class instance.
* For example:
* <code>
* $requirements = array(
* array(
* 'name' => 'Upload max file size',
* 'condition' => 'eval:$this->checkUploadMaxFileSize("5M")',
* ),
* );
* </code>
*
* @property array|null $result the check results, this property is for internal usage only.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
...
...
@@ -23,7 +54,7 @@ class YiiRequirementChecker
/**
* Check the given requirements, collecting results into internal field.
* This method can be invoked several times checking different requirement sets.
* Use
{@link getResult()} or {@link render()}
to get the results.
* Use
[[getResult()]] or [[render()]]
to get the results.
* @param array|string $requirements requirements to be checked.
* If an array, it is treated as the set of requirements;
* If a string, it is treated as the path of the file, which contains the requirements;
...
...
@@ -80,7 +111,24 @@ class YiiRequirementChecker
/**
* Return the check results.
* @return array|null check results.
* @return array|null check results in format:
* <code>
* array(
* 'summary' => array(
* 'total' => total number of checks,
* 'errors' => number of errors,
* 'warnings' => number of warnings,
* ),
* 'requirements' => array(
* array(
* ...
* 'error' => is there an error,
* 'warning' => is there a warning,
* ),
* ...
* ),
* )
* </code>
*/
function
getResult
()
{
...
...
yii/requirements/yiirequirements.php
View file @
43a04d23
<?php
/**
* This is the Yii core requirements for the
{@link YiiRequirementChecker}
instance.
* This is the Yii core requirements for the
[[YiiRequirementChecker]]
instance.
*/
return
array
(
array
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment