All pastes #814204 Raw Edit

Mine

public text v1 · immutable
·published 2007-12-13 01:55 UTC
rendered paste body
<?php
 
define('SF_ROOT_DIR',    realpath(dirname(__FILE__).'/..'));
define('SF_APP',         'frontend');
define('SF_ENVIRONMENT', 'dev');
define('SF_DEBUG',       true);
 
require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
 
// initialize database manager
$databaseManager = new sfDatabaseManager();
$databaseManager->initialize();

// Path can be in a few different formats
$path = '../data/fixtures/test_data.yml'; // Path directly to one yml file

// Specify the format of the data you are importing
$format = 'yml'; // xml, yml, json

$models = array('User', 'Question', 'Interest'); // you can optionally specify an array of the models you wish to import the data for, by default it loads data for all the available loaded models and the data that exists

$data = new Doctrine_Data();

$data->importData($path, $format, $models);

?>