public function setUp() { parent::setUp(); /*$config = include('config.php'); $mapper = new SimDAL_Mapper($config['map']); $adapter = $session = new SimDAL_Session($mapper, $adapter);*/ $this->session = SimDAL_Session::factory()->getCurrentSession(); }
public function init() { $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->registerNamespace('SimDAL_'); SimDAL_Autoload::setDomainDirectory($this->domainPath); SimDAL_Autoload::loadNonDomainClasses(false); SimDAL_Session::factory(array('db' => $this->adapterConfig)); $autoloader->pushAutoloader(array('SimDAL_Autoload', 'autoload')); }
<?php require_once 'init.php'; $mapper = SimDAL_Session::factory()->getMapper(); SimDAL_ProxyGenerator::generateProxies($mapper, DOMAIN_PATH . DIRECTORY_SEPARATOR . '.simdal');
<?php $domain_path = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'TestDomain'); define('DOMAIN_PATH', $domain_path); if (!isset($paths)) { $paths = array('curr_path' => get_include_path()); $autoload = true; } if (!isset($dir)) { $paths['library'] = realpath(DOMAIN_PATH . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'library'); $paths['domain'] = DOMAIN_PATH; $paths = array_reverse($paths, true); set_include_path(implode(PATH_SEPARATOR, $paths)); } if ($autoload) { require_once 'SimDAL/Autoload.php'; SimDAL_Autoload::setDomainDirectory(DOMAIN_PATH); spl_autoload_register(array('SimDAL_Autoload', 'autoload')); } SimDAL_Session::factory(include 'config.php');
protected function _startHookSession() { $this->_hookSession = SimDAL_Session::factory()->getNewSession(); }