Pico/index.php
Diogo Oliveira de Melo 70d813eafe 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.
2015-11-27 02:16:06 -02:00

27 lines
633 B
PHP

<?php
// load dependencies
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
$pico = new Pico(
__DIR__, // root dir
'config/', // config dir
'plugins/', // plugins dir
'themes/' // themes dir
);
// override configuration?
// $pico->setConfig(array());
// run application
echo $pico->run();