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
40a005d5
Commit
40a005d5
authored
Jun 10, 2013
by
Klimov Paul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"yii\helpers\StringHelper" usage has been added to "yii\helpers\base\FileHelper".
parent
7697f215
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
FileHelper.php
framework/yii/helpers/base/FileHelper.php
+5
-3
No files found.
framework/yii/helpers/base/FileHelper.php
View file @
40a005d5
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
namespace
yii\helpers\base
;
namespace
yii\helpers\base
;
use
Yii
;
use
Yii
;
use
yii\helpers\StringHelper
;
/**
/**
* Filesystem helper
* Filesystem helper
...
@@ -66,7 +67,7 @@ class FileHelper
...
@@ -66,7 +67,7 @@ class FileHelper
if
(
$language
===
$sourceLanguage
)
{
if
(
$language
===
$sourceLanguage
)
{
return
$file
;
return
$file
;
}
}
$desiredFile
=
dirname
(
$file
)
.
DIRECTORY_SEPARATOR
.
$sourceLanguage
.
DIRECTORY_SEPARATOR
.
basename
(
$file
);
$desiredFile
=
dirname
(
$file
)
.
DIRECTORY_SEPARATOR
.
$sourceLanguage
.
DIRECTORY_SEPARATOR
.
StringHelper
::
basename
(
$file
);
return
is_file
(
$desiredFile
)
?
$desiredFile
:
$file
;
return
is_file
(
$desiredFile
)
?
$desiredFile
:
$file
;
}
}
...
@@ -178,10 +179,11 @@ class FileHelper
...
@@ -178,10 +179,11 @@ class FileHelper
{
{
$items
=
glob
(
$dir
.
DIRECTORY_SEPARATOR
.
'{,.}*'
,
GLOB_MARK
|
GLOB_BRACE
);
$items
=
glob
(
$dir
.
DIRECTORY_SEPARATOR
.
'{,.}*'
,
GLOB_MARK
|
GLOB_BRACE
);
foreach
(
$items
as
$item
)
{
foreach
(
$items
as
$item
)
{
if
(
basename
(
$item
)
==
'.'
||
basename
(
$item
)
==
'..'
)
{
$itemBaseName
=
StringHelper
::
basename
(
$item
);
if
(
$itemBaseName
===
'.'
||
$itemBaseName
===
'..'
)
{
continue
;
continue
;
}
}
if
(
substr
(
$item
,
-
1
)
==
DIRECTORY_SEPARATOR
)
{
if
(
StringHelper
::
substr
(
$item
,
-
1
,
1
)
==
DIRECTORY_SEPARATOR
)
{
static
::
removeDirectory
(
$item
);
static
::
removeDirectory
(
$item
);
}
else
{
}
else
{
unlink
(
$item
);
unlink
(
$item
);
...
...
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