xref: /plugin/commonmark/src/bootstrap.php (revision 8ec9a8f2fa8d03e80395a040a2626880092b4ddf)
1*8ec9a8f2SSungbin Jeon<?php
2*8ec9a8f2SSungbin Jeon
3*8ec9a8f2SSungbin Jeonfunction includeIfExists($file) {
4*8ec9a8f2SSungbin Jeon    return file_exists($file) ? include $file : false;
5*8ec9a8f2SSungbin Jeon}
6*8ec9a8f2SSungbin Jeon
7*8ec9a8f2SSungbin Jeonif (
8*8ec9a8f2SSungbin Jeon    (!$loader = includeIfExists(__DIR__.'/../vendor/autoload.php'))
9*8ec9a8f2SSungbin Jeon    && (!$loader = includeIfExists(__DIR__.'/../../../autoload.php'))
10*8ec9a8f2SSungbin Jeon) {
11*8ec9a8f2SSungbin Jeon    echo
12*8ec9a8f2SSungbin Jeon        'You must set up the project dependencies using `composer install`'.PHP_EOL.
13*8ec9a8f2SSungbin Jeon        'See https://getcomposer.org/download/ for instructions on installing Composer'.PHP_EOL
14*8ec9a8f2SSungbin Jeon    ;
15*8ec9a8f2SSungbin Jeon    exit(1);
16*8ec9a8f2SSungbin Jeon}
17*8ec9a8f2SSungbin Jeon
18*8ec9a8f2SSungbin Jeonreturn $loader;