-
Open the
file. You will add elements to theSYSTEM
/config.php$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.<?php // front controller $config['Solar_Controller_Front'] = array( 'classes' => array('Acme_App', 'Solar_App'), // ... 'explain' => true, );
Note 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.
<?php // model catalog $config['Solar_Sql_Model_Catalog']['classes'] = array('Acme_Model');
-
Add new
$config
keys to tell Solar what SQL adapter to use, and to configure that adapter.For SQLite, use the following.
<?php // 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 );
Note The
$system
variable is defined at the top of theSYSTEM/config.php
file and is the same as theSYSTEM
directory.For MySQL, use the following.
<?php // the SQL adapter class to use $config['Solar_Sql']['adapter'] = 'Solar_Sql_Adapter_Mysql'; // configure the SQL adapter class $config['Solar_Sql_Adapter_Mysql'] = array( 'host' => 'localhost', // the database server host 'name' => 'database', // the database name 'user' => 'username', // authenticate as this user 'pass' => 'password', // authenticate with this password );
Note 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:
<?php
/**
* project overrides
*/
// front controller
$config['Solar_Controller_Front'] = array(
'classes' => 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;