@@ -9,7 +9,7 @@ |
||
9 | 9 | |
10 | 10 | class CoverCacheServiceProvider extends ServiceProvider |
11 | 11 | { |
12 | - /** |
|
12 | + /** |
|
13 | 13 | * Indicates if loading of the provider is deferred. |
14 | 14 | * |
15 | 15 | * @var bool |
@@ -23,12 +23,12 @@ |
||
23 | 23 | */ |
24 | 24 | public function register() |
25 | 25 | { |
26 | - $this->app->singleton(CoverCache::class, function ($app) { |
|
26 | + $this->app->singleton(CoverCache::class, function($app) { |
|
27 | 27 | $fs = \Storage::disk('s3')->getAdapter(); |
28 | 28 | $im = $this->app->make(ImageManager::class); |
29 | 29 | $conf = new FlysystemConfig([ |
30 | 30 | // Default: 30 days |
31 | - 'CacheControl' => 'max-age=' . env('IMAGE_CACHE_TIME', 3153600) . ', public', |
|
31 | + 'CacheControl' => 'max-age='.env('IMAGE_CACHE_TIME', 3153600).', public', |
|
32 | 32 | ]); |
33 | 33 | return new CoverCache($fs, $im, $conf); |
34 | 34 | }); |
@@ -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( |