Commit 5b5ac48 1 parent 411cef2 commit 5b5ac48 Copy full SHA for 5b5ac48
File tree 5 files changed +36
-0
lines changed
5 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## [ Unreleased] ( https://github.com/laravel/octane/compare/v1.0.4...1.x )
4
4
5
+ ### Fixed
6
+ - Uploaded files moving ([ #317 ] ( https://github.com/laravel/octane/pull/317 ) )
5
7
6
8
## [ v1.0.4 (2021-06-08)] ( https://github.com/laravel/octane/compare/v1.0.3...v1.0.4 )
7
9
Original file line number Diff line number Diff line change 14
14
use Laravel \Octane \Listeners \CollectGarbage ;
15
15
use Laravel \Octane \Listeners \DisconnectFromDatabases ;
16
16
use Laravel \Octane \Listeners \EnsureUploadedFilesAreValid ;
17
+ use Laravel \Octane \Listeners \EnsureUploadedFilesCanBeMoved ;
17
18
use Laravel \Octane \Listeners \FlushTemporaryContainerInstances ;
18
19
use Laravel \Octane \Listeners \ReportException ;
19
20
use Laravel \Octane \Listeners \StopWorkerIfNecessary ;
63
64
'listeners ' => [
64
65
WorkerStarting::class => [
65
66
EnsureUploadedFilesAreValid::class,
67
+ EnsureUploadedFilesCanBeMoved::class,
66
68
],
67
69
68
70
RequestReceived::class => [
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ // https://github.com/spiral/roadrunner-laravel/issues/43
4
+
5
+ namespace Symfony \Component \HttpFoundation \File ;
6
+
7
+ function move_uploaded_file ($ from , $ to )
8
+ {
9
+ return \is_file ($ from ) && \rename ($ from , $ to );
10
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Laravel \Octane \Listeners ;
4
+
5
+ class EnsureUploadedFilesCanBeMoved
6
+ {
7
+ /**
8
+ * Handle the event.
9
+ *
10
+ * @link https://github.com/spiral/roadrunner-laravel/issues/43
11
+ *
12
+ * @param mixed $event
13
+ * @return void
14
+ */
15
+ public function handle ($ event ): void
16
+ {
17
+ if (! function_exists ('\\Symfony \\Component \\HttpFoundation \\File \\move_uploaded_file ' )) {
18
+ require __DIR__ .'/../../fixes/fix-symfony-file-moving.php ' ;
19
+ }
20
+ }
21
+ }
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ protected function bindListeners()
112
112
$ this ->app ->singleton (Listeners \EnforceRequestScheme::class);
113
113
$ this ->app ->singleton (Listeners \EnsureRequestServerPortMatchesScheme::class);
114
114
$ this ->app ->singleton (Listeners \EnsureUploadedFilesAreValid::class);
115
+ $ this ->app ->singleton (Listeners \EnsureUploadedFilesCanBeMoved::class);
115
116
$ this ->app ->singleton (Listeners \FlushAuthenticationState::class);
116
117
$ this ->app ->singleton (Listeners \FlushQueuedCookies::class);
117
118
$ this ->app ->singleton (Listeners \FlushSessionState::class);
You can’t perform that action at this time.
0 commit comments