Commit graph

881 commits

Author SHA1 Message Date
Daniel Rudolf
568166ad07
Check Pico::VERSION constant before deploying a new release 2018-03-29 22:48:24 +02:00
Daniel Rudolf
b405edba17
Various small improvements 2018-03-29 22:47:23 +02:00
Daniel Rudolf
190889b77b
Fix sorting of Pico::$nativePlugins
Thanks to PT on our Freenode IRC channel #picocms for reporting this!
2018-03-29 22:45:12 +02:00
Daniel Rudolf
05c2c968c3
Use filter_id() for the url_param and form_param Twig functions
This is a follow-up to 80263a91dc
2018-02-24 16:40:00 +01:00
Daniel Rudolf
80263a91dc
Disallow the use of the callback filter for the url_param and form_param Twig functions 2018-02-24 14:02:59 +01:00
Daniel Rudolf
5f7b455975
Add README.md, CONTRIBUTING.md and CHANGELOG.md to pre-bundled releases 2018-02-24 13:19:04 +01:00
Daniel Rudolf
9c182bd756
Add Lighttpd config to sample contents
Thanks @tony5 for bringing this up and testing!
2018-02-03 18:33:48 +01:00
Daniel Rudolf
03cc10183c
Fix page tree 2018-01-31 12:29:59 +01:00
Daniel Rudolf
a58bfc567e
Improve inline docs 2018-01-28 14:25:13 +01:00
Daniel Rudolf
25bfa289cf
Inline docs: Update nginx rewrite rules to match .htaccess
nginx's rewrite rules don't have to match `picocms/Pico`'s `.htaccess`, but `picocms/pico-composer`'s `.htaccess` - because basically all installations of Pico 2.0 and later use `picocms/pico-composer`'s frame.
2018-01-27 21:08:56 +01:00
Daniel Rudolf
6bb65fb12b
Deny access to composer.phar in .htaccess
This file might be present if users strictly follow our install instructions
 and don't delete it on their own after successfully installing Pico.
2018-01-27 21:03:45 +01:00
Daniel Rudolf
b6bd714e52
README.md: Add Pico 2.0 install/upgrade instructions 2018-01-27 21:03:06 +01:00
Daniel Rudolf
e079946e6f
Build system: Don't delete .gitignore when creating release archives
It doesn't make much sense to remove all .gitignore files just to explain users that they should create those files if they want to manage their website using a Git repository.
2018-01-27 21:02:06 +01:00
Daniel Rudolf
604ee70d27
Version 2.0.0-beta.2
```
* [New] Improve release & build process and move most build tools to the new
        `picocms/ci-tools` repo, allowing them to be used by other projects
* [New] Add page tree; refer to the `Pico::buildPageTree()` method for more
        details; also see the `onPageTreeBuilt` event
* [Changed] Update dependencies: Twig 1.35
* [Changed] ! Improve `.htaccess` and deny access to all dot files by default
* [Changed] ! Throw a `RuntimeException` when non-native plugins are loaded,
            but Pico's `PicoDeprecated` plugin is not loaded
* [Changed] ! Change `AbstractPicoPlugin::$enabled`'s behavior: setting it to
            TRUE now leads to throwing a `RuntimeException` when the plugin's
            dependencies aren't fulfilled; use NULL to maintain old behavior
* [Changed] ! Force themes to use `.twig` as file extension for Twig templates
* [Changed] Improve PHP class docs
* [Changed] Various small improvements
```
2018-01-21 23:31:25 +01:00
Daniel Rudolf
fb7d99d3da
Update CHANGELOG.md 2018-01-21 23:31:06 +01:00
Daniel Rudolf
c697ec2e5c
Update CHANGELOG.md for Pico v2.0.0-beta.1 and upcoming v2.0.0-beta.2 2018-01-21 23:07:10 +01:00
Daniel Rudolf
888190f15a
Various small improvements 2018-01-21 23:06:38 +01:00
Daniel Rudolf
b129a4fb12
Various small improvements 2017-12-27 21:36:56 +01:00
Daniel Rudolf
afd0a4d7a3
Change AbstractPicoPlugin::$enabled's behavior
AbstractPicoPlugin::$enabled now defaults to NULL what leaves the decision whether a plugin should be enabled or disabled by default up to Pico (precisely AbstractPicoPlugin::triggerEvent()). If all dependencies of a plugin are fulfilled, Pico enables the plugin by default. Otherwise the plugin is silently disabled (this was the behavior when AbstractPicoPlugin::$enabled was set to TRUE previously).

If a plugin should never be disabled *silently* (e.g. when dealing with security-relevant stuff like access control, or similar), set AbstractPicoPlugin::$enabled to TRUE. If Pico can't fulfill all the plugin's dependencies, it will throw an RuntimeException.

If a plugin rather does some "crazy stuff" a user should really be aware of before using it, you can set AbstractPicoPlugin::$enabled to FALSE. The user will then have to enable the plugin manually. However, if another plugin depends on this plugin, it might get enabled silently nevertheless.

No matter what, the user can always explicitly enable or disable a plugin in Pico's config.
2017-12-27 21:36:08 +01:00
Daniel Rudolf
1ce1780a86
Build system: Fix release deployment 2017-12-24 14:21:32 +01:00
Daniel Rudolf
e517eac396
Improve .htaccess regex
Deny access to all dot files and dirs by default (except .well-known)

Update nginx rules accordingly and pass denied requests to Pico rather than letting nginx send a 404 response
2017-12-24 13:58:42 +01:00
Daniel Rudolf
a1dcf54683
Add .github/PULL_REQUEST_TEMPLATE.md 2017-12-02 17:55:29 +01:00
Daniel Rudolf
68b71103e9
Merge branch 'master' into pico-1.1
Conflicts:
	.gitattributes
	CONTRIBUTING.md
2017-12-02 17:48:34 +01:00
Daniel Rudolf
722de2a1e5
Build system: Refactor scripts to use picocms/ci-tools 2017-12-02 17:21:03 +01:00
Daniel Rudolf
0c83f360a8
Build system: Move _build/tools directory to a separate repo
See https://github.com/picocms/ci-tools
2017-12-02 17:03:25 +01:00
Daniel Rudolf
d2055d0e28
Update CONTRIBUTING.md 2017-11-28 18:23:48 +01:00
Daniel Rudolf
6dd41abf7a
Add '/.github export-ignore' to .gitattributes 2017-11-28 17:20:22 +01:00
Daniel Rudolf
9834e839ef
Update CONTRIBUTING.md 2017-11-28 17:18:18 +01:00
Daniel Rudolf
4c7de5b97e
Add .github/stale.yml
After resolving a issue, we usually keep it open for about a week to give users some more time for feedback and further questions. This is especially true for issues with the `type: Notice`, `type: Question`, `type: Discussion` and `type: Invalid` labels. After 7 days with no interaction, [Probot](https://probot.github.io/)'s [Stale](https://probot.github.io/apps/stale/) bot (@probot-stale) adds the `info: Stale` label to the issue to ask the participants whether the issue has been resolved. If no more activity occurs, the issue will be automatically closed by @probot-stale 2 days later.
2017-11-28 17:12:00 +01:00
Daniel Rudolf
37dfe0e6ef
Force themes to use .twig as file extension
We recommend plugin developers to use templates when serving HTML contents (like the UI of PicoAdmin), however, by supporting multiple file extensions for themes, we make it pretty hard to overwrite a plugin's template with a theme. As always, we preserve BC using PicoDeprecated.
2017-11-25 21:52:03 +01:00
Daniel Rudolf
a192a42de5
Travis CI: Add PHP 7.2 2017-11-25 21:47:20 +01:00
Daniel Rudolf
28d2648ba0
Add Pico::buildPageTree()
Pico's page tree is a list of all the tree's branches (no matter the depth). Thus, by iterating a array element, you get the nodes of a given branch. All leaf nodes do represent a page, but inner nodes may or may not represent a page (e.g. if there's a `sub/page.md`, but neither a `sub/index.md` nor a `sub.md`, the inner node `sub`, that is the parent of the `sub/page` node, represents no page itself).

A page's file path describes its node's path in the tree (e.g. the page `sub/page.md` is represented by the `sub/page` node, thus a child of the `sub` node and a element of the `sub` branch). However, the index page of a folder (e.g. `sub/index.md`), is *not* a node of the `sub` branch, but rather of the `/` branch. The page's node is not `sub/index`, but `sub`. If two pages are described by the same node (e.g. if both a `sub/index.md` and a `sub.md` exist), the index page takes precedence. Pico's main index page (i.e. `index.md`) is represented by the tree's root node `/` and a special case: it is the only node of the `` (i.e. the empty string) branch.

A node is represented by an array with the keys `id`, `page` and `children`. The `id` key contains a string with the node's name. If the node represents a page, the `page` key is a reference to the page's data array. If the node is a inner node, the `children` key is a reference to its matching branch (i.e. a list of the node's children). The order of a node's children matches the order in Pico's pages array.

If you want to walk the whole page tree, start with the tree's root node at `$pageTree[""]["/"]`. The root node's `children` key is a reference to the `/` branch at `$pageTree["/"]`, that is a list of the root node's direct child nodes and their siblings.

You MUST NOT iterate the page tree itself (i.e. the list of the tree's branches), its order is undefined and the array will be replaced by a non-iterable data structure with Pico 3.0.
2017-11-18 18:34:57 +01:00
Daniel Rudolf
3846d3b685
Various small improvements 2017-11-18 18:28:02 +01:00
Daniel Rudolf
f5f38a7b0b
DummyPlugin: Improve phpDoc class docs 2017-11-18 18:27:20 +01:00
Daniel Rudolf
22aa688bf4
Version 2.0.0-beta.1 2017-11-05 18:28:25 +01:00
Daniel Rudolf
1cd6e241f0
Prepare v2.0.0-beta.1 2017-11-05 18:28:11 +01:00
Daniel Rudolf
66bb17a419
Build system: Make sure to create release archive in $TRAVIS_BUILD_DIR 2017-11-05 18:28:01 +01:00
Daniel Rudolf
46a6ff183d
Don't ignore index.php.dist when exporting Git repo
We need this file to create Pico's pre-built release archives
2017-11-05 18:02:17 +01:00
Daniel Rudolf
619ae9d0d0
Add Developer Certificate of Origin to CONTRIBUTING.md 2017-11-05 14:08:56 +01:00
Daniel Rudolf
4fb0b408e2
Build system: Improve and fix deployment 2017-11-05 02:36:50 +01:00
Daniel Rudolf
6e88e7ffbb
Build system: Disable Travis IRC notifications 2017-11-04 23:52:20 +01:00
Daniel Rudolf
1afc495584
Build system: Remove cloc release statistics 2017-11-04 22:49:02 +01:00
Daniel Rudolf
da0d4c3054
Build system: Add tools/github-commit.sh 2017-11-04 22:47:47 +01:00
Daniel Rudolf
ae99e0c2cd
Merge branch 'master' into pico-1.1
Conflicts:
	lib/Pico.php
2017-11-04 21:12:00 +01:00
Daniel Rudolf
e8a19cb2f9
Fix Pico::parseFileMeta() 2017-11-04 20:49:41 +01:00
Daniel Rudolf
cc47043570
Update README.md screenshot 2017-11-04 18:41:17 +01:00
Daniel Rudolf
2a30c4664f
Build system: Add config/config.yml.template to release archives 2017-11-04 18:41:05 +01:00
Daniel Rudolf
dfed9cc51f
Build system: Create GitHub releases as draft 2017-10-28 22:53:25 +02:00
Daniel Rudolf
c71169adbe
Update CONTRIBUTING.md 2017-10-28 22:52:47 +02:00
Daniel Rudolf
0532fef5fe
Update composer dependencies 2017-10-28 22:52:18 +02:00