2016-10-20 19:10:43 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2019-06-07 17:57:46 +02:00
|
|
|
* CreateCSVImport.php
|
2020-01-23 20:35:02 +01:00
|
|
|
* Copyright (c) 2020 james@firefly-iii.org
|
2016-10-20 19:10:43 +02:00
|
|
|
*
|
2019-10-02 06:37:26 +02:00
|
|
|
* This file is part of Firefly III (https://github.com/firefly-iii).
|
2016-10-20 19:10:43 +02:00
|
|
|
*
|
2019-10-02 06:37:26 +02:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
2017-10-21 08:40:00 +02:00
|
|
|
*
|
2019-10-02 06:37:26 +02:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
2017-10-21 08:40:00 +02:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2019-10-02 06:37:26 +02:00
|
|
|
* GNU Affero General Public License for more details.
|
2017-10-21 08:40:00 +02:00
|
|
|
*
|
2019-10-02 06:37:26 +02:00
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2016-10-20 19:10:43 +02:00
|
|
|
*/
|
|
|
|
|
2018-07-06 07:15:42 +02:00
|
|
|
/** @noinspection MultipleReturnStatementsInspection */
|
|
|
|
|
2018-05-11 10:08:34 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2019-06-07 17:57:46 +02:00
|
|
|
namespace FireflyIII\Console\Commands\Import;
|
2016-10-20 19:10:43 +02:00
|
|
|
|
2018-05-12 19:09:34 +02:00
|
|
|
use Exception;
|
2019-06-07 17:57:46 +02:00
|
|
|
use FireflyIII\Console\Commands\VerifiesAccessToken;
|
2017-12-16 20:47:08 +01:00
|
|
|
use FireflyIII\Exceptions\FireflyException;
|
|
|
|
use FireflyIII\Import\Routine\RoutineInterface;
|
2018-05-12 19:09:34 +02:00
|
|
|
use FireflyIII\Import\Storage\ImportArrayStorage;
|
2019-06-10 20:14:00 +02:00
|
|
|
use FireflyIII\Models\ImportJob;
|
2016-10-20 19:10:43 +02:00
|
|
|
use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
|
|
|
|
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
2019-06-10 20:14:00 +02:00
|
|
|
use FireflyIII\User;
|
2016-10-20 19:10:43 +02:00
|
|
|
use Illuminate\Console\Command;
|
|
|
|
use Log;
|
|
|
|
|
|
|
|
/**
|
2019-06-07 17:57:46 +02:00
|
|
|
* Class CreateCSVImport.
|
2020-03-17 14:54:25 +01:00
|
|
|
*
|
2020-03-15 15:31:51 +01:00
|
|
|
* @deprecated
|
|
|
|
* @codeCoverageIgnore
|
2016-10-20 19:10:43 +02:00
|
|
|
*/
|
2019-06-07 17:57:46 +02:00
|
|
|
class CreateCSVImport extends Command
|
2016-10-20 19:10:43 +02:00
|
|
|
{
|
2017-09-14 21:17:19 +02:00
|
|
|
use VerifiesAccessToken;
|
2016-10-20 19:10:43 +02:00
|
|
|
/**
|
|
|
|
* The console command description.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2019-06-07 17:57:46 +02:00
|
|
|
protected $description = 'Use this command to create a new CSV file import.';
|
2016-10-20 19:10:43 +02:00
|
|
|
/**
|
|
|
|
* The name and signature of the console command.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2017-10-05 11:49:06 +02:00
|
|
|
protected $signature
|
2019-06-07 17:57:46 +02:00
|
|
|
= 'firefly-iii:csv-import
|
|
|
|
{file? : The CSV file to import.}
|
2018-05-12 19:09:34 +02:00
|
|
|
{configuration? : The configuration file to use for the import.}
|
|
|
|
{--user=1 : The user ID that the import should import for.}
|
2019-06-07 17:57:46 +02:00
|
|
|
{--token= : The user\'s access token.}';
|
2016-10-20 19:10:43 +02:00
|
|
|
/**
|
2017-08-15 17:26:43 +02:00
|
|
|
* Run the command.
|
2016-10-20 19:10:43 +02:00
|
|
|
*/
|
2018-03-30 19:41:16 +02:00
|
|
|
public function handle(): int
|
2016-10-20 19:10:43 +02:00
|
|
|
{
|
2020-05-24 12:17:53 +02:00
|
|
|
$this->error('This command is disabled.');
|
|
|
|
return 1;
|
2019-06-10 20:14:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-10-20 19:10:43 +02:00
|
|
|
}
|