-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1.x] Fix Symfony uploaded file moving (#317)
* fix(symfony): uploaded files moving * make clear
- Loading branch information
1 parent
411cef2
commit 5b5ac48
Showing
5 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
// https://github.com/spiral/roadrunner-laravel/issues/43 | ||
|
||
namespace Symfony\Component\HttpFoundation\File; | ||
|
||
function move_uploaded_file($from, $to) | ||
{ | ||
return \is_file($from) && \rename($from, $to); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Laravel\Octane\Listeners; | ||
|
||
class EnsureUploadedFilesCanBeMoved | ||
{ | ||
/** | ||
* Handle the event. | ||
* | ||
* @link https://github.com/spiral/roadrunner-laravel/issues/43 | ||
* | ||
* @param mixed $event | ||
* @return void | ||
*/ | ||
public function handle($event): void | ||
{ | ||
if (! function_exists('\\Symfony\\Component\\HttpFoundation\\File\\move_uploaded_file')) { | ||
require __DIR__.'/../../fixes/fix-symfony-file-moving.php'; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters