1<?php
2
3/*
4 * This file is part of Component Installer.
5 *
6 * (c) Rob Loach (http://robloach.net)
7 *
8 * For the full copyright and license information, please view the LICENSE.md
9 * file that was distributed with this source code.
10 */
11
12function includeIfExists($file)
13{
14    if (file_exists($file)) {
15        /** @noinspection PhpIncludeInspection */
16        return include $file;
17    }
18
19    return null;
20}
21
22if ((!$loader = includeIfExists(__DIR__ . '/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__ . '/../../../autoload.php'))) {
23    die('You must set up the project dependencies, run the following commands:'.PHP_EOL.
24        'curl -s http://getcomposer.org/installer | php'.PHP_EOL.
25        'php composer.phar install'.PHP_EOL);
26}
27
28return $loader;
29