2008-02-09 02:20:35 +03:00
|
|
|
<?php
|
2009-01-04 19:15:32 +03:00
|
|
|
/*
|
|
|
|
* This file bootstraps the test environment.
|
|
|
|
*/
|
2009-01-22 22:38:10 +03:00
|
|
|
namespace Doctrine\Tests;
|
2009-01-04 19:15:32 +03:00
|
|
|
|
2009-07-18 17:15:54 +04:00
|
|
|
error_reporting(E_ALL | E_STRICT);
|
|
|
|
|
2013-02-05 00:30:02 +04:00
|
|
|
if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) {
|
|
|
|
// dependencies were installed via composer - this is the main project
|
|
|
|
$classLoader = require __DIR__ . '/../../../vendor/autoload.php';
|
|
|
|
} elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) {
|
|
|
|
// installed as a dependency in `vendor`
|
|
|
|
$classLoader = require __DIR__ . '/../../../../../autoload.php';
|
2010-06-07 00:41:05 +04:00
|
|
|
} else {
|
2013-02-05 00:30:02 +04:00
|
|
|
throw new \Exception('Can\'t find autoload.php. Did you install dependencies via composer?');
|
2010-06-07 00:41:05 +04:00
|
|
|
}
|
2008-09-12 10:09:16 +04:00
|
|
|
|
2013-02-05 00:30:02 +04:00
|
|
|
/* @var $classLoader \Composer\Autoload\ClassLoader */
|
|
|
|
$classLoader->add('Doctrine\\Tests\\', __DIR__ . '/../../');
|
|
|
|
unset($classLoader);
|
2011-06-19 00:47:21 +04:00
|
|
|
|
2013-02-05 00:30:02 +04:00
|
|
|
if ( ! file_exists(__DIR__ . '/Proxies') && ! mkdir(__DIR__ . '/Proxies')) {
|
|
|
|
throw new \Exception("Could not create " . __DIR__."/Proxies Folder.");
|
2010-04-07 22:35:33 +04:00
|
|
|
}
|
2013-02-05 00:30:02 +04:00
|
|
|
|
|
|
|
if ( ! file_exists(__DIR__ . '/ORM/Proxy/generated') && ! mkdir(__DIR__ . '/ORM/Proxy/generated')) {
|
|
|
|
throw new \Exception('Could not create ' . __DIR__ . '/ORM/Proxy/generated Folder.');
|
2010-04-07 22:35:33 +04:00
|
|
|
}
|