문제

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 ?

도움이 되었습니까?

해결책

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.

다른 팁

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

Migrations will be worse.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top