This repository was archived by the owner on Jul 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 11{
2- "name" : " superbalist /laravel-google-cloud-storage" ,
2+ "name" : " superchairon /laravel-google-cloud-storage" ,
33 "description" : " A Google Cloud Storage filesystem for Laravel" ,
44 "license" : " MIT" ,
55 "authors" : [
Original file line number Diff line number Diff line change @@ -84,21 +84,24 @@ public function boot()
8484 */
8585 private function createClient ($ config )
8686 {
87- $ keyFile = array_get ($ config , 'key_file ' );
88- if (is_string ($ keyFile )) {
89- return new StorageClient ([
90- 'projectId ' => $ config ['project_id ' ],
91- 'keyFilePath ' => $ keyFile ,
92- ]);
87+ $ options = [];
88+ if (isset ($ config ['project_id ' ])) {
89+ $ options ['projectId ' ] = $ config ['project_id ' ];
9390 }
9491
95- if (! is_array ($ keyFile )) {
96- $ keyFile = [];
92+ if (isset ($ config ['key_file ' ])) {
93+ $ keyFile = array_get ($ config , 'key_file ' );
94+ if (is_string ($ keyFile )) {
95+ $ options ['keyFilePath ' ] = $ keyFile ;
96+ } else {
97+ if (! is_array ($ keyFile )) {
98+ $ keyFile = [];
99+ }
100+ $ options ['keyFile ' ] = array_merge (["project_id " => $ config ['project_id ' ]], $ keyFile );
101+ }
97102 }
98- return new StorageClient ([
99- 'projectId ' => $ config ['project_id ' ],
100- 'keyFile ' => array_merge (["project_id " => $ config ['project_id ' ]], $ keyFile )
101- ]);
103+
104+ return new StorageClient ($ options );
102105 }
103106
104107 /**
You can’t perform that action at this time.
0 commit comments