change the way to call autoload.php.
- As suggested by @theshka, this code first verify if Pico is being used as local composer install, then verify if it is being used as a composer library.
This commit is contained in:
parent
85442266b5
commit
70d813eafe
18
index.php
18
index.php
@ -1,14 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$parent = '..' . DIRECTORY_SEPARATOR;
|
|
||||||
set_include_path(
|
|
||||||
get_include_path() . PATH_SEPARATOR .
|
|
||||||
$parent . $parent . $parent . PATH_SEPARATOR .
|
|
||||||
'.'
|
|
||||||
);
|
|
||||||
|
|
||||||
// load dependencies
|
// load dependencies
|
||||||
require_once('vendor/autoload.php');
|
if(is_file($f = __DIR__ . '/vendor/autoload.php')) {
|
||||||
|
// local composer install
|
||||||
|
require_once($f);
|
||||||
|
} elseif(is_file($f = __DIR__ . '/../../../vendor/autoload.php')) {
|
||||||
|
// root composer install
|
||||||
|
require_once($f);
|
||||||
|
} else {
|
||||||
|
// composer needs install...
|
||||||
|
die('Cannot find composer `/vendor/autoload.php` -- try `composer install`');
|
||||||
|
}
|
||||||
|
|
||||||
// instance Pico
|
// instance Pico
|
||||||
$pico = new Pico(
|
$pico = new Pico(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user