Feature Requests
Share ideas, discuss and vote on requests from other users in community
 
This object is in archive! 

Include doctrine/dbal in vendor libraries

Seb shared this idea 2 years ago
Under Consideration

Since WHMCS provides the really handy Illuminate\Database stuff for doing queries etc., when developing my addon module I implemented the module_upgrade() function, where I can create/drop tables, or modify records in them. However, it is not possible to alter tables.

Example:

  1. DB::schema()->table('mod_mymodule_mytable', function ($table) {
  2. $table->renameColumn('oldcolumn', 'newcolumn');
  3. });

Result:

  1. Fatal error: Uncaught Error: Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found in vendor\illuminate\database\MySqlConnection.php

The problem could be easily solved by adding require doctrine/dbal to the composer.json file, however WHMCS does not provide this file with the release.

So maybe you can add doctrine/dbal in the next release vendor libs, question mark? :)

Comments (2)

photo
1

I have an addon module that depends on this module that's just broken now.

What's especially interesting is that the same module does work on a WHMCS installation where it was installed on 7.0.0 and later upgraded to 7.1.0, it only fails to work when freshly installed onto 7.1.0.

photo
1

It's a mandatory requisite for custom modules.

When using schema builder from

  1. function mymodule_upgrade($vars) {
  2. [...]
  3. $table->string('title', 25)->change();
  4. }

You get:

  1. Fatal error: Uncaught RuntimeException: Changing columns for table "mymodule_table " requires Doctrine DBAL; install "doctrine/dbal".

So if we should use Iluminate, plesase, include all needed parts.

If not included, _upgrade() function is useless for custom modules