diff --git a/.gitignore b/.gitignore
index 768fc06..bccec62 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,7 +10,12 @@ desktop.ini
.DS_Store
._*
-# Composer
+# composer
/composer.lock
/composer.phar
/vendor
+
+# phpDocumentor
+/.build/phpdoc
+/.build/phpdoc.cache
+/phpDocumentor.phar
diff --git a/.phpcs.xml b/.phpcs.xml
index a0785b8..2592313 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -11,9 +11,10 @@
.
- ^_build/
+ ^.build/
+ ^.github/
^vendor/
*.min.js
diff --git a/.phpdoc.xml b/.phpdoc.xml
index 301f928..f924f31 100644
--- a/.phpdoc.xml
+++ b/.phpdoc.xml
@@ -2,10 +2,10 @@
- _build/phpdoc.cache
+ .build/phpdoc.cache
- _build/phpdoc
+ .build/phpdoc
@@ -15,8 +15,9 @@
index.php
index.php.dist
-
- _build/*
+
+ .build/*
+ .github/*
config/*
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 44a184f..5abae72 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -153,7 +153,7 @@ As soon as development reaches a point where feedback is appreciated, a pull req
Build & Release process
-----------------------
-We're using [Travis CI](https://travis-ci.com) to automate the build & release process of Pico. It generates and deploys a [PHP class documentation](http://picocms.org/phpDoc/) (powered by [phpDoc](http://phpdoc.org)) for new releases and on every commit to the `master` branch. Travis also prepares new releases by generating Pico's pre-built release packages, a version badge, code statistics (powered by [cloc](https://github.com/AlDanial/cloc)) and updates our website (the [`picocms.github.io` repo](https://github.com/picocms/picocms.github.io)). Please refer to our [`.travis.yml`](https://github.com/picocms/Pico/blob/master/.travis.yml) and the [`_build` directory](https://github.com/picocms/Pico/tree/master/_build) for details.
+We're using [Travis CI](https://travis-ci.com) to automate the build & release process of Pico. It generates and deploys a [PHP class documentation](http://picocms.org/phpDoc/) (powered by [phpDoc](http://phpdoc.org)) for new releases and on every commit to the `master` branch. Travis also prepares new releases by generating Pico's pre-built release packages, a version badge, code statistics (powered by [cloc](https://github.com/AlDanial/cloc)) and updates our website (the [`picocms.github.io` repo](https://github.com/picocms/picocms.github.io)). Please refer to our [`.travis.yml`](https://github.com/picocms/Pico/blob/master/.travis.yml), the [`picocms/ci-tools` repo](https://github.com/picocms/ci-tools) and the [`.build` directory](https://github.com/picocms/Pico/tree/master/.build) for details.
As insinuated above, it is important that each commit to `master` is deployable. Once development of a new Pico release is finished, trigger Pico's build & release process by pushing a new Git tag. This tag should reference a (usually empty) commit on `master`, which message should adhere to the following template:
diff --git a/README.md b/README.md
index 8b1c32e..209529e 100644
--- a/README.md
+++ b/README.md
@@ -115,6 +115,8 @@ You want to contribute to Pico? We really appreciate that! You can help make Pic
3. Pico's Core: The supreme discipline is to work on Pico's Core. Your contribution should help *every* Pico user to have a better experience with Pico. If this is the case, fork Pico from https://github.com/picocms/Pico and open a [pull request][PullRequests]. We look forward to your contribution!
+By contributing to Pico, you accept and agree to the *Developer Certificate of Origin* for your present and future contributions submitted to Pico. Please refer to the ["Developer Certificate of Origin" section in our `CONTRIBUTING.md`][ContributionGuidelinesDCO].
+
[Packagist.org]: http://packagist.org/packages/picocms/pico
[LatestRelease]: https://github.com/picocms/Pico/releases/latest
[composer]: https://getcomposer.org/
@@ -133,6 +135,7 @@ You want to contribute to Pico? We really appreciate that! You can help make Pic
[IssuesSearch]: https://github.com/picocms/Pico/search?type=Issues
[PullRequests]: https://github.com/picocms/Pico/pulls
[ContributionGuidelines]: https://github.com/picocms/Pico/blob/master/CONTRIBUTING.md
+[ContributionGuidelinesDCO]: https://github.com/picocms/Pico/blob/master/CONTRIBUTING.md#developer-certificate-of-origin
[EditInlineDocs]: https://github.com/picocms/Pico/edit/master/content-sample/index.md
[EditUserDocs]: https://github.com/picocms/picocms.github.io/tree/master/_docs
[EditDevDocs]: https://github.com/picocms/picocms.github.io/tree/master/_development
diff --git a/lib/AbstractPicoPlugin.php b/lib/AbstractPicoPlugin.php
index eaa982a..23302f2 100644
--- a/lib/AbstractPicoPlugin.php
+++ b/lib/AbstractPicoPlugin.php
@@ -324,7 +324,8 @@ abstract class AbstractPicoPlugin implements PicoPluginInterface
* plugin's API is older than Pico's API. {@see PicoDeprecated} furthermore
* throws a exception when it can't provide compatibility in such cases.
* However, we still have to decide whether this plugin is compatible to
- * newer API versions, what defaults to "no" by default.
+ * newer API versions, what requires some special (version specific)
+ * precaution and is therefore usually not the case.
*
* @return void
*
diff --git a/lib/Pico.php b/lib/Pico.php
index a330ba5..a5cc61c 100644
--- a/lib/Pico.php
+++ b/lib/Pico.php
@@ -1425,7 +1425,7 @@ class Pico
*
* @return string prepared Markdown contents
*/
- public function prepareFileContent($rawContent, array $meta)
+ public function prepareFileContent($rawContent, array $meta = array())
{
// remove meta header
$metaHeaderPattern = "/^(\/(\*)|---)[[:blank:]]*(?:\r)?\n"
@@ -1549,9 +1549,7 @@ class Pico
protected function readPages()
{
$contentDir = $this->getConfig('content_dir');
- $contentDirLength = strlen($contentDir);
$contentExt = $this->getConfig('content_ext');
- $contentExtLength = strlen($contentExt);
$this->pages = array();
$files = $this->getFiles($contentDir, $contentExt, self::SORT_NONE);
@@ -1562,7 +1560,7 @@ class Pico
continue;
}
- $id = substr($file, $contentDirLength, -$contentExtLength);
+ $id = substr($file, strlen($contentDir), -strlen($contentExt));
// trigger onSinglePageLoading event
// skip inaccessible pages (e.g. drop "sub.md" if "sub/index.md" exists) by default