I working on a project where user register and get a free online shop using Cakephp v2.6.5. I'm using shared hosting so i can't create Mysql database for them, So I use sqlite instead. Because I need to use it with Moblie App too. In my code I dynamically create sqlite file for user after their register. But I don't know how to change database path in Cakephp. All I know is Cakephp use config in config/database.php file, but i can't init it dynamically.
In my config/database.php file:
public $sqliteDB = array(
'datasource' => 'Database/Sqlite',
'persistent' => false,
//'database'=>'',
'prefix' => '',
'encoding' => 'utf8'
);
I trying to follow these link: CakePHP switch database (using same datasource) on the fly? and this link Cakephp can't change database on-the-fly
But I got nothing please help me for this case. Thank in advance.
Aucun commentaire:
Enregistrer un commentaire