1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-11-26 20:24:39 +01:00

Backport tests/bootstrap.php from 2.0 / master onto 1.0.

This commit is contained in:
Andreas Fischer 2016-10-20 21:29:55 +02:00
parent d760d97fc8
commit f5d8377cdb

View File

@ -7,25 +7,13 @@
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
// Set up include path accordingly. This is especially required because some $loader_path = __DIR__ . '/../vendor/autoload.php';
// class files of phpseclib require() other dependencies. if (!file_exists($loader_path)) {
set_include_path(implode(PATH_SEPARATOR, array( echo "Dependencies must be installed using composer:\n\n";
dirname(__FILE__) . '/../phpseclib/', echo "php composer.phar install\n\n";
dirname(__FILE__) . '/', echo "See http://getcomposer.org for help with installing composer\n";
get_include_path(), exit(1);
)));
require_once 'Crypt/Random.php';
function phpseclib_autoload($class)
{
$file = str_replace('_', '/', $class) . '.php';
if (phpseclib_resolve_include_path($file)) {
// @codingStandardsIgnoreStart
require $file;
// @codingStandardsIgnoreEnd
}
} }
spl_autoload_register('phpseclib_autoload'); $loader = include $loader_path;
$loader->add('', __DIR__);