Mezatsong / laravel-swagger-docs

MIT License
20 stars 8 forks source link

PDOException raised after installing package #2

Closed fdbatista closed 1 year ago

fdbatista commented 2 years ago

@Mezatsong Hi man.

I am getting this error right after composer require mezatsong/laravel-swagger-docs.

Looks like the package is trying to make use of some DB connection. I don't have Composer installed on my computer. I run this command via Docker image:

docker run --rm --interactive --tty --volume $PWD:/app composer:latest require mezatsong/laravel-swagger-docs

Using version dev-master for mezatsong/laravel-swagger-docs
./composer.json has been updated
Running composer update mezatsong/laravel-swagger-docs
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
  - Locking mezatsong/laravel-swagger-docs (dev-master c4aafd6)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Downloading mezatsong/laravel-swagger-docs (dev-master c4aafd6)
  - Installing mezatsong/laravel-swagger-docs (dev-master c4aafd6): Extracting archive
1 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   PDOException 

  could not find driver

  at vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70
     66▕         if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
     67▕             return new PDOConnection($dsn, $username, $password, $options);
     68▕         }
     69▕ 
  ➜  70▕         return new PDO($dsn, $username, $password, $options);
     71▕     }
     72▕ 
     73▕     /**
     74▕      * Determine if the connection is persistent.

      +18 vendor frames 
  19  [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}(Object(Mezatsong\SwaggerDocs\SwaggerServiceProvider))

      +5 vendor frames 
  25  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
Mezatsong commented 2 years ago

Indeed, the package connects to the database to retrieve the model fields to display on the docs

fdbatista commented 2 years ago

But it shouldn't connect after installing, it should do it when running 'generate'.

On Wed, 22 Jun 2022, 7:42 pm MEZATSONG TSAFACK Carrel, < @.***> wrote:

Indeed, the package connects to the database to retrieve the model fields to display on the docs

— Reply to this email directly, view it on GitHub https://github.com/Mezatsong/laravel-swagger-docs/issues/2#issuecomment-1163771778, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXNUY5MP6K6OJLYLAKIF6LVQOQHNANCNFSM5ZJFFWXQ . You are receiving this because you authored the thread.Message ID: @.***>

Mezatsong commented 2 years ago

Yes, you are right, it will fix it during this week

Mezatsong commented 1 year ago

@fdbatista Fixed