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
ea108688
Commit
ea108688
authored
Sep 01, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed Yii::import().
parent
7a6ce825
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
42 deletions
+3
-42
YiiBase.php
framework/yii/YiiBase.php
+0
-39
ExistValidator.php
framework/yii/validators/ExistValidator.php
+1
-1
UniqueValidator.php
framework/yii/validators/UniqueValidator.php
+1
-1
User.php
framework/yii/web/User.php
+1
-1
No files found.
framework/yii/YiiBase.php
View file @
ea108688
...
@@ -100,7 +100,6 @@ class YiiBase
...
@@ -100,7 +100,6 @@ class YiiBase
*/
*/
public
static
$objectConfig
=
array
();
public
static
$objectConfig
=
array
();
private
static
$_imported
=
array
();
// alias => class name or directory
/**
/**
* @return string the version of Yii framework
* @return string the version of Yii framework
...
@@ -111,40 +110,6 @@ class YiiBase
...
@@ -111,40 +110,6 @@ class YiiBase
}
}
/**
/**
* Imports a class by its alias.
*
* This method is provided to support autoloading of non-namespaced classes.
* Such a class can be specified in terms of an alias. For example, the alias `@old/code/Sample`
* may represent the `Sample` class under the directory `@old/code` (a path alias).
*
* By importing a class, the class is put in an internal storage such that when
* the class is used for the first time, the class autoloader will be able to
* find the corresponding class file and include it. For this reason, this method
* is much lighter than `include()`.
*
* You may import the same class multiple times. Only the first importing will count.
*
* @param string $alias the class to be imported. This may be either a class alias or a fully-qualified class name.
* If the latter, it will be returned back without change.
* @return string the actual class name that `$alias` refers to
* @throws Exception if the alias is invalid
*/
public
static
function
import
(
$alias
)
{
if
(
strncmp
(
$alias
,
'@'
,
1
))
{
return
$alias
;
}
else
{
$alias
=
static
::
getAlias
(
$alias
);
if
(
!
isset
(
self
::
$_imported
[
$alias
]))
{
$className
=
basename
(
$alias
);
self
::
$_imported
[
$alias
]
=
$className
;
self
::
$classMap
[
$className
]
=
$alias
.
'.php'
;
}
return
self
::
$_imported
[
$alias
];
}
}
/**
* Imports a set of namespaces.
* Imports a set of namespaces.
*
*
* By importing a namespace, the method will create an alias for the directory corresponding
* By importing a namespace, the method will create an alias for the directory corresponding
...
@@ -431,10 +396,6 @@ class YiiBase
...
@@ -431,10 +396,6 @@ class YiiBase
throw
new
InvalidConfigException
(
'Object configuration must be an array containing a "class" element.'
);
throw
new
InvalidConfigException
(
'Object configuration must be an array containing a "class" element.'
);
}
}
if
(
!
class_exists
(
$class
,
false
))
{
$class
=
static
::
import
(
$class
);
}
$class
=
ltrim
(
$class
,
'\\'
);
$class
=
ltrim
(
$class
,
'\\'
);
if
(
isset
(
self
::
$objectConfig
[
$class
]))
{
if
(
isset
(
self
::
$objectConfig
[
$class
]))
{
...
...
framework/yii/validators/ExistValidator.php
View file @
ea108688
...
@@ -66,7 +66,7 @@ class ExistValidator extends Validator
...
@@ -66,7 +66,7 @@ class ExistValidator extends Validator
}
}
/** @var $className \yii\db\ActiveRecord */
/** @var $className \yii\db\ActiveRecord */
$className
=
$this
->
className
===
null
?
get_class
(
$object
)
:
Yii
::
import
(
$this
->
className
)
;
$className
=
$this
->
className
===
null
?
get_class
(
$object
)
:
$this
->
className
;
$attributeName
=
$this
->
attributeName
===
null
?
$attribute
:
$this
->
attributeName
;
$attributeName
=
$this
->
attributeName
===
null
?
$attribute
:
$this
->
attributeName
;
$query
=
$className
::
find
();
$query
=
$className
::
find
();
$query
->
where
(
array
(
$attributeName
=>
$value
));
$query
->
where
(
array
(
$attributeName
=>
$value
));
...
...
framework/yii/validators/UniqueValidator.php
View file @
ea108688
...
@@ -61,7 +61,7 @@ class UniqueValidator extends Validator
...
@@ -61,7 +61,7 @@ class UniqueValidator extends Validator
}
}
/** @var $className \yii\db\ActiveRecord */
/** @var $className \yii\db\ActiveRecord */
$className
=
$this
->
className
===
null
?
get_class
(
$object
)
:
Yii
::
import
(
$this
->
className
)
;
$className
=
$this
->
className
===
null
?
get_class
(
$object
)
:
$this
->
className
;
$attributeName
=
$this
->
attributeName
===
null
?
$attribute
:
$this
->
attributeName
;
$attributeName
=
$this
->
attributeName
===
null
?
$attribute
:
$this
->
attributeName
;
$table
=
$className
::
getTableSchema
();
$table
=
$className
::
getTableSchema
();
...
...
framework/yii/web/User.php
View file @
ea108688
...
@@ -140,7 +140,7 @@ class User extends Component
...
@@ -140,7 +140,7 @@ class User extends Component
$this
->
_identity
=
null
;
$this
->
_identity
=
null
;
}
else
{
}
else
{
/** @var $class Identity */
/** @var $class Identity */
$class
=
Yii
::
import
(
$this
->
identityClass
)
;
$class
=
$this
->
identityClass
;
$this
->
_identity
=
$class
::
findIdentity
(
$id
);
$this
->
_identity
=
$class
::
findIdentity
(
$id
);
}
}
}
}
...
...
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