Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
vagrant committed Dec 13, 2023
2 parents 456f1bb + cc11f54 commit 40debb2
Show file tree
Hide file tree
Showing 97 changed files with 3,024 additions and 743 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Linting
on: [push]
jobs:
lint:
runs-on: ubuntu-20.04
steps:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- name: Checkout code
uses: actions/checkout@v3
- name: Install PHP dependencies
run: composer install --no-interaction --no-progress --no-scripts
- name: Run PHP CodeSniffer
run: composer lint
5 changes: 1 addition & 4 deletions .github/workflows/php.yml → .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PHP
name: Testing

on:
push:
Expand Down Expand Up @@ -67,6 +67,3 @@ jobs:

- name: Run test suite
run: vendor/bin/phpunit

- name: Run code sniffer
run: vendor/bin/phpcs --warning-severity=6
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9
1.10
1 change: 0 additions & 1 deletion app/Behaviors/ImportsData.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Behaviors;

use Illuminate\Support\Facades\DB;

use Carbon\Carbon;
use Sentry\State\Scope;

Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/Bulk/BulkImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Console\Commands\Bulk;

use Illuminate\Support\Facades\DB;

use Aic\Hub\Foundation\AbstractCommand as BaseCommand;

class BulkImport extends BaseCommand
Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/Dump/AbstractDumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Support\Facades\Storage;
use App\Library\Shell;
use Exception;

use App\Console\Commands\BaseCommand;

abstract class AbstractDumpCommand extends BaseCommand
Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/Dump/DumpExportGettingStarted.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Console\Commands\Dump;

use Illuminate\Support\Facades\Storage;

use League\Csv\Writer;

class DumpExportGettingStarted extends AbstractDumpCommand
Expand Down
3 changes: 0 additions & 3 deletions app/Console/Commands/Import/AbstractImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
use Carbon\Carbon;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

use Aic\Hub\Foundation\AbstractCommand as BaseCommand;

use App\Behaviors\ImportsData;

use Illuminate\Support\Str;

abstract class AbstractImportCommand extends BaseCommand
Expand Down
2 changes: 0 additions & 2 deletions app/Console/Commands/Import/ImportMobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
namespace App\Console\Commands\Import;

use Illuminate\Support\Facades\Storage;

use App\Models\Mobile\Artwork as MobileArtwork;
use App\Models\Mobile\Sound;
use App\Models\Mobile\Tour;
use App\Models\Mobile\TourStop;

use App\Transformers\Traits\ConvertsToHtml;

class ImportMobile extends AbstractImportCommand
Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/Import/ImportSites.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Console\Commands\Import;

use Illuminate\Support\Facades\Storage;

use App\Models\StaticArchive\Site;
use App\Transformers\Inbound\StaticArchive\Site as SiteTransformer;

Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/Migrations/AbstractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Illuminate\Database\Schema\Blueprint;
use App\Library\Migrations\MigrationCreator;
use ColinODell\Indentation\Indentation;

use Aic\Hub\Foundation\AbstractCommand as BaseCommand;

abstract class AbstractCommand extends BaseCommand
Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/Report/ReportMigrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Console\Commands\Report;

use App\Library\Shell;

use Aic\Hub\Foundation\AbstractCommand as BaseCommand;

class ReportMigrations extends BaseCommand
Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/Search/ScoutImportAll.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Console\Commands\Search;

use Illuminate\Support\Facades\Config;

use Aic\Hub\Foundation\AbstractCommand as BaseCommand;

class ScoutImportAll extends BaseCommand
Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/Search/ScoutImportCsv.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use League\Csv\Reader;
use Illuminate\Support\Facades\Storage;

use Aic\Hub\Foundation\AbstractCommand as BaseCommand;

class ScoutImportCsv extends BaseCommand
Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/Search/ScoutImportSince.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Carbon\Carbon;
use Illuminate\Support\Facades\Schema;

use Aic\Hub\Foundation\AbstractCommand as BaseCommand;

class ScoutImportSince extends BaseCommand
Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/Search/ScoutSince.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Console\Commands\Search;

use Carbon\Carbon;

use Aic\Hub\Foundation\AbstractCommand as BaseCommand;

class ScoutSince extends BaseCommand
Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/Search/SearchAudit.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Carbon\Carbon;
use Elasticsearch;

use Aic\Hub\Foundation\AbstractCommand as BaseCommand;

class SearchAudit extends BaseCommand
Expand Down
2 changes: 0 additions & 2 deletions app/Console/Commands/Search/SearchInstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
namespace App\Console\Commands\Search;

use Elasticsearch;

use App\Console\Helpers\Indexer;

use Aic\Hub\Foundation\AbstractCommand as BaseCommand;

class SearchInstall extends BaseCommand
Expand Down
2 changes: 0 additions & 2 deletions app/Console/Commands/Search/SearchReindex.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
namespace App\Console\Commands\Search;

use Elasticsearch;

use App\Console\Helpers\Indexer;

use Aic\Hub\Foundation\AbstractCommand as BaseCommand;

class SearchReindex extends BaseCommand
Expand Down
5 changes: 2 additions & 3 deletions app/Console/Commands/Search/SearchUninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
namespace App\Console\Commands\Search;

use Elasticsearch;

use App\Console\Helpers\Indexer;

use Aic\Hub\Foundation\AbstractCommand as BaseCommand;

class SearchUninstall extends BaseCommand
Expand All @@ -22,7 +20,8 @@ public function handle()
{
$prefix = $this->argument('index') ?? config('elasticsearch.indexParams.index');

if (!$this->option('yes') &&
if (
!$this->option('yes') &&
!$this->confirm('This will delete all indexes with `' . $prefix . '` prefix. Are you sure?')
) {
return false;
Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/Update/UpdateNetx.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Console\Commands\Update;

use App\Models\Collections\Asset;

use Aic\Hub\Foundation\AbstractCommand as BaseCommand;

class UpdateNetx extends BaseCommand
Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/Update/UpdateResources.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Console\Commands\Update;

use App\Models\Collections\Artwork;

use Aic\Hub\Foundation\AbstractCommand as BaseCommand;

class UpdateResources extends BaseCommand
Expand Down
109 changes: 97 additions & 12 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,48 +32,129 @@ protected function schedule(Schedule $schedule): void
$schedule->command('update:cloudfront-ips')
->hourly();

$schedule->command('delete:collections')
->dailyAt('23:00')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/delete-collections-last-run.log'));

//
// Mobile app
$schedule->command('import:mobile')
->dailyAt('23:05')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-mobile-last-run.log'));

//
// Shop
$schedule->command('import:products-full', ['--yes'])
->dailyAt('23:10')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-products-full-last-run.log'));

$schedule->command('import:web-full', ['--yes'])
//
// Website
$schedule->command('import:web-full', ['articles', '--yes'])
->dailyAt('23:15')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-full-last-run.log'));
->sendOutputTo(storage_path('logs/import-web-full-articles-last-run.log'));

$schedule->command('import:web-full', ['artworks', '--yes'])
->dailyAt('23:18')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-full-artworks-last-run.log'));

$schedule->command('import:web-full', ['artists', '--yes'])
->dailyAt('23:21')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-full-artists-last-run.log'));

$schedule->command('import:web-full', ['events', '--yes'])
->dailyAt('23:24')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-full-events-last-run.log'));

$schedule->command('import:web-full', ['event-occurrences', '--yes'])
->dailyAt('23:27')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-full-event-occurrences-last-run.log'));

$schedule->command('import:web-full', ['event-programs', '--yes'])
->dailyAt('23:30')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-full-event-programs-last-run.log'));

$schedule->command('import:web-full', ['exhibitions', '--yes'])
->dailyAt('23:33')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-full-exhibitions-last-run.log'));

$schedule->command('import:web-full', ['highlights', '--yes'])
->dailyAt('23:36')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-full-highlights-last-run.log'));

$schedule->command('import:web-full', ['genericpages', '--yes'])
->dailyAt('23:39')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-full-genericpages-last-run.log'));

$schedule->command('import:web-full', ['pressreleases', '--yes'])
->dailyAt('23:42')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-full-pressreleases-last-run.log'));

$schedule->command('import:web-full', ['educatorresources', '--yes'])
->dailyAt('23:45')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-full-educatorresources-last-run.log'));

$schedule->command('import:web-full', ['digitalpublications', '--yes'])
->dailyAt('23:48')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-full-digitalpublications-last-run.log'));

$schedule->command('import:web-full', ['digitalpublicationsections', '--yes'])
->dailyAt('23:51')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-full-digitalpublicationsections-last-run.log'));

$schedule->command('import:web-full', ['printedpublications', '--yes'])
->dailyAt('23:54')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-full-printedpublications-last-run.log'));

$schedule->command('import:web-full', ['staticpages', '--yes'])
->dailyAt('23:57')
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-full-staticpages-last-run.log'));

$schedule->command('import:web')
->everyFiveMinutes()
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-last-run.log'));

//
// Archived Static sites
$schedule->command('import:sites', ['--yes'])
->monthlyOn(1, '03:00')
->sendOutputTo(storage_path('logs/import-sites-last-run.log'));

//
// Digital scholarly catalogues
$schedule->command('import:dsc', ['--yes'])
->monthlyOn(1, '03:05')
->sendOutputTo(storage_path('logs/import-dsc-last-run.log'));

//
// Google Analytics
$schedule->command('import:analytics')
->monthlyOn(1, '03:10')
->sendOutputTo(storage_path('logs/import-analytics-last-run.log'));

$schedule->command('import:web')
->everyFiveMinutes()
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-web-last-run.log'));

//
// Ticketed events
$schedule->command('import:events-ticketed-full', ['--unreset'])
->everyFiveMinutes()
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-events-ticketed-last-run.log'));

//
// Collections and DAMS
$schedule->command('delete:assets')
->everyFiveMinutes()
->withoutOverlapping(self::FOR_ONE_YEAR)
Expand All @@ -94,11 +175,15 @@ protected function schedule(Schedule $schedule): void
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-collections-last-run.log'));

//
// Virtual lines
$schedule->command('import:queues')
->everyMinute()
->withoutOverlapping(self::FOR_ONE_YEAR)
->sendOutputTo(storage_path('logs/import-queues-last-run.log'));

//
// Data enhancer
$schedule->command('import:enhancer')
->everyMinute()
->withoutOverlapping(self::FOR_ONE_YEAR)
Expand Down
1 change: 0 additions & 1 deletion app/ElasticsearchEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App;

use Exception;

use Tamayo\LaravelScoutElastic\Engines\ElasticsearchEngine as BaseEngine;

class ElasticsearchEngine extends BaseEngine
Expand Down
Loading

0 comments on commit 40debb2

Please sign in to comment.