diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 361a284f..d23b141a 100755 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -31,10 +31,10 @@ class Kernel extends ConsoleKernel $schedule->command(Hourly::class)->hourly(); // When spatie-backups runs - if (config('backup.backup.enabled', false) === true) { + /*if (config('backup.backup.enabled', false) === true) { $schedule->command('backup:clean')->daily()->at('01:00'); $schedule->command('backup:run')->daily()->at('02:00'); - } + }*/ // Update the last time the cron was run /** @var CronService $cronSvc */ diff --git a/app/Http/Controllers/Frontend/DashboardController.php b/app/Http/Controllers/Frontend/DashboardController.php index 460675c3..8ab9ec37 100644 --- a/app/Http/Controllers/Frontend/DashboardController.php +++ b/app/Http/Controllers/Frontend/DashboardController.php @@ -28,7 +28,10 @@ class DashboardController extends Controller */ public function index() { + //dd(config('backup')); $last_pirep = null; + + /** @var \App\Models\User $user */ $user = Auth::user(); try { diff --git a/composer.json b/composer.json index ee00c89c..249effa7 100755 --- a/composer.json +++ b/composer.json @@ -51,7 +51,6 @@ "santigarcor/laratrust": "~6.3", "sebastiaanluca/laravel-helpers": "~6.0", "semver/semver": "~1.1.0", - "spatie/laravel-backup": "~6.15.0", "spatie/valuestore": "~1.2", "symfony/polyfill-iconv": "~1.22.0", "tivie/php-os-detector": "~1.1.0", diff --git a/composer.lock b/composer.lock index 8ed47b3c..4d7f9dd8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3ccf667d08d57a95146ac9424c80e29d", + "content-hash": "9c810647ebea1e88f066d7c0679d9b4c", "packages": [ { "name": "akaunting/money", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", - "url": "https://github.com/akaunting/money.git", - "reference": "75f6d0d036cd1ca82c2926cfae5a7c2759445cfb" + "url": "https://github.com/akaunting/laravel-money.git", + "reference": "38e3af880653700d7e67ca028d6d5f422eda96b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/akaunting/money/zipball/75f6d0d036cd1ca82c2926cfae5a7c2759445cfb", - "reference": "75f6d0d036cd1ca82c2926cfae5a7c2759445cfb", + "url": "https://api.github.com/repos/akaunting/laravel-money/zipball/38e3af880653700d7e67ca028d6d5f422eda96b5", + "reference": "38e3af880653700d7e67ca028d6d5f422eda96b5", "shasum": "" }, "require": { @@ -57,7 +57,7 @@ "role": "Developer" } ], - "description": "Currency formatting and conversion package for Laravel.", + "description": "Currency formatting and conversion package for Laravel", "keywords": [ "convert", "currency", @@ -66,10 +66,11 @@ "money" ], "support": { - "issues": "https://github.com/akaunting/money/issues", - "source": "https://github.com/akaunting/money/tree/master" + "issues": "https://github.com/akaunting/laravel-money/issues", + "source": "https://github.com/akaunting/laravel-money/tree/1.2.1" }, - "time": "2020-07-06T06:21:54+00:00" + "abandoned": "akaunting/laravel-money", + "time": "2021-03-05T12:06:16+00:00" }, { "name": "anhskohbo/no-captcha", @@ -6209,207 +6210,6 @@ "abandoned": true, "time": "2016-05-28T13:26:32+00:00" }, - { - "name": "spatie/db-dumper", - "version": "2.21.1", - "source": { - "type": "git", - "url": "https://github.com/spatie/db-dumper.git", - "reference": "05e5955fb882008a8947c5a45146d86cfafa10d1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/db-dumper/zipball/05e5955fb882008a8947c5a45146d86cfafa10d1", - "reference": "05e5955fb882008a8947c5a45146d86cfafa10d1", - "shasum": "" - }, - "require": { - "php": "^7.2|^8.0", - "symfony/process": "^4.2|^5.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.0|^8.0|^9.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\DbDumper\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "Dump databases", - "homepage": "https://github.com/spatie/db-dumper", - "keywords": [ - "database", - "db-dumper", - "dump", - "mysqldump", - "spatie" - ], - "support": { - "issues": "https://github.com/spatie/db-dumper/issues", - "source": "https://github.com/spatie/db-dumper/tree/2.21.1" - }, - "funding": [ - { - "url": "https://github.com/spatie", - "type": "github" - } - ], - "time": "2021-02-24T14:56:42+00:00" - }, - { - "name": "spatie/laravel-backup", - "version": "6.15.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/laravel-backup.git", - "reference": "85f653df9c44b46e7829413f652e5b3f8fe98448" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-backup/zipball/85f653df9c44b46e7829413f652e5b3f8fe98448", - "reference": "85f653df9c44b46e7829413f652e5b3f8fe98448", - "shasum": "" - }, - "require": { - "ext-zip": "^1.14.0", - "illuminate/console": "^6.0|^7.0|^8.0", - "illuminate/contracts": "^6.0|^7.0|^8.0", - "illuminate/events": "^6.0|^7.0|^8.0", - "illuminate/filesystem": "^6.0|^7.0|^8.0", - "illuminate/notifications": "^6.0|^7.0|^8.0", - "illuminate/support": "^6.0|^7.0|^8.0", - "league/flysystem": "^1.0.49", - "php": "^7.3|^8.0", - "spatie/db-dumper": "^2.12", - "spatie/temporary-directory": "^1.1", - "symfony/finder": "^4.2|^5.0" - }, - "require-dev": { - "laravel/slack-notification-channel": "^2.3", - "league/flysystem-aws-s3-v3": "^1.0", - "mockery/mockery": "^1.4.2", - "orchestra/testbench": "4.*|5.*|6.*", - "phpunit/phpunit": "^8.4|^9.0" - }, - "suggest": { - "laravel/slack-notification-channel": "Required for sending notifications via Slack" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Spatie\\Backup\\BackupServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Spatie\\Backup\\": "src" - }, - "files": [ - "src/Helpers/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "A Laravel package to backup your application", - "homepage": "https://github.com/spatie/laravel-backup", - "keywords": [ - "backup", - "database", - "laravel-backup", - "spatie" - ], - "support": { - "issues": "https://github.com/spatie/laravel-backup/issues", - "source": "https://github.com/spatie/laravel-backup/tree/6.15.0" - }, - "funding": [ - { - "url": "https://github.com/sponsors/spatie", - "type": "github" - }, - { - "url": "https://spatie.be/open-source/support-us", - "type": "other" - } - ], - "time": "2021-03-02T21:25:20+00:00" - }, - { - "name": "spatie/temporary-directory", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/temporary-directory.git", - "reference": "f517729b3793bca58f847c5fd383ec16f03ffec6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/temporary-directory/zipball/f517729b3793bca58f847c5fd383ec16f03ffec6", - "reference": "f517729b3793bca58f847c5fd383ec16f03ffec6", - "shasum": "" - }, - "require": { - "php": "^7.2|^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.0|^9.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\TemporaryDirectory\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alex Vanderbist", - "email": "alex@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "Easily create, use and destroy temporary directories", - "homepage": "https://github.com/spatie/temporary-directory", - "keywords": [ - "php", - "spatie", - "temporary-directory" - ], - "support": { - "issues": "https://github.com/spatie/temporary-directory/issues", - "source": "https://github.com/spatie/temporary-directory/tree/1.3.0" - }, - "time": "2020-11-09T15:54:21+00:00" - }, { "name": "spatie/valuestore", "version": "1.2.5", @@ -6479,16 +6279,16 @@ }, { "name": "swiftmailer/swiftmailer", - "version": "v6.2.5", + "version": "v6.2.6", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "698a6a9f54d7eb321274de3ad19863802c879fb7" + "reference": "d2791ff0b73247cdc2096b14f5580aba40c12bff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/698a6a9f54d7eb321274de3ad19863802c879fb7", - "reference": "698a6a9f54d7eb321274de3ad19863802c879fb7", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/d2791ff0b73247cdc2096b14f5580aba40c12bff", + "reference": "d2791ff0b73247cdc2096b14f5580aba40c12bff", "shasum": "" }, "require": { @@ -6538,7 +6338,7 @@ ], "support": { "issues": "https://github.com/swiftmailer/swiftmailer/issues", - "source": "https://github.com/swiftmailer/swiftmailer/tree/v6.2.5" + "source": "https://github.com/swiftmailer/swiftmailer/tree/v6.2.6" }, "funding": [ { @@ -6550,7 +6350,7 @@ "type": "tidelift" } ], - "time": "2021-01-12T09:35:59+00:00" + "time": "2021-03-05T12:08:49+00:00" }, { "name": "symfony/console", diff --git a/config/backup.php b/config/backup.php deleted file mode 100644 index b35f443d..00000000 --- a/config/backup.php +++ /dev/null @@ -1,210 +0,0 @@ - [ - 'name' => 'backups', - 'enabled' => false, - 'source' => [ - 'files' => [ - 'include' => [ - base_path(), - ], - 'exclude' => [ - base_path('vendor'), - base_path('node_modules'), - ], - 'follow_links' => false, - ], - - /* - * The names of the connections to the databases that should be backed up - * MySQL, PostgreSQL, SQLite and Mongo databases are supported. - * - * The content of the database dump may be customized for each connection - * by adding a 'dump' key to the connection settings in config/database.php. - * E.g. - * 'mysql' => [ - * ... - * 'dump' => [ - * 'excludeTables' => [ - * 'table_to_exclude_from_backup', - * 'another_table_to_exclude' - * ] - * ], - * ], - * - * If you are using only InnoDB tables on a MySQL server, you can - * also supply the useSingleTransaction option to avoid table locking. - * - * E.g. - * 'mysql' => [ - * ... - * 'dump' => [ - * 'useSingleTransaction' => true, - * ], - * ], - * - * For a complete list of available customization options, see https://github.com/spatie/db-dumper - */ - 'databases' => [ - 'mysql', - ], - ], - - /* - * The database dump can be compressed to decrease diskspace usage. - * - * Out of the box Laravel-backup supplies - * Spatie\DbDumper\Compressors\GzipCompressor::class. - * - * You can also create custom compressor. More info on that here: - * https://github.com/spatie/db-dumper#using-compression - * - * If you do not want any compressor at all, set it to null. - */ - 'database_dump_compressor' => Spatie\DbDumper\Compressors\GzipCompressor::class, - - 'destination' => [ - - /* - * The filename prefix used for the backup zip file. - */ - 'filename_prefix' => '', - - /* - * The disk names on which the backups will be stored. - */ - 'disks' => [ - 'local', - ], - ], - - /* - * The directory where the temporary files will be stored. - */ - 'temporary_directory' => storage_path('app/backup-temp'), - - /** - * Encryption disabled by default - */ - 'encryption' => false, - ], - - /* - * You can get notified when specific events occur. Out of the box you can use 'mail' and 'slack'. - * For Slack you need to install guzzlehttp/guzzle and laravel/slack-notification-channel. - * - * You can also use your own notification classes, just make sure the class is named after one of - * the `Spatie\Backup\Events` classes. - */ - 'notifications' => [ - 'notifications' => [ - BackupHasFailed::class => ['mail'], - UnhealthyBackupWasFound::class => ['mail'], - CleanupHasFailed::class => ['mail'], - BackupWasSuccessful::class => ['mail'], - HealthyBackupWasFound::class => ['mail'], - CleanupWasSuccessful::class => ['mail'], - ], - - /* - * Here you can specify the notifiable to which the notifications should be sent. The default - * notifiable will use the variables specified in this config file. - */ - 'notifiable' => Backups::class, - 'slack' => [ - 'webhook_url' => '', - /* - * If this is set to null the default channel of the webhook will be used. - */ - 'channel' => null, - 'username' => null, - 'icon' => null, - ], - ], - - /* - * Here you can specify which backups should be monitored. - * If a backup does not meet the specified requirements the - * UnHealthyBackupWasFound event will be fired. - */ - 'monitor_backups' => [ - [ - 'name' => config('app.name'), - 'disks' => ['local'], - 'health_checks' => [ - MaximumAgeInDays::class => 1, - MaximumStorageInMegabytes::class => 5000, - ], - ], - - /* - [ - 'name' => 'name of the second app', - 'disks' => ['local', 's3'], - 'health_checks' => [ - \Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumAgeInDays::class => 1, - \Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumStorageInMegabytes::class => 5000, - ], - ], - */ - ], - - 'cleanup' => [ - /* - * The strategy that will be used to cleanup old backups. The default strategy - * will keep all backups for a certain amount of days. After that period only - * a daily backup will be kept. After that period only weekly backups will - * be kept and so on. - * - * No matter how you configure it the default strategy will never - * delete the newest backup. - */ - 'strategy' => DefaultStrategy::class, - - 'default_strategy' => [ - - /* - * The number of days for which backups must be kept. - */ - 'keep_all_backups_for_days' => 3, - - /* - * The number of days for which daily backups must be kept. - */ - 'keep_daily_backups_for_days' => 2, - - /* - * The number of weeks for which one weekly backup must be kept. - */ - 'keep_weekly_backups_for_weeks' => 2, - - /* - * The number of months for which one monthly backup must be kept. - */ - 'keep_monthly_backups_for_months' => 1, - - /* - * The number of years for which one yearly backup must be kept. - */ - 'keep_yearly_backups_for_years' => 1, - - /* - * After cleaning up the backups remove the oldest backup until - * this amount of megabytes has been reached. - */ - 'delete_oldest_backups_when_using_more_megabytes_than' => 5000, - ], - ], -]; diff --git a/index.php b/index.php deleted file mode 100755 index 417ecec5..00000000 --- a/index.php +++ /dev/null @@ -1,26 +0,0 @@ -setPublicPath(__DIR__.'/public'); -$app->setPublicUrlPath(env('APP_PUBLIC_URL', '/')); - -// Uncomment this line if you're having issues with the redirecting not working properly -//$app->setPublicUrlPath(env('APP_PUBLIC_URL', '/public')); - -$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); - -$response = $kernel->handle( - $request = Illuminate\Http\Request::capture() -); - -$response->send(); - -$kernel->terminate($request, $response); diff --git a/public/index.php b/public/index.php index b9eff678..edbeeab4 100755 --- a/public/index.php +++ b/public/index.php @@ -6,6 +6,9 @@ * https://docs.phpvms.net */ +use Illuminate\Contracts\Http\Kernel; +use Illuminate\Http\Request; + /** * NOTE!! * @@ -16,14 +19,12 @@ */ $path_to_phpvms_folder = __DIR__.'/../'; if (file_exists($path_to_phpvms_folder.'bootstrap/autoload.php')) { - require $path_to_phpvms_folder.'bootstrap/autoload.php'; - $app = require_once $path_to_phpvms_folder.'bootstrap/app.php'; + // noop } // Look up one more folder up (outside of the Laravel root) and in the `phpvms` subfolder elseif (file_exists($path_to_phpvms_folder.'phpvms/bootstrap/autoload.php')) { - require $path_to_phpvms_folder.'phpvms/bootstrap/autoload.php'; - $app = require_once $path_to_phpvms_folder.'phpvms/bootstrap/app.php'; + $path_to_phpvms_folder = $path_to_phpvms_folder.'phpvms'; } // Bail out @@ -32,14 +33,30 @@ else { exit(); } +require $path_to_phpvms_folder.'/bootstrap/autoload.php'; +$app = require_once $path_to_phpvms_folder.'/bootstrap/app.php'; + +/* +|-------------------------------------------------------------------------- +| Check If Application Is Under Maintenance +|-------------------------------------------------------------------------- +| +| If the application is maintenance / demo mode via the "down" command we +| will require this file so that any prerendered template can be shown +| instead of starting the framework, which could cause an exception. +| +*/ + +if (file_exists($path_to_phpvms_folder.'/storage/framework/maintenance.php')) { + require $path_to_phpvms_folder.'/storage/framework/maintenance.php'; +} + $app->setPublicPath(__DIR__); -$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); +$kernel = $app->make(Kernel::class); -$response = $kernel->handle( - $request = Illuminate\Http\Request::capture() -); - -$response->send(); +$response = tap($kernel->handle( + $request = Request::capture() +))->send(); $kernel->terminate($request, $response);