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
122bd231
Commit
122bd231
authored
Apr 09, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified Application constructor signature.
parent
6f11f9e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
Application.php
framework/base/Application.php
+15
-7
HtmlTest.php
tests/unit/framework/helpers/HtmlTest.php
+3
-1
No files found.
framework/base/Application.php
View file @
122bd231
...
...
@@ -98,16 +98,24 @@ class Application extends Module
/**
* Constructor.
* @param string $id the ID of this application. The ID should uniquely identify the application from others.
* @param string $basePath the base path of this application. This should point to
* the directory containing all application logic, template and data.
* @param array $config name-value pairs that will be used to initialize the object properties
* @param array $config name-value pairs that will be used to initialize the object properties.
* Note that the configuration must contain both [[id]] and [[basePath]].
* @throws InvalidConfigException if either [[id]] or [[basePath]] configuration is missing.
*/
public
function
__construct
(
$
id
,
$basePath
,
$
config
=
array
())
public
function
__construct
(
$config
=
array
())
{
Yii
::
$app
=
$this
;
$this
->
id
=
$id
;
$this
->
setBasePath
(
$basePath
);
if
(
!
isset
(
$config
[
'id'
]))
{
throw
new
InvalidConfigException
(
'The "id" configuration is required.'
);
}
if
(
isset
(
$config
[
'basePath'
]))
{
$this
->
setBasePath
(
$config
[
'basePath'
]);
unset
(
$config
[
'basePath'
]);
}
else
{
throw
new
InvalidConfigException
(
'The "basePath" configuration is required.'
);
}
if
(
YII_ENABLE_ERROR_HANDLER
)
{
ini_set
(
'display_errors'
,
0
);
...
...
tests/unit/framework/helpers/HtmlTest.php
View file @
122bd231
...
...
@@ -10,7 +10,9 @@ class HtmlTest extends \yii\test\TestCase
{
public
function
setUp
()
{
new
Application
(
'test'
,
'@yiiunit/runtime'
,
array
(
new
Application
(
array
(
'id'
=>
'test'
,
'basePath'
=>
'@yiiunit/runtime'
,
'components'
=>
array
(
'request'
=>
array
(
'class'
=>
'yii\web\Request'
,
...
...
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