| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
require_once dirname(__FILE__).'/../../../../../../autoload/sfCoreAutoload.class.php';
|
|
|
4 |
sfCoreAutoload::register();
|
|
|
5 |
|
|
|
6 |
class ProjectConfiguration extends sfProjectConfiguration
|
|
|
7 |
{
|
|
|
8 |
public function setup()
|
|
|
9 |
{
|
|
|
10 |
$this->enableAllPluginsExcept(array('sfPropelPlugin'));
|
|
|
11 |
}
|
|
|
12 |
|
|
|
13 |
public function initializeDoctrine()
|
|
|
14 |
{
|
|
|
15 |
chdir(sfConfig::get('sf_root_dir'));
|
|
|
16 |
|
|
|
17 |
$task = new sfDoctrineBuildTask($this->dispatcher, new sfFormatter());
|
|
|
18 |
$task->setConfiguration($this);
|
|
|
19 |
$task->run(array(), array(
|
|
|
20 |
'no-confirmation' => true,
|
|
|
21 |
'db' => true,
|
|
|
22 |
'model' => true,
|
|
|
23 |
'forms' => true,
|
|
|
24 |
'filters' => true,
|
|
|
25 |
));
|
|
|
26 |
}
|
|
|
27 |
|
|
|
28 |
public function loadFixtures($fixtures)
|
|
|
29 |
{
|
|
|
30 |
$path = sfConfig::get('sf_data_dir') . '/' . $fixtures;
|
|
|
31 |
if ( ! file_exists($path)) {
|
|
|
32 |
throw new sfException('Invalid data fixtures file');
|
|
|
33 |
}
|
|
|
34 |
chdir(sfConfig::get('sf_root_dir'));
|
|
|
35 |
$task = new sfDoctrineDataLoadTask($this->dispatcher, new sfFormatter());
|
|
|
36 |
$task->setConfiguration($this);
|
|
|
37 |
$task->run(array($path));
|
|
|
38 |
}
|
|
|
39 |
|
|
|
40 |
public function configureDoctrine(Doctrine_Manager $manager)
|
|
|
41 |
{
|
|
|
42 |
$manager->setAttribute(Doctrine_Core::ATTR_VALIDATE, true);
|
|
|
43 |
|
|
|
44 |
$options = array('baseClassName' => 'myDoctrineRecord');
|
|
|
45 |
sfConfig::set('doctrine_model_builder_options', $options);
|
|
|
46 |
}
|
|
|
47 |
|
|
|
48 |
public function configureDoctrineConnection(Doctrine_Connection $connection)
|
|
|
49 |
{
|
|
|
50 |
}
|
|
|
51 |
|
|
|
52 |
public function configureDoctrineConnectionDoctrine2(Doctrine_Connection $connection)
|
|
|
53 |
{
|
|
|
54 |
$connection->setAttribute(Doctrine_Core::ATTR_VALIDATE, false);
|
|
|
55 |
}
|
|
|
56 |
}
|