Ticket #911 (closed enhancement: fixed)
prado-cli: Better error message if database connection fails when generating Active Record skeletons
| Reported by: | eirikhm | Owned by: | knut |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.1.3 |
| Component: | Prado Framework v3 | Version: | 3.1 |
| Severity: | trivial | Keywords: | |
| Cc: |
Description
I have a fresh application generated with prado-cli -c, and a simple database set up. ActiveRecord? is configured as follows:
<module class="System.Data.ActiveRecord?.TActiveRecordConfig" ConnectionID="db1" EnableCache?="true"/>
<module class="System.Data.TDataSourceConfig" id="db1">
<database ConnectionString?="mysql:host=localhost;dbname=mydatabase" Username="root" Password="" />
</module>
When I execute the following:
php /var/www/libs/framework/prado-cli.php generate zipcodes Application.data.ZipcodeRecord?
I get:
Command line tools for Prado 3.1.3a. ** Loaded PRADO appplication in directory "protected".
Fatal error: Call to a member function getConnectionString() on a non-object in /var/www/libs/framework/Data/ActiveRecord/TActiveRecordGateway.php on line 92
