Question

I have my website ready on the localhost and use doctrine 1.2 for the database, I want to upload the website to a web host to try it so I changed the parameters (Database, User, Password, Host) of the DNS in the config.php file, but I don't know how to build it since I used to run this command in the CMD:

php doctrine build-all-reload

and I can't use the exec() command or it's alternatives on a shared host.

I use PHP in my website.

So how can I build my database ?

Was it helpful?

Solution

If you have a yml file you can create a php script and run the following to create the db from your yml.

$options = array(
'packagesPrefix' => 'Plugin',
'baseClassName'  => 'MyDoctrineRecord',
'suffix' => '.php'
);

Doctrine_Core::generateModelsFromYaml('/path/to/yaml', '/path/to/model', $options);

In general Doctrine_Core has a few methods to create, drop and insert to db after you have set up the connection. It is pretty straight forward.

OTHER TIPS

Dump your database on localhost and load it on your webhost using whatever means you have available (phpMyAdmin for example)

Migrations will be worse.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top