Merge pull request #286 from dmelo/composer-compat

change Pico's default `index.php` to be compatible with `composer require picocms/pico`
This commit is contained in:
Daniel Rudolf 2015-11-27 19:43:10 +01:00
commit f97cd83cc8
2 changed files with 12 additions and 1 deletions

View file

@ -19,6 +19,7 @@ Released: -
(RFC 3986) in `Page::evaluateRequestUrl()`
* [Fixed] #272: Encode URLs using `rawurlencode()` in `Pico::getPageUrl()`
* [Fixed] #274: Prevent double slashes in `base_url`
* [Fixed] #285: Make `index.php` work when installed as a composer dependency
```
### Version 1.0.0-beta.1

View file

@ -1,6 +1,16 @@
<?php
// load dependencies
require_once(__DIR__ . '/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
$pico = new Pico(