@@ -19,7 +19,7 @@ |
||
19 | 19 | /* |
20 | 20 | * Authenticate the user's personal channel... |
21 | 21 | */ |
22 | - Broadcast::channel('Colligator.User.{userId}', function ($user, $userId) { |
|
22 | + Broadcast::channel('Colligator.User.{userId}', function($user, $userId) { |
|
23 | 23 | return (int) $user->id === (int) $userId; |
24 | 24 | }); |
25 | 25 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | Route::group([ |
42 | 42 | 'middleware' => 'web', |
43 | 43 | 'namespace' => $this->namespace, |
44 | - ], function () { |
|
44 | + ], function() { |
|
45 | 45 | require base_path('routes/web.php'); |
46 | 46 | }); |
47 | 47 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | 'middleware' => 'api', |
59 | 59 | 'namespace' => $this->namespace, |
60 | 60 | // 'prefix' => 'api', |
61 | - ], function () { |
|
61 | + ], function() { |
|
62 | 62 | require base_path('routes/api.php'); |
63 | 63 | }); |
64 | 64 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $this->comment('Available configurations:'); |
49 | 49 | $config = \Config::get('oaipmh.harvests', null); |
50 | 50 | foreach (array_keys($config) as $key) { |
51 | - $this->comment(' - ' . $key); |
|
51 | + $this->comment(' - '.$key); |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | return false; |
61 | 61 | } |
62 | - $harvestConfig = \Config::get('oaipmh.harvests.' . $this->argument('name'), null); |
|
62 | + $harvestConfig = \Config::get('oaipmh.harvests.'.$this->argument('name'), null); |
|
63 | 63 | if (is_null($harvestConfig)) { |
64 | 64 | $this->error('Unknown configuration specified.'); |
65 | 65 | $this->listConfigurations(); |
@@ -108,16 +108,16 @@ discard block |
||
108 | 108 | } |
109 | 109 | |
110 | 110 | $harvestName = $this->argument('name'); |
111 | - $harvestConfig = \Config::get('oaipmh.harvests.' . $harvestName, null); |
|
111 | + $harvestConfig = \Config::get('oaipmh.harvests.'.$harvestName, null); |
|
112 | 112 | |
113 | 113 | $this->comment(sprintf('Dispatching new harvest job')); |
114 | 114 | |
115 | 115 | if ($this->option('from-dump')) { |
116 | 116 | $this->comment(' - From local dump'); |
117 | 117 | } else { |
118 | - $this->comment(' - Repo: ' . $harvestConfig['url']); |
|
119 | - $this->comment(' - Schema: ' . $harvestConfig['schema']); |
|
120 | - $this->comment(' - Set: ' . $harvestConfig['set']); |
|
118 | + $this->comment(' - Repo: '.$harvestConfig['url']); |
|
119 | + $this->comment(' - Schema: '.$harvestConfig['schema']); |
|
120 | + $this->comment(' - Set: '.$harvestConfig['set']); |
|
121 | 121 | |
122 | 122 | foreach (['from', 'until', 'resume', 'daily'] as $key) { |
123 | 123 | if (!is_null($this->option($key))) { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function fromDump() |
90 | 90 | { |
91 | - $files = Storage::disk('local')->files('harvests/' . $this->name); |
|
91 | + $files = Storage::disk('local')->files('harvests/'.$this->name); |
|
92 | 92 | $recordsHarvested = 0; |
93 | 93 | foreach ($files as $filename) { |
94 | 94 | if (!preg_match('/.xml$/', $filename)) { |
@@ -111,11 +111,11 @@ discard block |
||
111 | 111 | |
112 | 112 | public function fromNetwork() |
113 | 113 | { |
114 | - $dest_path = 'harvests/' . $this->name . '/'; |
|
114 | + $dest_path = 'harvests/'.$this->name.'/'; |
|
115 | 115 | |
116 | 116 | Storage::disk('local')->deleteDir($dest_path); |
117 | 117 | |
118 | - $latest = $dest_path . 'latest.xml'; |
|
118 | + $latest = $dest_path.'latest.xml'; |
|
119 | 119 | |
120 | 120 | $client = new OaiPmhClient($this->url, [ |
121 | 121 | 'schema' => $this->schema, |
@@ -124,12 +124,12 @@ discard block |
||
124 | 124 | 'sleep-time-on-error' => $this->sleepTimeOnError, |
125 | 125 | ]); |
126 | 126 | |
127 | - $client->on('request.error', function ($msg) { |
|
127 | + $client->on('request.error', function($msg) { |
|
128 | 128 | $this->error($msg); |
129 | 129 | }); |
130 | 130 | |
131 | 131 | // Store each response to disk just in case |
132 | - $client->on('request.complete', function ($verb, $args, $body) use ($latest) { |
|
132 | + $client->on('request.complete', function($verb, $args, $body) use ($latest) { |
|
133 | 133 | Storage::disk('local')->put($latest, $body); |
134 | 134 | }); |
135 | 135 | |
@@ -153,9 +153,9 @@ discard block |
||
153 | 153 | if ($this->resume != $records->getResumptionToken()) { |
154 | 154 | $this->resume = $records->getResumptionToken(); |
155 | 155 | if (is_null($this->resume)) { |
156 | - Storage::disk('local')->delete($dest_path . '/resumption_token'); |
|
156 | + Storage::disk('local')->delete($dest_path.'/resumption_token'); |
|
157 | 157 | } else { |
158 | - Storage::disk('local')->put($dest_path . '/resumption_token', $this->resume); |
|
158 | + Storage::disk('local')->put($dest_path.'/resumption_token', $this->resume); |
|
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | } catch (BadRequestError $e) { |
189 | 189 | $this->error($e->getMessage()); |
190 | 190 | $this->error($e->getCode()); |
191 | - $this->error('Bad request. Attempt ' . $attempt . ' of 100. Sleeping 10 secs.'); |
|
191 | + $this->error('Bad request. Attempt '.$attempt.' of 100. Sleeping 10 secs.'); |
|
192 | 192 | if ($attempt > 100) { |
193 | 193 | throw $e; |
194 | 194 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function handle() |
211 | 211 | { |
212 | - Log::info('[OaiPmhHarvest] Starting job. Requesting records from ' . ($this->start ?: '(no limit)') . ' until ' . ($this->until ?: '(no limit)') . '.'); |
|
212 | + Log::info('[OaiPmhHarvest] Starting job. Requesting records from '.($this->start ?: '(no limit)').' until '.($this->until ?: '(no limit)').'.'); |
|
213 | 213 | |
214 | 214 | // For timing |
215 | 215 | $this->startTime = $this->batchTime = microtime(true) - 1; |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | $recordsHarvested = $this->fromNetwork(); |
228 | 228 | } |
229 | 229 | |
230 | - Log::info('[OaiPmhHarvest] Harvest complete, got ' . $recordsHarvested . ' records.'); |
|
230 | + Log::info('[OaiPmhHarvest] Harvest complete, got '.$recordsHarvested.' records.'); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | /** |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | $rec = MarcRecord::fromString($q); |
58 | 58 | |
59 | 59 | $itemMap = [ |
60 | - 'x' => 'location', // OBS: 1030310 |
|
61 | - 'y' => 'shelvinglocation', // OBS: k00475 |
|
60 | + 'x' => 'location', // OBS: 1030310 |
|
61 | + 'y' => 'shelvinglocation', // OBS: k00475 |
|
62 | 62 | 'b' => 'barcode', |
63 | 63 | 'z' => 'callcode', |
64 | 64 | 'a' => 'id', |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | try { |
191 | 191 | $doc->storeCover($biblio['cover_image']); |
192 | 192 | } catch (\ErrorException $e) { |
193 | - \Log::error('Failed to store cover: ' . $biblio['cover_image']); |
|
193 | + \Log::error('Failed to store cover: '.$biblio['cover_image']); |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | |
@@ -207,14 +207,14 @@ discard block |
||
207 | 207 | try { |
208 | 208 | list($biblio, $holdings) = $this->parseRecord($record); |
209 | 209 | } catch (ParserException $e) { |
210 | - $this->error('Failed to parse MARC record. Error "' . $e->getMessage() . '" in: ' . $e->getFile() . ':' . $e->getLine() . "\nStack trace:\n" . $e->getTraceAsString()); |
|
210 | + $this->error('Failed to parse MARC record. Error "'.$e->getMessage().'" in: '.$e->getFile().':'.$e->getLine()."\nStack trace:\n".$e->getTraceAsString()); |
|
211 | 211 | |
212 | 212 | return null; |
213 | 213 | } |
214 | 214 | |
215 | 215 | $doc = $this->importParsedRecord($biblio, $holdings); |
216 | 216 | |
217 | - \Log::debug('[Marc21Importer] Imported ' . $doc->bibsys_id . ' as ' . $doc->id); |
|
217 | + \Log::debug('[Marc21Importer] Imported '.$doc->bibsys_id.' as '.$doc->id); |
|
218 | 218 | |
219 | 219 | if (!is_null($doc)) { |
220 | 220 | Event::fire(new Marc21RecordImported($doc->id)); |