Created
April 6, 2012 20:07
-
-
Save anonymous/2322593 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// cli-config.php | |
require_once "bootstrap.php"; | |
$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array( | |
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($entityManager) | |
)); | |
?> | |
<?php | |
// bootstrap.php | |
require_once "../layout/entities/User.php"; | |
require_once "../layout/entities/Broadcast.php"; | |
if (!class_exists("Doctrine\Common\Version", false)) { | |
require_once "doctrine_bootstrap.php"; | |
} | |
?> | |
<?php | |
// docstrine_bootstrap.php | |
use Doctrine\ORM\Tools\Setup; | |
require "../lib/doctrine2-orm/lib/Doctrine/ORM/Tools/Setup.php"; | |
$lib = '../lib/doctrine2-orm'; | |
Doctrine\ORM\Tools\Setup::registerAutoloadGit($lib); | |
// Create a simple "default" Doctrine ORM configuration for XML Mapping | |
$isDevMode =($_SERVER['HTTP_HOST'] == 'dev.jaba.tv'); | |
//$config = Setup::createXMLMetadataConfiguration(array(__DIR__."/config/xml"), $isDevMode); | |
// or if you prefer yaml or annotations | |
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/entities"), $isDevMode); | |
//$config = Setup::createYAMLMetadataConfiguration(array(__DIR__."/config/yaml"), $isDevMode); | |
// database configuration parameters | |
$conn = array( | |
'driver' => 'pdo_mysql', | |
'user' => 'jabadev', | |
'password' => 'UPavLjVQA7kuDQsw', | |
'dbname' => 'jabadev', | |
'unix_socket' => '/var/lib/mysql/mysql.sock', | |
); | |
// obtaining the entity manager | |
$entityManager = \Doctrine\ORM\EntityManager::create($conn, $config); | |
?> | |
~ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment