@@ -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,13 +100,13 @@ 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 | foreach (['from', 'until', 'resume', 'daily'] as $key) { |
112 | 112 | if (!is_null($this->option($key))) { |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | $from = Carbon::parse($this->option('from')); |
118 | 118 | $until = Carbon::parse($this->option('until')); |
119 | 119 | if ($this->option('daily')) { |
120 | - $from = Carbon::now()->setTime(0,0,0)->subDay(); |
|
121 | - $until = Carbon::now()->setTime(0,0,0); |
|
120 | + $from = Carbon::now()->setTime(0, 0, 0)->subDay(); |
|
121 | + $until = Carbon::now()->setTime(0, 0, 0); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | $this->dispatch( |