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
b7a7800f
Commit
b7a7800f
authored
Aug 30, 2012
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed constructors.
parent
fd3c29aa
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
144 additions
and
30 deletions
+144
-30
Action.php
framework/base/Action.php
+3
-1
ActionEvent.php
framework/base/ActionEvent.php
+3
-1
Application.php
framework/base/Application.php
+3
-1
Controller.php
framework/base/Controller.php
+3
-1
Dictionary.php
framework/base/Dictionary.php
+3
-1
Event.php
framework/base/Event.php
+3
-1
Model.php
framework/base/Model.php
+3
-1
Module.php
framework/base/Module.php
+3
-1
Request.php
framework/base/Request.php
+1
-1
Response.php
framework/base/Response.php
+34
-3
Vector.php
framework/base/Vector.php
+3
-1
View.php
framework/base/View.php
+3
-1
Widget.php
framework/base/Widget.php
+3
-1
ChainedDependency.php
framework/caching/ChainedDependency.php
+3
-1
DbDependency.php
framework/caching/DbDependency.php
+3
-1
ExpressionDependency.php
framework/caching/ExpressionDependency.php
+3
-1
FileDependency.php
framework/caching/FileDependency.php
+3
-1
Application.php
framework/console/Application.php
+17
-0
Request.php
framework/console/Request.php
+1
-1
ActiveFinder.php
framework/db/ar/ActiveFinder.php
+2
-1
ActiveQuery.php
framework/db/ar/ActiveQuery.php
+3
-1
ActiveQueryBuilder.php
framework/db/ar/ActiveQueryBuilder.php
+2
-1
JoinElement.php
framework/db/ar/JoinElement.php
+1
-1
Command.php
framework/db/dao/Command.php
+3
-1
DataReader.php
framework/db/dao/DataReader.php
+3
-1
Driver.php
framework/db/dao/Driver.php
+3
-1
Expression.php
framework/db/dao/Expression.php
+3
-1
QueryBuilder.php
framework/db/dao/QueryBuilder.php
+3
-1
Transaction.php
framework/db/dao/Transaction.php
+3
-1
Application.php
framework/web/Application.php
+20
-0
No files found.
framework/base/Action.php
View file @
b7a7800f
...
...
@@ -39,11 +39,13 @@ class Action extends Component
/**
* @param string $id the ID of this action
* @param Controller $controller the controller that owns this action
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$id
,
$controller
)
public
function
__construct
(
$id
,
$controller
,
$config
=
array
()
)
{
$this
->
id
=
$id
;
$this
->
controller
=
$controller
;
parent
::
__construct
(
$config
);
}
/**
...
...
framework/base/ActionEvent.php
View file @
b7a7800f
...
...
@@ -32,9 +32,11 @@ class ActionEvent extends Event
/**
* Constructor.
* @param Action $action the action associated with this action event.
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
Action
$action
)
public
function
__construct
(
Action
$action
,
$config
=
array
()
)
{
$this
->
action
=
$action
;
parent
::
__construct
(
$config
);
}
}
framework/base/Application.php
View file @
b7a7800f
...
...
@@ -121,14 +121,16 @@ class Application extends Module
* @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
*/
public
function
__construct
(
$id
,
$basePath
)
public
function
__construct
(
$id
,
$basePath
,
$config
=
array
()
)
{
\Yii
::
$application
=
$this
;
$this
->
id
=
$id
;
$this
->
setBasePath
(
$basePath
);
$this
->
registerDefaultAliases
();
$this
->
registerCoreComponents
();
parent
::
__construct
(
$config
);
}
/**
...
...
framework/base/Controller.php
View file @
b7a7800f
...
...
@@ -78,11 +78,13 @@ class Controller extends Component
/**
* @param string $id ID of this controller
* @param Module $module the module that this controller belongs to.
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$id
,
$module
)
public
function
__construct
(
$id
,
$module
,
$config
=
array
()
)
{
$this
->
id
=
$id
;
$this
->
module
=
$module
;
parent
::
__construct
(
$config
);
}
/**
...
...
framework/base/Dictionary.php
View file @
b7a7800f
...
...
@@ -48,13 +48,15 @@ class Dictionary extends Object implements \IteratorAggregate, \ArrayAccess, \Co
* Initializes the dictionary with an array or an iterable object.
* @param mixed $data the initial data to be populated into the dictionary.
* This can be an array or an iterable object.
* @param array $config name-value pairs that will be used to initialize the object properties
* @throws Exception if data is not well formed (neither an array nor an iterable object)
*/
public
function
__construct
(
$data
=
array
())
public
function
__construct
(
$data
=
array
()
,
$config
=
array
()
)
{
if
(
$data
!==
array
())
{
$this
->
copyFrom
(
$data
);
}
parent
::
__construct
(
$config
);
}
/**
...
...
framework/base/Event.php
View file @
b7a7800f
...
...
@@ -49,10 +49,12 @@ class Event extends \yii\base\Object
*
* @param mixed $sender sender of the event
* @param mixed $data extra data associated with the event
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$sender
=
null
,
$data
=
null
)
public
function
__construct
(
$sender
=
null
,
$data
=
null
,
$config
=
array
()
)
{
$this
->
sender
=
$sender
;
$this
->
data
=
$data
;
parent
::
__construct
(
$config
);
}
}
framework/base/Model.php
View file @
b7a7800f
...
...
@@ -54,10 +54,12 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess
/**
* Constructor.
* @param string|null $scenario name of the [[scenario]] that this model is used in.
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$scenario
=
null
)
public
function
__construct
(
$scenario
=
null
,
$config
=
array
()
)
{
$this
->
_scenario
=
$scenario
;
parent
::
__construct
(
$config
);
}
/**
...
...
framework/base/Module.php
View file @
b7a7800f
...
...
@@ -108,11 +108,13 @@ abstract class Module extends Component
* Constructor.
* @param string $id the ID of this module
* @param Module $parent the parent module (if any)
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$id
,
$parent
=
null
)
public
function
__construct
(
$id
,
$parent
=
null
,
$config
=
array
()
)
{
$this
->
id
=
$id
;
$this
->
module
=
$parent
;
parent
::
__construct
(
$config
);
}
/**
...
...
framework/base/Request.php
View file @
b7a7800f
...
...
@@ -24,7 +24,7 @@ class Request extends ApplicationComponent
*/
public
function
getIsConsoleRequest
()
{
return
isset
(
$this
->
_isConsoleRequest
)
?
$this
->
_isConsoleRequest
:
PHP_SAPI
===
'cli'
;
return
$this
->
_isConsoleRequest
!==
null
?
$this
->
_isConsoleRequest
:
PHP_SAPI
===
'cli'
;
}
/**
...
...
framework/base/Response.php
View file @
b7a7800f
<?php
/**
* Response
and CCookieCollection
class file.
* Response class file.
*
* @link http://www.yiiframework.com/
* @copyright Copyright © 2008-2012 Yii Software LLC
...
...
@@ -10,11 +10,42 @@
namespace
yii\base
;
/**
* Response encapsulates the $_SERVER variable and resolves its inconsistency among different Web servers.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class
Response
extends
ApplicationComponent
{
public
function
beginOutput
()
{
ob_start
();
ob_implicit_flush
(
false
);
}
public
function
endOutput
()
{
return
ob_get_clean
();
}
public
function
getOutput
()
{
return
ob_get_contents
();
}
public
function
cleanOutput
()
{
ob_clean
();
}
public
function
removeOutput
(
$all
=
true
)
{
if
(
$all
)
{
for
(
$level
=
ob_get_level
();
$level
>
0
;
--
$level
)
{
if
(
!@
ob_end_clean
())
{
ob_clean
();
}
}
}
else
{
ob_end_clean
();
}
}
}
framework/base/Vector.php
View file @
b7a7800f
...
...
@@ -55,13 +55,15 @@ class Vector extends Object implements \IteratorAggregate, \ArrayAccess, \Counta
* Initializes the vector with an array or an iterable object.
* @param mixed $data the initial data to be populated into the vector.
* This can be an array or an iterable object.
* @param array $config name-value pairs that will be used to initialize the object properties
* @throws Exception if data is not well formed (neither an array nor an iterable object)
*/
public
function
__construct
(
$data
=
array
())
public
function
__construct
(
$data
=
array
()
,
$config
=
array
()
)
{
if
(
$data
!==
array
())
{
$this
->
copyFrom
(
$data
);
}
parent
::
__construct
(
$config
);
}
/**
...
...
framework/base/View.php
View file @
b7a7800f
...
...
@@ -63,10 +63,12 @@ class View extends Component
/**
* Constructor.
* @param Controller|Widget|Object $context the context under which this view is being rendered (e.g. controller, widget)
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$context
=
null
)
public
function
__construct
(
$context
=
null
,
$config
=
array
()
)
{
$this
->
context
=
$context
;
parent
::
__construct
(
$config
);
}
public
function
render
(
$view
,
$params
=
array
())
...
...
framework/base/Widget.php
View file @
b7a7800f
...
...
@@ -33,10 +33,12 @@ class Widget extends Component
/**
* Constructor.
* @param Widget|Controller $owner owner/creator of this widget.
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$owner
)
public
function
__construct
(
$owner
,
$config
=
array
()
)
{
$this
->
owner
=
$owner
;
parent
::
__construct
(
$config
);
}
/**
...
...
framework/caching/ChainedDependency.php
View file @
b7a7800f
...
...
@@ -42,10 +42,12 @@ class ChainedDependency extends Dependency
* @param array $dependencies list of dependencies that this dependency is composed of.
* Each array element should be a dependency object or a configuration array
* that can be used to create a dependency object via [[\Yii::createObject()]].
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$dependencies
=
array
())
public
function
__construct
(
$dependencies
=
array
()
,
$config
=
array
()
)
{
$this
->
dependencies
=
$dependencies
;
parent
::
__construct
(
$config
);
}
/**
...
...
framework/caching/DbDependency.php
View file @
b7a7800f
...
...
@@ -41,10 +41,12 @@ class DbDependency extends Dependency
/**
* Constructor.
* @param Query $query the SQL query whose result is used to determine if the dependency has been changed.
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$query
=
null
)
public
function
__construct
(
$query
=
null
,
$config
=
array
()
)
{
$this
->
query
=
$query
;
parent
::
__construct
(
$config
);
}
/**
...
...
framework/caching/ExpressionDependency.php
View file @
b7a7800f
...
...
@@ -29,10 +29,12 @@ class ExpressionDependency extends Dependency
/**
* Constructor.
* @param string $expression the PHP expression whose result is used to determine the dependency.
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$expression
=
'true'
)
public
function
__construct
(
$expression
=
'true'
,
$config
=
array
()
)
{
$this
->
expression
=
$expression
;
parent
::
__construct
(
$config
);
}
/**
...
...
framework/caching/FileDependency.php
View file @
b7a7800f
...
...
@@ -29,10 +29,12 @@ class FileDependency extends Dependency
/**
* Constructor.
* @param string $fileName name of the file whose change is to be checked.
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$fileName
=
null
)
public
function
__construct
(
$fileName
=
null
,
$config
=
array
()
)
{
$this
->
fileName
=
$fileName
;
parent
::
__construct
(
$config
);
}
/**
...
...
framework/console/Application.php
View file @
b7a7800f
...
...
@@ -135,4 +135,21 @@ class Application extends \yii\base\Application
'app'
=>
'yii\console\controllers\AppController'
,
);
}
/**
* Registers the core application components.
* @see setComponents
*/
public
function
registerCoreComponents
()
{
parent
::
registerCoreComponents
();
$this
->
setComponents
(
array
(
'request'
=>
array
(
'class'
=>
'yii\console\Request'
,
),
'response'
=>
array
(
'class'
=>
'yii\console\Response'
,
),
));
}
}
framework/console/Request.php
View file @
b7a7800f
...
...
@@ -13,7 +13,7 @@ namespace yii\console;
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class
Request
extends
\yii\base\
ApplicationComponen
t
class
Request
extends
\yii\base\
Reques
t
{
/**
* @var string the controller route specified by this request. If this is an empty string,
...
...
framework/db/ar/ActiveFinder.php
View file @
b7a7800f
...
...
@@ -30,9 +30,10 @@ class ActiveFinder extends \yii\base\Object
*/
public
$connection
;
public
function
__construct
(
$connection
)
public
function
__construct
(
$connection
,
$config
=
array
()
)
{
$this
->
connection
=
$connection
;
parent
::
__construct
(
$config
);
}
/**
...
...
framework/db/ar/ActiveQuery.php
View file @
b7a7800f
...
...
@@ -38,10 +38,12 @@ class ActiveQuery extends BaseActiveQuery implements \IteratorAggregate, \ArrayA
/**
* @param string $modelClass the name of the ActiveRecord class.
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$modelClass
)
public
function
__construct
(
$modelClass
,
$config
=
array
()
)
{
$this
->
modelClass
=
$modelClass
;
parent
::
__construct
(
$config
);
}
public
function
__call
(
$name
,
$params
)
...
...
framework/db/ar/ActiveQueryBuilder.php
View file @
b7a7800f
...
...
@@ -26,9 +26,10 @@ class ActiveQueryBuilder extends \yii\base\Object
*/
public
$query
;
public
function
__construct
(
$query
)
public
function
__construct
(
$query
,
$config
=
array
()
)
{
$this
->
query
=
$query
;
parent
::
__construct
(
$config
);
}
public
function
build
()
...
...
framework/db/ar/JoinElement.php
View file @
b7a7800f
...
...
@@ -15,7 +15,7 @@ use yii\db\dao\Query;
use
yii\db\Exception
;
class
JoinElement
extends
\yii\base\Object
class
JoinElement
{
/**
* @var integer ID of this join element
...
...
framework/db/dao/Command.php
View file @
b7a7800f
...
...
@@ -66,12 +66,14 @@ class Command extends \yii\base\Component
* @param Connection $connection the database connection
* @param string $sql the SQL statement to be executed
* @param array $params the parameters to be bound to the SQL statement
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$connection
,
$sql
=
null
,
$params
=
array
())
public
function
__construct
(
$connection
,
$sql
=
null
,
$params
=
array
()
,
$config
=
array
()
)
{
$this
->
connection
=
$connection
;
$this
->
_sql
=
$sql
;
$this
->
bindValues
(
$params
);
parent
::
__construct
(
$config
);
}
/**
...
...
framework/db/dao/DataReader.php
View file @
b7a7800f
...
...
@@ -52,11 +52,13 @@ class DataReader extends \yii\base\Object implements \Iterator, \Countable
/**
* Constructor.
* @param Command $command the command generating the query result
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
Command
$command
)
public
function
__construct
(
Command
$command
,
$config
=
array
()
)
{
$this
->
_statement
=
$command
->
pdoStatement
;
$this
->
_statement
->
setFetchMode
(
\PDO
::
FETCH_ASSOC
);
parent
::
__construct
(
$config
);
}
/**
...
...
framework/db/dao/Driver.php
View file @
b7a7800f
...
...
@@ -71,10 +71,12 @@ abstract class Driver extends \yii\base\Object
/**
* Constructor.
* @param Connection $connection database connection.
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$connection
)
public
function
__construct
(
$connection
,
$config
=
array
()
)
{
$this
->
connection
=
$connection
;
parent
::
__construct
(
$config
);
}
/**
...
...
framework/db/dao/Expression.php
View file @
b7a7800f
...
...
@@ -42,11 +42,13 @@ class Expression extends \yii\base\Object
* Constructor.
* @param string $expression the DB expression
* @param array $params parameters
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$expression
,
$params
=
array
())
public
function
__construct
(
$expression
,
$params
=
array
()
,
$config
=
array
()
)
{
$this
->
expression
=
$expression
;
$this
->
params
=
$params
;
parent
::
__construct
(
$config
);
}
/**
...
...
framework/db/dao/QueryBuilder.php
View file @
b7a7800f
...
...
@@ -49,10 +49,12 @@ class QueryBuilder extends \yii\base\Object
/**
* Constructor.
* @param Connection $connection the database connection.
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public
function
__construct
(
$connection
)
public
function
__construct
(
$connection
,
$config
=
array
()
)
{
$this
->
connection
=
$connection
;
parent
::
__construct
(
$config
);
}
/**
...
...
framework/db/dao/Transaction.php
View file @
b7a7800f
...
...
@@ -49,12 +49,14 @@ class Transaction extends \yii\base\Object
/**
* Constructor.
* @param Connection $connection the connection associated with this transaction
* @param array $config name-value pairs that will be used to initialize the object properties
* @see Connection::beginTransaction
*/
public
function
__construct
(
$connection
)
public
function
__construct
(
$connection
,
$config
=
array
()
)
{
$this
->
active
=
true
;
$this
->
connection
=
$connection
;
parent
::
__construct
(
$config
);
}
/**
...
...
framework/web/Application.php
View file @
b7a7800f
...
...
@@ -31,4 +31,24 @@ class Application extends \yii\base\Application
{
return
array
();
}
/**
* Registers the core application components.
* @see setComponents
*/
public
function
registerCoreComponents
()
{
parent
::
registerCoreComponents
();
$this
->
setComponents
(
array
(
'urlManager'
=>
array
(
'class'
=>
'yii\web\UrlManager'
,
),
'request'
=>
array
(
'class'
=>
'yii\web\Request'
,
),
'response'
=>
array
(
'class'
=>
'yii\web\Response'
,
),
));
}
}
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