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
60259241
Commit
60259241
authored
Oct 18, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #996.
parent
86ceee52
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
23 deletions
+9
-23
AssetController.php
framework/yii/console/controllers/AssetController.php
+0
-16
AssetBundle.php
framework/yii/web/AssetBundle.php
+0
-2
AssetManager.php
framework/yii/web/AssetManager.php
+9
-5
No files found.
framework/yii/console/controllers/AssetController.php
View file @
60259241
...
...
@@ -136,7 +136,6 @@ class AssetController extends Controller
$this
->
loadConfiguration
(
$configFile
);
$bundles
=
$this
->
loadBundles
(
$this
->
bundles
);
$targets
=
$this
->
loadTargets
(
$this
->
targets
,
$bundles
);
$this
->
publishBundles
(
$bundles
,
$this
->
assetManager
);
$timestamp
=
time
();
foreach
(
$targets
as
$name
=>
$target
)
{
echo
"Creating output bundle '
{
$name
}
':
\n
"
;
...
...
@@ -276,21 +275,6 @@ class AssetController extends Controller
}
/**
* Publishes given asset bundles.
* @param \yii\web\AssetBundle[] $bundles asset bundles to be published.
*/
protected
function
publishBundles
(
$bundles
)
{
echo
"
\n
Publishing bundles:
\n
"
;
$assetManager
=
$this
->
getAssetManager
();
foreach
(
$bundles
as
$name
=>
$bundle
)
{
$bundle
->
publish
(
$assetManager
);
echo
" '"
.
$name
.
"' published.
\n
"
;
}
echo
"
\n
"
;
}
/**
* Builds output asset bundle.
* @param \yii\web\AssetBundle $target output asset bundle
* @param string $type either 'js' or 'css'.
...
...
framework/yii/web/AssetBundle.php
View file @
60259241
...
...
@@ -138,8 +138,6 @@ class AssetBundle extends Object
*/
public
function
registerAssets
(
$view
)
{
$this
->
publish
(
$view
->
getAssetManager
());
foreach
(
$this
->
js
as
$js
)
{
$view
->
registerJsFile
(
$this
->
baseUrl
.
'/'
.
$js
,
$this
->
jsOptions
);
}
...
...
framework/yii/web/AssetManager.php
View file @
60259241
...
...
@@ -101,15 +101,19 @@ class AssetManager extends Component
public
function
getBundle
(
$name
)
{
if
(
isset
(
$this
->
bundles
[
$name
]))
{
if
(
is_array
(
$this
->
bundles
[
$name
]))
{
$this
->
bundles
[
$name
]
=
Yii
::
createObject
(
array_merge
(
array
(
'class'
=>
$name
),
$this
->
bundles
[
$name
]));
}
elseif
(
!
$this
->
bundles
[
$name
]
instanceof
AssetBundle
)
{
if
(
$this
->
bundles
[
$name
]
instanceof
AssetBundle
)
{
return
$this
->
bundles
[
$name
];
}
elseif
(
is_array
(
$this
->
bundles
[
$name
]))
{
$bundle
=
Yii
::
createObject
(
array_merge
(
array
(
'class'
=>
$name
),
$this
->
bundles
[
$name
]));
}
else
{
throw
new
InvalidConfigException
(
"Invalid asset bundle:
$name
"
);
}
}
else
{
$
this
->
bundles
[
$name
]
=
Yii
::
createObject
(
$name
);
$
bundle
=
Yii
::
createObject
(
$name
);
}
return
$this
->
bundles
[
$name
];
/** @var AssetBundle $bundle */
$bundle
->
publish
(
$this
);
return
$this
->
bundles
[
$name
]
=
$bundle
;
}
private
$_converter
;
...
...
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