Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
ea8d80d6
Commit
ea8d80d6
authored
Mar 21, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #371 from daylerees/patch-1
Allow File::cpdir() to return false on failure.
parents
41e066e2
2c4d35e6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
laravel/file.php
+6
-4
No files found.
laravel/file.php
View file @
ea8d80d6
...
...
@@ -183,7 +183,7 @@ class File {
*/
public
static
function
mvdir
(
$source
,
$destination
,
$options
=
fIterator
::
SKIP_DOTS
)
{
static
::
cpdir
(
$source
,
$destination
,
true
,
$options
);
return
static
::
cpdir
(
$source
,
$destination
,
true
,
$options
);
}
/**
...
...
@@ -197,7 +197,7 @@ class File {
*/
public
static
function
cpdir
(
$source
,
$destination
,
$delete
=
false
,
$options
=
fIterator
::
SKIP_DOTS
)
{
if
(
!
is_dir
(
$source
))
return
;
if
(
!
is_dir
(
$source
))
return
false
;
// First we need to create the destination directory if it doesn't
// already exists. This directory hosts all of the assets we copy
...
...
@@ -221,7 +221,7 @@ class File {
{
$path
=
$item
->
getRealPath
();
static
::
cpdir
(
$path
,
$location
,
$delete
,
$options
)
;
if
(
!
static
::
cpdir
(
$path
,
$location
,
$delete
,
$options
))
return
false
;
if
(
$delete
)
@
rmdir
(
$item
->
getRealPath
());
}
...
...
@@ -231,13 +231,15 @@ class File {
// files with the same name.
else
{
copy
(
$item
->
getRealPath
(),
$location
)
;
if
(
!
copy
(
$item
->
getRealPath
(),
$location
))
return
false
;
if
(
$delete
)
@
unlink
(
$item
->
getRealPath
());
}
}
if
(
$delete
)
rmdir
(
$source
);
return
true
;
}
/**
...
...
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