I have same problem mentioned here: How to add a new entity in CiviCRM extension

I followed the documentation to generate skeletal files and completed steps 1 - 3. However I get stucked when following the point 4. In point 4 I've been able to complete sub steps a,b,c but I'm getting the following error when trying to run the command from sub step d:

$ ./setup.sh -g

+ '[' -n '' ']'
+ '[' -n 1 -a -d /var/www/html/civi-demo/sites/all/modules/civicrm/bin/./../xml ']'
+ pushd /var/www/html/civi-demo/sites/all/modules/civicrm/bin/./../xml
/var/www/html/civi-demo/sites/all/modules/civicrm/xml /var/www/html/civi-demo/sites/all/modules/civicrm/bin
+ '[' -z 3306 ']'
+ PHP_MYSQL_HOSTPORT=localhost:3306
+ php -d mysql.default_host=localhost:3306 -d mysql.default_user=user -d mysql.default_password=pass GenCode.php schema/Schema.xml '' drupal

civicrm_domain.version := 4.7.29

Parsing schema description schema/Schema.xml
Extracting database information
Extracting table information
PHP Fatal error:  Class 'Civi\Core\Container' not found in /var/www/html/civi-demo/sites/all/modules/civicrm/CRM/Core/Config.php on line 113

The line throwing the error is the following:


Seems it tries to access the class Container in the global namespace but cannot find it. I searched for the class and it exists in the following path:


What can be the problem? Should I modify class CRM/Core/Config.php and add aditional code to try to access the Container class in a different way?

Thanks in advance!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.