@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | if (is_null($data)) { |
| 86 | 86 | $data = $this->download($sourceUrl); |
| 87 | 87 | if (!$data) { |
| 88 | - throw new \ErrorException('[CoverCache] Failed to download ' . $sourceUrl); |
|
| 88 | + throw new \ErrorException('[CoverCache] Failed to download '.$sourceUrl); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | $img = $this->imageManager->make($data); |
| 95 | 95 | if ($maxHeight && $img->height() > $maxHeight) { |
| 96 | - \Log::debug('[CachedImage] Resizing from ' . $img->height() . ' to ' . $maxHeight); |
|
| 96 | + \Log::debug('[CachedImage] Resizing from '.$img->height().' to '.$maxHeight); |
|
| 97 | 97 | $img->heighten($maxHeight); |
| 98 | 98 | $data = strval($img->encode('jpg')); |
| 99 | 99 | } |
@@ -103,12 +103,12 @@ discard block |
||
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | |
| 106 | - \Log::debug('[CachedImage] Storing image as ' . $img->width() . ' x ' . $img->height() . ', ' . strlen($data) . ' bytes'); |
|
| 106 | + \Log::debug('[CachedImage] Storing image as '.$img->width().' x '.$img->height().', '.strlen($data).' bytes'); |
|
| 107 | 107 | if (!$this->filesystem->write($cacheKey, $data, $this->fsConfig)) { |
| 108 | 108 | throw new \ErrorException('[CoverCache] Failed to upload thumb to S3'); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - \Log::debug('[CachedImage] Wrote cached version as ' . $cacheKey); |
|
| 111 | + \Log::debug('[CachedImage] Wrote cached version as '.$cacheKey); |
|
| 112 | 112 | |
| 113 | 113 | return new CachedImage($this, $cacheKey); |
| 114 | 114 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | { |
| 140 | 140 | $data = $this->filesystem->read($cacheKey); |
| 141 | 141 | $blob = strval($data['contents']); |
| 142 | - \Log::debug('[CachedImage] Read ' .$cacheKey . ': ' . strlen($blob) . ' bytes'); |
|
| 142 | + \Log::debug('[CachedImage] Read '.$cacheKey.': '.strlen($blob).' bytes'); |
|
| 143 | 143 | |
| 144 | 144 | return $this->putBlob($blob, $maxHeight); |
| 145 | 145 | } |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | use Phpoaipmh\Endpoint; |
| 11 | 11 | use Phpoaipmh\Exception\OaipmhException; |
| 12 | 12 | use Phpoaipmh\Granularity; |
| 13 | -use Storage; |
|
| 14 | 13 | |
| 15 | 14 | class OaiPmhHarvest extends Job |
| 16 | 15 | { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | public function fromNetwork() |
| 86 | 86 | { |
| 87 | 87 | $client = new Client($this->url); |
| 88 | - $endpoint = new Endpoint($client,Granularity::DATE); |
|
| 88 | + $endpoint = new Endpoint($client, Granularity::DATE); |
|
| 89 | 89 | |
| 90 | 90 | $recordsHarvested = 0; |
| 91 | 91 | |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | public function handle() |
| 111 | 111 | { |
| 112 | - Log::info('[OaiPmhHarvest] Starting job. Requesting records from ' . ($this->start ?: '(no limit)') . ' until ' . ($this->until ?: '(no limit)') . '.'); |
|
| 112 | + Log::info('[OaiPmhHarvest] Starting job. Requesting records from '.($this->start ?: '(no limit)').' until '.($this->until ?: '(no limit)').'.'); |
|
| 113 | 113 | |
| 114 | 114 | // For timing |
| 115 | 115 | $this->startTime = $this->batchTime = microtime(true) - 1; |
@@ -123,9 +123,9 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | try { |
| 125 | 125 | $recordsHarvested = $this->fromNetwork(); |
| 126 | - Log::info('[OaiPmhHarvest] Harvest complete, got ' . $recordsHarvested . ' records.'); |
|
| 126 | + Log::info('[OaiPmhHarvest] Harvest complete, got '.$recordsHarvested.' records.'); |
|
| 127 | 127 | } catch (OaipmhException $e) { |
| 128 | - Log::warning('[OaiPmhHarvest] Harvest stopped with error ' . $e->getCode() . ': ' . $e->getMessage()); |
|
| 128 | + Log::warning('[OaiPmhHarvest] Harvest stopped with error '.$e->getCode().': '.$e->getMessage()); |
|
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $this->comment('Available configurations:'); |
| 48 | 48 | $config = \Config::get('oaipmh.harvests', null); |
| 49 | 49 | foreach (array_keys($config) as $key) { |
| 50 | - $this->comment(' - ' . $key); |
|
| 50 | + $this->comment(' - '.$key); |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | return false; |
| 60 | 60 | } |
| 61 | - $harvestConfig = \Config::get('oaipmh.harvests.' . $this->argument('name'), null); |
|
| 61 | + $harvestConfig = \Config::get('oaipmh.harvests.'.$this->argument('name'), null); |
|
| 62 | 62 | if (is_null($harvestConfig)) { |
| 63 | 63 | $this->error('Unknown configuration specified.'); |
| 64 | 64 | $this->listConfigurations(); |
@@ -100,23 +100,23 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | $harvestName = $this->argument('name'); |
| 103 | - $harvestConfig = \Config::get('oaipmh.harvests.' . $harvestName, null); |
|
| 103 | + $harvestConfig = \Config::get('oaipmh.harvests.'.$harvestName, null); |
|
| 104 | 104 | |
| 105 | 105 | $this->comment(sprintf('Dispatching new harvest job')); |
| 106 | 106 | |
| 107 | - $this->comment(' - Repo: ' . $harvestConfig['url']); |
|
| 108 | - $this->comment(' - Schema: ' . $harvestConfig['schema']); |
|
| 109 | - $this->comment(' - Set: ' . $harvestConfig['set']); |
|
| 107 | + $this->comment(' - Repo: '.$harvestConfig['url']); |
|
| 108 | + $this->comment(' - Schema: '.$harvestConfig['schema']); |
|
| 109 | + $this->comment(' - Set: '.$harvestConfig['set']); |
|
| 110 | 110 | |
| 111 | 111 | if ($this->option('daily')) { |
| 112 | - $from = Carbon::now()->setTime(0,0,0)->subDay(); |
|
| 113 | - $until = Carbon::now()->setTime(0,0,0); |
|
| 112 | + $from = Carbon::now()->setTime(0, 0, 0)->subDay(); |
|
| 113 | + $until = Carbon::now()->setTime(0, 0, 0); |
|
| 114 | 114 | } else { |
| 115 | 115 | $from = $this->option('from') ? Carbon::parse($this->option('from')) : null; |
| 116 | 116 | $until = $this->option('until') ? Carbon::parse($this->option('until')) : null; |
| 117 | 117 | } |
| 118 | - $this->comment(' - From: ' . ($from ? $from->toDateTimeString() : '(unspecified)')); |
|
| 119 | - $this->comment(' - Until: ' . ($until ? $until->toDateTimeString() : '(unspecified)')); |
|
| 118 | + $this->comment(' - From: '.($from ? $from->toDateTimeString() : '(unspecified)')); |
|
| 119 | + $this->comment(' - Until: '.($until ? $until->toDateTimeString() : '(unspecified)')); |
|
| 120 | 120 | |
| 121 | 121 | $this->dispatch( |
| 122 | 122 | new OaiPmhHarvestJob( |
@@ -24,18 +24,18 @@ |
||
| 24 | 24 | protected function schedule(Schedule $schedule) |
| 25 | 25 | { |
| 26 | 26 | $schedule->command('colligator:harvest-oaipmh samling42 --daily') |
| 27 | - ->dailyAt('02:00'); |
|
| 27 | + ->dailyAt('02:00'); |
|
| 28 | 28 | |
| 29 | 29 | $schedule->command('colligator:harvest-oaipmh s-litt --daily') |
| 30 | - ->dailyAt('03:00'); |
|
| 30 | + ->dailyAt('03:00'); |
|
| 31 | 31 | |
| 32 | 32 | // Bring subject heading usage counts up-to-date |
| 33 | 33 | $schedule->command('colligator:reindex') |
| 34 | - ->weekly()->sundays()->at('04:00'); |
|
| 34 | + ->weekly()->sundays()->at('04:00'); |
|
| 35 | 35 | |
| 36 | 36 | // Check new documents for xisbn |
| 37 | 37 | $schedule->command('colligator:harvest-xisbn') |
| 38 | - ->weekly()->saturdays()->at('04:00'); |
|
| 38 | + ->weekly()->saturdays()->at('04:00'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -26,10 +26,10 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function register() |
| 28 | 28 | { |
| 29 | - $this->app->singleton(HttpClient::class, function () { |
|
| 29 | + $this->app->singleton(HttpClient::class, function() { |
|
| 30 | 30 | $config = [ |
| 31 | 31 | 'timeout' => 30, |
| 32 | - 'verify' => false, // we need to fetch covers from at least one server with invalid ssl setup |
|
| 32 | + 'verify' => false, // we need to fetch covers from at least one server with invalid ssl setup |
|
| 33 | 33 | ]; |
| 34 | 34 | $client = new GuzzleClient($config); |
| 35 | 35 | $adapter = new GuzzleAdapter($client); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | return $adapter; |
| 38 | 38 | }); |
| 39 | 39 | |
| 40 | - $this->app->singleton(MessageFactory::class, function () { |
|
| 40 | + $this->app->singleton(MessageFactory::class, function() { |
|
| 41 | 41 | $factory = new GuzzleMessageFactory(); |
| 42 | 42 | |
| 43 | 43 | return $factory; |