Configure the System
Open the SYSTEM/config.php file. You will
add elements to the $config array inside this file before the
return statement at the end of the file.
Find the entry for the front controller and tell it what your
application class prefixes will be via the
'classes' key.
array('Acme_App', 'Solar_App'),
// ...
'explain' => true,
);
]]>
Having Solar_App as part of the class stack allows Solar to
look in both Acme and Solar for the first matching app name.
Find the entry for the model catalog and tell it what your
application class prefixes will be.
Add new $config keys to tell Solar what SQL
adapter to use, and to configure that adapter.
For SQLite, use the following.
"$system/sqlite/acme.sq3", // the database file to use
);
]]>
The $system variable is defined at the
top of the SYSTEM/config.php file and is
the same as the SYSTEM
directory.
For MySQL, use the following.
'localhost', // the database server domain
'name' => 'database', // the database name
'user' => 'username', // authenticate as this user
'pass' => 'password', // authenticate with this password
);
]]>
For PostgreSQL, substitute
Solar_Sql_Adapter_Pgsql for the adapter
class name and the config key.
By the end of this process, the end of your config file should
look something like this:
array('Acme_App', 'Solar_App'),
'disable' => array(),
'default' => 'hello',
'rewrite' => array(),
'routing' => array(),
'explain' => true,
);
// model catalog
$config['Solar_Sql_Model_Catalog']['classes'] = array('Acme_Model');
// the SQL adapter class to use
$config['Solar_Sql']['adapter'] = 'Solar_Sql_Adapter_Sqlite';
// configure the SQL adapter class
$config['Solar_Sql_Adapter_Sqlite'] = array(
'name' => "$system/sqlite/acme.sq3", // the database file to use
);
/**
* done!
*/
return $config;
]]>