0

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 ?

4

2 回答 2

0

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

Migrations will be worse.

于 2013-07-26T13:50:13.267 回答
0

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.

于 2013-07-26T13:55:28.763 回答