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
00f34f39
Commit
00f34f39
authored
Feb 04, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #2303: Fixed the bug that `yii\base\Theme::pathMap` did not support…
Fixes #2303: Fixed the bug that `yii\base\Theme::pathMap` did not support dynamic update with path aliases
parent
69ad9238
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
15 deletions
+11
-15
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
Theme.php
framework/base/Theme.php
+10
-15
No files found.
framework/CHANGELOG.md
View file @
00f34f39
...
@@ -41,6 +41,7 @@ Yii Framework 2 Change Log
...
@@ -41,6 +41,7 @@ Yii Framework 2 Change Log
-
Bug #2091:
`QueryBuilder::buildInCondition()`
fails to handle array not starting with index 0 (qiangxue)
-
Bug #2091:
`QueryBuilder::buildInCondition()`
fails to handle array not starting with index 0 (qiangxue)
-
Bug #2160: SphinxQL does not support OFFSET (qiangxue, romeo7)
-
Bug #2160: SphinxQL does not support OFFSET (qiangxue, romeo7)
-
Bug #2212:
`yii\gridview\DataColumn`
generates incorrect labels when used with nosql DB and there is no data (qiangxue)
-
Bug #2212:
`yii\gridview\DataColumn`
generates incorrect labels when used with nosql DB and there is no data (qiangxue)
-
Bug #2303: Fixed the bug that
`yii\base\Theme::pathMap`
did not support dynamic update with path aliases (qiangxue)
-
Bug: Fixed
`Call to a member function registerAssetFiles() on a non-object`
in case of wrong
`sourcePath`
for an asset bundle (samdark)
-
Bug: Fixed
`Call to a member function registerAssetFiles() on a non-object`
in case of wrong
`sourcePath`
for an asset bundle (samdark)
-
Bug: Fixed incorrect event name for
`yii\jui\Spinner`
(samdark)
-
Bug: Fixed incorrect event name for
`yii\jui\Spinner`
(samdark)
-
Bug: Json::encode() did not handle objects that implement JsonSerializable interface correctly (cebe)
-
Bug: Json::encode() did not handle objects that implement JsonSerializable interface correctly (cebe)
...
...
framework/base/Theme.php
View file @
00f34f39
...
@@ -93,6 +93,13 @@ class Theme extends Component
...
@@ -93,6 +93,13 @@ class Theme extends Component
public
function
init
()
public
function
init
()
{
{
parent
::
init
();
parent
::
init
();
if
(
$this
->
baseUrl
===
null
)
{
throw
new
InvalidConfigException
(
'The "baseUrl" property must be set.'
);
}
else
{
$this
->
baseUrl
=
rtrim
(
Yii
::
getAlias
(
$this
->
baseUrl
),
'/'
);
}
if
(
empty
(
$this
->
pathMap
))
{
if
(
empty
(
$this
->
pathMap
))
{
if
(
$this
->
basePath
!==
null
)
{
if
(
$this
->
basePath
!==
null
)
{
$this
->
basePath
=
Yii
::
getAlias
(
$this
->
basePath
);
$this
->
basePath
=
Yii
::
getAlias
(
$this
->
basePath
);
...
@@ -101,20 +108,6 @@ class Theme extends Component
...
@@ -101,20 +108,6 @@ class Theme extends Component
throw
new
InvalidConfigException
(
'The "basePath" property must be set.'
);
throw
new
InvalidConfigException
(
'The "basePath" property must be set.'
);
}
}
}
}
$paths
=
[];
foreach
(
$this
->
pathMap
as
$from
=>
$tos
)
{
$from
=
FileHelper
::
normalizePath
(
Yii
::
getAlias
(
$from
));
foreach
((
array
)
$tos
as
$to
)
{
$to
=
FileHelper
::
normalizePath
(
Yii
::
getAlias
(
$to
));
$paths
[
$from
.
DIRECTORY_SEPARATOR
][]
=
$to
.
DIRECTORY_SEPARATOR
;
}
}
$this
->
pathMap
=
$paths
;
if
(
$this
->
baseUrl
===
null
)
{
throw
new
InvalidConfigException
(
'The "baseUrl" property must be set.'
);
}
else
{
$this
->
baseUrl
=
rtrim
(
Yii
::
getAlias
(
$this
->
baseUrl
),
'/'
);
}
}
}
/**
/**
...
@@ -127,9 +120,11 @@ class Theme extends Component
...
@@ -127,9 +120,11 @@ class Theme extends Component
{
{
$path
=
FileHelper
::
normalizePath
(
$path
);
$path
=
FileHelper
::
normalizePath
(
$path
);
foreach
(
$this
->
pathMap
as
$from
=>
$tos
)
{
foreach
(
$this
->
pathMap
as
$from
=>
$tos
)
{
$from
=
FileHelper
::
normalizePath
(
Yii
::
getAlias
(
$from
))
.
DIRECTORY_SEPARATOR
;
if
(
strpos
(
$path
,
$from
)
===
0
)
{
if
(
strpos
(
$path
,
$from
)
===
0
)
{
$n
=
strlen
(
$from
);
$n
=
strlen
(
$from
);
foreach
(
$tos
as
$to
)
{
foreach
((
array
)
$tos
as
$to
)
{
$to
=
FileHelper
::
normalizePath
(
Yii
::
getAlias
(
$to
))
.
DIRECTORY_SEPARATOR
;
$file
=
$to
.
substr
(
$path
,
$n
);
$file
=
$to
.
substr
(
$path
,
$n
);
if
(
is_file
(
$file
))
{
if
(
is_file
(
$file
))
{
return
$file
;
return
$file
;
...
...
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