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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
ecd47caa
Commit
ecd47caa
authored
May 11, 2013
by
Klimov Paul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"requirements.php" has been added to "bootstrap" application.
parent
8ab1d837
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
1 deletion
+100
-1
requirements.php
apps/bootstrap/protected/requirements.php
+99
-0
YiiRequirementChecker.php
yii/requirements/YiiRequirementChecker.php
+1
-1
No files found.
apps/bootstrap/protected/requirements.php
0 → 100644
View file @
ecd47caa
<?php
/**
* Application requirement checker script.
*
* In order to run this script use the following console command:
* php requirements.php
*
* In order to run this script from the web, you should copy it to the web root.
* If you are using Linux you can create a hard link instead, using the following command:
* ln requirements.php ../requirements.php
*/
$appRootPath
=
dirname
(
__FILE__
);
if
(
basename
(
$appRootPath
)
==
'protected'
)
{
$appRootPath
=
dirname
(
$appRootPath
);
}
// you may need to adjust this path:
require_once
(
realpath
(
$appRootPath
.
'/../../yii/requirements/YiiRequirementChecker.php'
));
$requirementsChecker
=
new
YiiRequirementChecker
();
/**
* Adjust requirements according to your application specifics.
*/
$requirements
=
array
(
// Database :
array
(
'name'
=>
'PDO extension'
,
'mandatory'
=>
true
,
'condition'
=>
extension_loaded
(
'pdo'
),
'by'
=>
'All <a href="http://www.yiiframework.com/doc/api/#system.db">DB-related classes</a>'
,
),
array
(
'name'
=>
'PDO SQLite extension'
,
'mandatory'
=>
false
,
'condition'
=>
extension_loaded
(
'pdo_sqlite'
),
'by'
=>
'All <a href="http://www.yiiframework.com/doc/api/#system.db">DB-related classes</a>'
,
'memo'
=>
'Required for SQLite database.'
,
),
array
(
'name'
=>
'PDO MySQL extension'
,
'mandatory'
=>
false
,
'condition'
=>
extension_loaded
(
'pdo_mysql'
),
'by'
=>
'All <a href="http://www.yiiframework.com/doc/api/#system.db">DB-related classes</a>'
,
'memo'
=>
'Required for MySQL database.'
,
),
// Cache :
array
(
'name'
=>
'Memcache extension'
,
'mandatory'
=>
fasle
,
'condition'
=>
extension_loaded
(
'memcache'
)
||
extension_loaded
(
'memcached'
),
'by'
=>
'<a href="http://www.yiiframework.com/doc/api/CMemCache">CMemCache</a>'
,
'memo'
=>
extension_loaded
(
'memcached'
)
?
'To use memcached set <a href="http://www.yiiframework.com/doc/api/CMemCache#useMemcached-detail">CMemCache::useMemcached</a> to <code>true</code>.'
:
''
),
array
(
'name'
=>
'APC extension'
,
'mandatory'
=>
false
,
'condition'
=>
extension_loaded
(
'apc'
)
||
extension_loaded
(
'apc'
),
'by'
=>
'<a href="http://www.yiiframework.com/doc/api/CApcCache">CApcCache</a>'
,
),
// Additional PHP extensions :
array
(
'name'
=>
'Mcrypt extension'
,
'mandatory'
=>
false
,
'condition'
=>
extension_loaded
(
'mcrypt'
),
'by'
=>
'<a href="http://www.yiiframework.com/doc/api/CSecurityManager">CSecurityManager</a>'
,
'memo'
=>
'Required by encrypt and decrypt methods.'
),
// PHP ini :
'phpSafeMode'
=>
array
(
'name'
=>
'PHP safe mode'
,
'mandatory'
=>
false
,
'condition'
=>
$requirementsChecker
->
checkPhpIniOff
(
"safe_mode"
),
'by'
=>
'File uploading and console command execution'
,
'memo'
=>
'"safe_mode" should be disabled at php.ini'
,
),
'phpExposePhp'
=>
array
(
'name'
=>
'Expose PHP'
,
'mandatory'
=>
false
,
'condition'
=>
$requirementsChecker
->
checkPhpIniOff
(
"expose_php"
),
'by'
=>
'Security reasons'
,
'memo'
=>
'"expose_php" should be disabled at php.ini'
,
),
'phpAllowUrlInclude'
=>
array
(
'name'
=>
'PHP allow url include'
,
'mandatory'
=>
false
,
'condition'
=>
$requirementsChecker
->
checkPhpIniOff
(
"allow_url_include"
),
'by'
=>
'Security reasons'
,
'memo'
=>
'"allow_url_include" should be disabled at php.ini'
,
),
'phpSmtp'
=>
array
(
'name'
=>
'PHP mail SMTP'
,
'mandatory'
=>
false
,
'condition'
=>
strlen
(
ini_get
(
'SMTP'
))
>
0
,
'by'
=>
'Email sending'
,
'memo'
=>
'PHP mail SMTP server required'
,
),
);
$requirementsChecker
->
checkYii
()
->
check
(
$requirements
)
->
render
();
\ No newline at end of file
yii/requirements/YiiRequirementChecker.php
View file @
ecd47caa
...
...
@@ -17,7 +17,7 @@ if (version_compare(PHP_VERSION, '4.3', '<')) {
* Example:
* <code>
* require_once('path/to/YiiRequirementChecker.php');
* $requirementsChecker = YiiRequirementChecker();
* $requirementsChecker =
new
YiiRequirementChecker();
* $requirements = array(
* array(
* 'name' => 'PHP Some Extension',
...
...
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