-
Notifications
You must be signed in to change notification settings - Fork 1
/
autoload.php
40 lines (32 loc) · 1.18 KB
/
autoload.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/*
* Copyright (c) 2014, webvariants GmbH & Co. KG, http://www.webvariants.de
*
* This file is released under the terms of the MIT license. You can find the
* complete text in the attached LICENSE file or online at:
*
* http://www.opensource.org/licenses/mit-license.php
*/
// check if we're a standalone installation
$vendor = __DIR__.DIRECTORY_SEPARATOR.'vendor';
if (!file_exists($vendor.'/autoload.php')) {
// check if we're installed as a dependency, residing in sally/core/
$vendor = dirname(__DIR__).DIRECTORY_SEPARATOR.'vendor';
if (!file_exists($vendor.'/autoload.php')) {
// if we are the dependency of an addOn, there is no 'sally/vendor/', but instead 'vendor/'
$vendor = dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR.'vendor';
if (!file_exists($vendor.'/autoload.php')) {
print
'You must set up the project dependencies, run the following commands:'.PHP_EOL.
'php composer.phar install'.PHP_EOL;
exit(1);
}
}
}
// init the Composer autoloader
$loader = require $vendor.'/autoload.php';
// make sure to use develop/lib as the first load path
$loader->add('', dirname(dirname(__DIR__)).'/develop/lib', true);
// cleanup
unset($vendor);
return $loader;