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
9636b0fc
Commit
9636b0fc
authored
Oct 22, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed Yii::importNamespaces() in favor of the new yii extension installer.
parent
de59556d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
27 deletions
+0
-27
BaseYii.php
framework/yii/BaseYii.php
+0
-27
No files found.
framework/yii/BaseYii.php
View file @
9636b0fc
...
...
@@ -110,33 +110,6 @@ class BaseYii
}
/**
* Imports a set of namespaces.
*
* By importing a namespace, the method will create an alias for the directory corresponding
* to the namespace. For example, if "foo\bar" is a namespace associated with the directory
* "path/to/foo/bar", then an alias "@foo/bar" will be created for this directory.
*
* This method is typically invoked in the bootstrap file to import the namespaces of
* the installed extensions. By default, Composer, when installing new extensions, will
* generate such a mapping file which can be loaded and passed to this method.
*
* @param array $namespaces the namespaces to be imported. The keys are the namespaces,
* and the values are the corresponding directories.
*/
public
static
function
importNamespaces
(
$namespaces
)
{
foreach
(
$namespaces
as
$name
=>
$path
)
{
if
(
$name
!==
''
)
{
$name
=
trim
(
strtr
(
$name
,
[
'\\'
=>
'/'
,
'_'
=>
'/'
]),
'/'
);
if
(
is_array
(
$path
))
{
$path
=
reset
(
$path
);
}
static
::
setAlias
(
'@'
.
$name
,
rtrim
(
$path
,
'/\\'
)
.
'/'
.
$name
);
}
}
}
/**
* Translates a path alias into an actual path.
*
* The translation is done according to the following procedure:
...
...
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