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:
commit
f97cd83cc8
@ -19,6 +19,7 @@ Released: -
|
|||||||
(RFC 3986) in `Page::evaluateRequestUrl()`
|
(RFC 3986) in `Page::evaluateRequestUrl()`
|
||||||
* [Fixed] #272: Encode URLs using `rawurlencode()` in `Pico::getPageUrl()`
|
* [Fixed] #272: Encode URLs using `rawurlencode()` in `Pico::getPageUrl()`
|
||||||
* [Fixed] #274: Prevent double slashes in `base_url`
|
* [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
|
### Version 1.0.0-beta.1
|
||||||
|
12
index.php
12
index.php
@ -1,6 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// load dependencies
|
// 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
|
// instance Pico
|
||||||
$pico = new Pico(
|
$pico = new Pico(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user