2008-02-08 23:20:35 +00:00
|
|
|
<?php
|
2009-01-04 16:15:32 +00:00
|
|
|
/*
|
|
|
|
* This file bootstraps the test environment.
|
|
|
|
*/
|
2009-01-22 19:38:10 +00:00
|
|
|
namespace Doctrine\Tests;
|
2009-01-04 16:15:32 +00:00
|
|
|
|
2009-07-18 13:15:54 +00:00
|
|
|
error_reporting(E_ALL | E_STRICT);
|
2014-10-19 10:54:35 +02:00
|
|
|
date_default_timezone_set('UTC');
|
2009-07-18 13:15:54 +00:00
|
|
|
|
2013-02-04 21:30:02 +01:00
|
|
|
if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) {
|
|
|
|
// dependencies were installed via composer - this is the main project
|
2015-01-10 20:28:57 +00:00
|
|
|
require __DIR__ . '/../../../vendor/autoload.php';
|
2013-02-04 21:30:02 +01:00
|
|
|
} elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) {
|
|
|
|
// installed as a dependency in `vendor`
|
2015-01-10 20:28:57 +00:00
|
|
|
require __DIR__ . '/../../../../../autoload.php';
|
2010-06-06 22:41:05 +02:00
|
|
|
} else {
|
2013-02-04 21:30:02 +01:00
|
|
|
throw new \Exception('Can\'t find autoload.php. Did you install dependencies via composer?');
|
2010-06-06 22:41:05 +02:00
|
|
|
}
|
2008-09-12 06:09:16 +00:00
|
|
|
|
2013-02-04 21:30:02 +01:00
|
|
|
if ( ! file_exists(__DIR__ . '/Proxies') && ! mkdir(__DIR__ . '/Proxies')) {
|
|
|
|
throw new \Exception("Could not create " . __DIR__."/Proxies Folder.");
|
2010-04-07 20:35:33 +02:00
|
|
|
}
|
2013-02-04 21:30:02 +01: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 20:35:33 +02:00
|
|
|
}
|