Skip to content

Commit 1aa9290

Browse files
committed
fix include_ & require_
1 parent 0736da8 commit 1aa9290

26 files changed

+153
-150
lines changed

composer.json

Lines changed: 93 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,95 @@
11
{
2-
"name": "yiisoft/yii",
3-
"description": "Yii Web Programming Framework",
4-
"keywords": ["yii", "framework"],
5-
"homepage": "http://www.yiiframework.com/",
6-
"type": "library",
7-
"license": "BSD-3-Clause",
8-
"authors": [
9-
{
10-
"name": "Qiang Xue",
11-
"email": "qiang.xue@gmail.com",
12-
"homepage": "http://www.yiiframework.com/",
13-
"role": "Founder and project lead"
14-
},
15-
{
16-
"name": "Alexander Makarov",
17-
"email": "sam@rmcreative.ru",
18-
"homepage": "http://rmcreative.ru/",
19-
"role": "Core framework development"
20-
},
21-
{
22-
"name": "Maurizio Domba",
23-
"homepage": "http://mdomba.info/",
24-
"role": "Core framework development"
25-
},
26-
{
27-
"name": "Carsten Brandt",
28-
"email": "mail@cebe.cc",
29-
"homepage": "http://cebe.cc/",
30-
"role": "Core framework development"
31-
},
32-
{
33-
"name": "Timur Ruziev",
34-
"email": "resurtm@gmail.com",
35-
"homepage": "http://resurtm.com/",
36-
"role": "Core framework development"
37-
},
38-
{
39-
"name": "Paul Klimov",
40-
"email": "klimov.paul@gmail.com",
41-
"role": "Core framework development"
42-
},
43-
{
44-
"name": "Wei Zhuo",
45-
"email": "weizhuo@gmail.com",
46-
"role": "Project site maintenance and development"
47-
},
48-
{
49-
"name": "Sebastián Thierer",
50-
"email": "sebas@artfos.com",
51-
"role": "Component development"
52-
},
53-
{
54-
"name": "Jeffrey Winesett",
55-
"email": "jefftulsa@gmail.com",
56-
"role": "Documentation and marketing"
57-
}
58-
59-
],
60-
"support": {
61-
"issues": "https://github.com/yiisoft/yii/issues?state=open",
62-
"forum": "http://www.yiiframework.com/forum/",
63-
"wiki": "http://www.yiiframework.com/wiki/",
64-
"irc": "irc://irc.freenode.net/yii",
65-
"source": "https://github.com/yiisoft/yii"
66-
},
67-
"bin": [
68-
"framework/yiic"
69-
],
70-
"archive": {
71-
"exclude": [
72-
"demos"
73-
]
74-
},
75-
"require": {
76-
"php": ">=5.1.0"
77-
},
78-
"suggest": {
79-
"ext-mcrypt": "Required by encrypt and decrypt methods of CSecurityManager"
80-
},
81-
"autoload": {
82-
"classmap" : [
83-
"framework/YiiBase.php",
84-
"framework/yii.php"
85-
]
86-
},
87-
"require-dev": {
88-
"phpunit/phpunit": "~4.8.34",
89-
"phpunit/phpunit-selenium": "~1.4.0",
90-
"phing/phing": "2.*"
91-
}
2+
"name": "wikium/yii",
3+
"description": "Yii Web Programming Framework",
4+
"keywords": ["yii", "framework"],
5+
"homepage": "http://www.yiiframework.com/",
6+
"type": "library",
7+
"license": "BSD-3-Clause",
8+
"authors": [
9+
{
10+
"name": "Qiang Xue",
11+
"email": "qiang.xue@gmail.com",
12+
"homepage": "http://www.yiiframework.com/",
13+
"role": "Founder and project lead"
14+
},
15+
{
16+
"name": "Alexander Makarov",
17+
"email": "sam@rmcreative.ru",
18+
"homepage": "http://rmcreative.ru/",
19+
"role": "Core framework development"
20+
},
21+
{
22+
"name": "Maurizio Domba",
23+
"homepage": "http://mdomba.info/",
24+
"role": "Core framework development"
25+
},
26+
{
27+
"name": "Carsten Brandt",
28+
"email": "mail@cebe.cc",
29+
"homepage": "http://cebe.cc/",
30+
"role": "Core framework development"
31+
},
32+
{
33+
"name": "Timur Ruziev",
34+
"email": "resurtm@gmail.com",
35+
"homepage": "http://resurtm.com/",
36+
"role": "Core framework development"
37+
},
38+
{
39+
"name": "Paul Klimov",
40+
"email": "klimov.paul@gmail.com",
41+
"role": "Core framework development"
42+
},
43+
{
44+
"name": "Wei Zhuo",
45+
"email": "weizhuo@gmail.com",
46+
"role": "Project site maintenance and development"
47+
},
48+
{
49+
"name": "Sebastián Thierer",
50+
"email": "sebas@artfos.com",
51+
"role": "Component development"
52+
},
53+
{
54+
"name": "Jeffrey Winesett",
55+
"email": "jefftulsa@gmail.com",
56+
"role": "Documentation and marketing"
57+
}
58+
59+
],
60+
"support": {
61+
"issues": "https://github.com/yiisoft/yii/issues?state=open",
62+
"forum": "http://www.yiiframework.com/forum/",
63+
"wiki": "http://www.yiiframework.com/wiki/",
64+
"irc": "irc://irc.freenode.net/yii",
65+
"source": "https://github.com/yiisoft/yii"
66+
},
67+
"bin": [
68+
"framework/yiic"
69+
],
70+
"archive": {
71+
"exclude": [
72+
"demos"
73+
]
74+
},
75+
"require": {
76+
"php": ">=5.1.0"
77+
},
78+
"suggest": {
79+
"ext-mcrypt": "Required by encrypt and decrypt methods of CSecurityManager"
80+
},
81+
"autoload": {
82+
"classmap" : [
83+
"framework/YiiBase.php",
84+
"framework/yii.php",
85+
"framework/db",
86+
"framework/base",
87+
"framework/web"
88+
]
89+
},
90+
"require-dev": {
91+
"phpunit/phpunit": "~4.8.34",
92+
"phpunit/phpunit-selenium": "~1.4.0",
93+
"phing/phing": "2.*"
94+
}
9295
}

framework/YiiBase.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ public static function import($alias,$forceInclude=false)
284284
if($forceInclude)
285285
{
286286
if(is_file($classFile))
287-
require($classFile);
287+
require_once($classFile);
288288
else
289289
throw new CException(Yii::t('yii','Alias "{alias}" is invalid. Make sure it points to an existing PHP file and the file is readable.',array('{alias}'=>$alias)));
290290
self::$_imports[$alias]=$alias;
@@ -325,7 +325,7 @@ public static function import($alias,$forceInclude=false)
325325
if($forceInclude)
326326
{
327327
if(is_file($path.'.php'))
328-
require($path.'.php');
328+
require_once($path.'.php');
329329
else
330330
throw new CException(Yii::t('yii','Alias "{alias}" is invalid. Make sure it points to an existing PHP file and the file is readable.',array('{alias}'=>$alias)));
331331
self::$_imports[$alias]=$className;
@@ -432,9 +432,9 @@ public static function autoload($className,$classMapOnly=false)
432432

433433
// use include so that the error PHP file may appear
434434
if(isset(self::$classMap[$className]))
435-
include(self::$classMap[$className]);
435+
include_once(self::$classMap[$className]);
436436
elseif(isset(self::$_coreClasses[$className]))
437-
include(YII_PATH.self::$_coreClasses[$className]);
437+
include_once(YII_PATH.self::$_coreClasses[$className]);
438438
elseif($classMapOnly)
439439
return false;
440440
else
@@ -449,7 +449,7 @@ public static function autoload($className,$classMapOnly=false)
449449
$classFile=$path.DIRECTORY_SEPARATOR.$className.'.php';
450450
if(is_file($classFile))
451451
{
452-
include($classFile);
452+
include_once($classFile);
453453
if(YII_DEBUG && basename(realpath($classFile))!==$className.'.php')
454454
throw new CException(Yii::t('yii','Class name "{class}" does not match class file "{file}".', array(
455455
'{class}'=>$className,
@@ -460,13 +460,13 @@ public static function autoload($className,$classMapOnly=false)
460460
}
461461
}
462462
else
463-
include($className.'.php');
463+
include_once($className.'.php');
464464
}
465465
else // class name with namespace in PHP 5.3
466466
{
467467
$namespace=str_replace('\\','.',ltrim($className,'\\'));
468468
if(($path=self::getPathOfAlias($namespace))!==false && is_file($path.'.php'))
469-
include($path.'.php');
469+
include_once($path.'.php');
470470
else
471471
return false;
472472
}
@@ -908,4 +908,4 @@ public static function registerAutoloader($callback, $append=false)
908908
}
909909

910910
spl_autoload_register(array('YiiBase','autoload'));
911-
require(YII_PATH.'/base/interfaces.php');
911+
require_once(YII_PATH.'/base/interfaces.php');

framework/base/CApplication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function __construct($config=null)
135135

136136
// set basePath as early as possible to avoid trouble
137137
if(is_string($config))
138-
$config=require($config);
138+
$config=require_once($config);
139139
if(isset($config['basePath']))
140140
{
141141
$this->setBasePath($config['basePath']);

framework/base/CErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ protected function render($view,$data)
337337
$data['version']=$this->getVersionInfo();
338338
$data['time']=time();
339339
$data['admin']=$this->adminInfo;
340-
include($this->getViewFile($view,$data['code']));
340+
include_once($this->getViewFile($view,$data['code']));
341341
}
342342

343343
/**

framework/base/CModule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function __construct($id,$parent,$config=null)
7373

7474
// set basePath as early as possible to avoid trouble
7575
if(is_string($config))
76-
$config=require($config);
76+
$config=require_once($config);
7777
if(isset($config['basePath']))
7878
{
7979
$this->setBasePath($config['basePath']);

framework/cli/commands/MessageCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function run($args)
7979
if(!is_file($args[0]))
8080
$this->usageError("the configuration file {$args[0]} does not exist.");
8181

82-
$config=require($args[0]);
82+
$config=require_once($args[0]);
8383
$translator='Yii::t';
8484
extract($config);
8585

@@ -166,7 +166,7 @@ protected function generateMessageFile($messages,$fileName,$overwrite,$removeOld
166166
echo "Saving messages to $fileName...";
167167
if(is_file($fileName))
168168
{
169-
$translated=require($fileName);
169+
$translated=require_once($fileName);
170170
sort($messages);
171171
ksort($translated);
172172
if(array_keys($translated)==$messages)

framework/cli/commands/ShellCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function run($args)
7575
Yii::setPathOfAlias('application',null);
7676

7777
ob_start();
78-
$config=require($entryScript);
78+
$config=require_once($entryScript);
7979
ob_end_clean();
8080

8181
// oops, the entry script turns out to be a config file

framework/cli/views/webapp/protected/config/console.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
'components'=>array(
1414

1515
// database settings are configured in database.php
16-
'db'=>require(dirname(__FILE__).'/database.php'),
16+
'db'=>require_once(dirname(__FILE__).'/database.php'),
1717

1818
'log'=>array(
1919
'class'=>'CLogRouter',

framework/cli/views/webapp/protected/config/main.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
*/
5252

5353
// database settings are configured in database.php
54-
'db'=>require(dirname(__FILE__).'/database.php'),
54+
'db'=>require_once(dirname(__FILE__).'/database.php'),
5555

5656
'errorHandler'=>array(
5757
// use 'site/error' action to display errors

framework/cli/views/webapp/protected/config/test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
return CMap::mergeArray(
4-
require(dirname(__FILE__).'/main.php'),
4+
require_once(dirname(__FILE__).'/main.php'),
55
array(
66
'components'=>array(
77
'fixture'=>array(

0 commit comments

Comments
 (0)