~lewiszhang/coughphp/1.4-switch-to-phpunit

« back to all changes in this revision

Viewing changes to schema_generator/database/DatabaseSchemaGenerator.class.php

  • Committer: Anthony Bush
  • Date: 2009-06-27 04:33:03 UTC
  • Revision ID: anthony@anthonybush.com-20090627043303-w3eken2hpq61iwdj
Updated schema generator so that other drivers may be used (was hard-coded to use mysql).

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
                $dsn = $this->config->getDsn();
80
80
                
81
81
                // Load the driver-specific classes
82
 
                $driver = ucfirst(strtolower($dsn['driver']));
83
 
                $this->loadDrivers(dirname(__FILE__) . '/drivers/mysql/', $driver);
 
82
                $driver = strtolower($dsn['driver']);
 
83
                $classPrefix = ucfirst($driver);
 
84
                $this->loadDrivers(dirname(__FILE__) . '/drivers/' . $driver . '/', $classPrefix);
84
85
                
85
86
                // Construct the server/schema class and start loading databases according to the configuration options.
86
 
                $serverClass = $driver . 'Server';
 
87
                $serverClass = $classPrefix . 'Server';
87
88
                $server = new $serverClass($dsn);
88
89
                
89
90
                $dbNames = $server->getAvailableDatabaseNames();