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
f93054a4
Commit
f93054a4
authored
Jan 28, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed possible problem with realpath and false value
realpath(false) = current working directory. This can cause problems with getAlias() which returns false. see yiisoft/yii#3113
parent
208d5eac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
FixtureController.php
extensions/faker/FixtureController.php
+5
-4
Request.php
framework/base/Request.php
+2
-1
AssetManager.php
framework/web/AssetManager.php
+3
-4
No files found.
extensions/faker/FixtureController.php
View file @
f93054a4
...
...
@@ -233,8 +233,9 @@ class FixtureController extends \yii\console\controllers\FixtureController
}
$content
=
$this
->
exportFixtures
(
$fixtures
);
file_put_contents
(
$fixturePath
.
'/'
.
$fixtureFileName
,
$content
);
$this
->
stdout
(
"Fixture file was generated under: "
.
realpath
(
$fixturePath
.
"/"
.
$fixtureFileName
)
.
"
\n
"
,
Console
::
FG_GREEN
);
$filePath
=
realpath
(
$fixturePath
.
'/'
.
$fixtureFileName
);
file_put_contents
(
$filePath
,
$content
);
$this
->
stdout
(
"Fixture file was generated under:
$filePath
\n
"
,
Console
::
FG_GREEN
);
}
}
...
...
@@ -356,9 +357,9 @@ class FixtureController extends \yii\console\controllers\FixtureController
public
function
confirmGeneration
(
$files
)
{
$this
->
stdout
(
"Fixtures will be generated under the path:
\n
"
,
Console
::
FG_YELLOW
);
$this
->
stdout
(
realpath
(
Yii
::
getAlias
(
$this
->
fixturePath
,
false
))
.
"
\n\n
"
,
Console
::
FG_GREEN
);
$this
->
stdout
(
realpath
(
Yii
::
getAlias
(
$this
->
fixturePath
))
.
"
\n\n
"
,
Console
::
FG_GREEN
);
$this
->
stdout
(
"Templates will be taken from path:
\n
"
,
Console
::
FG_YELLOW
);
$this
->
stdout
(
realpath
(
Yii
::
getAlias
(
$this
->
templatePath
,
false
))
.
"
\n\n
"
,
Console
::
FG_GREEN
);
$this
->
stdout
(
realpath
(
Yii
::
getAlias
(
$this
->
templatePath
))
.
"
\n\n
"
,
Console
::
FG_GREEN
);
foreach
(
$files
as
$index
=>
$fileName
)
{
$this
->
stdout
(
" "
.
(
$index
+
1
)
.
". "
.
basename
(
$fileName
)
.
"
\n
"
,
Console
::
FG_GREEN
);
...
...
framework/base/Request.php
View file @
f93054a4
...
...
@@ -6,6 +6,7 @@
*/
namespace
yii\base
;
use
Yii
;
/**
* Request represents a request that is handled by an [[Application]].
...
...
@@ -72,7 +73,7 @@ abstract class Request extends Component
*/
public
function
setScriptFile
(
$value
)
{
$scriptFile
=
realpath
(
\
Yii
::
getAlias
(
$value
));
$scriptFile
=
realpath
(
Yii
::
getAlias
(
$value
));
if
(
$scriptFile
!==
false
&&
is_file
(
$scriptFile
))
{
$this
->
_scriptFile
=
$scriptFile
;
}
else
{
...
...
framework/web/AssetManager.php
View file @
f93054a4
...
...
@@ -227,8 +227,7 @@ class AssetManager extends Component
return
$this
->
_published
[
$path
];
}
$src
=
realpath
(
$path
);
if
(
$src
===
false
)
{
if
(
!
is_string
(
$path
)
||
(
$src
=
realpath
(
$path
))
===
false
)
{
throw
new
InvalidParamException
(
"The file or directory to be published does not exist:
$path
"
);
}
...
...
@@ -295,7 +294,7 @@ class AssetManager extends Component
if
(
isset
(
$this
->
_published
[
$path
]))
{
return
$this
->
_published
[
$path
][
0
];
}
if
((
$path
=
realpath
(
$path
))
!==
false
)
{
if
(
is_string
(
$path
)
&&
(
$path
=
realpath
(
$path
))
!==
false
)
{
$base
=
$this
->
basePath
.
DIRECTORY_SEPARATOR
;
if
(
is_file
(
$path
))
{
return
$base
.
$this
->
hash
(
dirname
(
$path
)
.
filemtime
(
$path
))
.
DIRECTORY_SEPARATOR
.
basename
(
$path
);
...
...
@@ -319,7 +318,7 @@ class AssetManager extends Component
if
(
isset
(
$this
->
_published
[
$path
]))
{
return
$this
->
_published
[
$path
][
1
];
}
if
((
$path
=
realpath
(
$path
))
!==
false
)
{
if
(
is_string
(
$path
)
&&
(
$path
=
realpath
(
$path
))
!==
false
)
{
if
(
is_file
(
$path
))
{
return
$this
->
baseUrl
.
'/'
.
$this
->
hash
(
dirname
(
$path
)
.
filemtime
(
$path
))
.
'/'
.
basename
(
$path
);
}
else
{
...
...
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