Merge branch 'master' into enhancement/build-release

Conflicts:
	index.php
pico-3.0-alpha
Daniel Rudolf 10 years ago
commit abce8b84b8
  1. 1
      CHANGELOG.md
  2. 13
      index.php
  3. 13
      lib/Pico.php
  4. 20
      plugins/00-PicoDeprecated.php
  5. 8
      plugins/DummyPlugin.php
  6. 3
      themes/default/style.css

@ -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

@ -1,8 +1,21 @@
<?php
// @codingStandardsIgnoreFile
// check PHP version
if (version_compare(PHP_VERSION, '5.3.6', '<')) {
die('Sorry, Pico requires PHP 5.3.6 or above to run!');
}
// load dependencies
if(is_file(__DIR__ . '/vendor/autoload.php')) {
// composer root package
require_once(__DIR__ . '/vendor/autoload.php');
} elseif(is_file(__DIR__ . '/../../../vendor/autoload.php')) {
// composer dependency package
require_once(__DIR__ . '/../../../vendor/autoload.php');
} else {
die("Cannot find `vendor/autoload.php`. Run `composer install`.");
}
// instance Pico
$pico = new Pico(

@ -1214,14 +1214,13 @@ class Pico
return $baseUrl;
}
if (
(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')
|| ($_SERVER['SERVER_PORT'] == 443)
|| (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
) {
$protocol = 'https';
} else {
$protocol = 'http';
if (!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] !== 'off')) {
$protocol = 'https';
} elseif ($_SERVER['SERVER_PORT'] == 443) {
$protocol = 'https';
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')) {
$protocol = 'https';
}
$this->config['base_url'] =

@ -107,19 +107,17 @@ class PicoDeprecated extends AbstractPicoPlugin
* @see PicoDeprecated::loadRootDirConfig()
* @see PicoDeprecated::enablePlugins()
* @see DummyPlugin::onConfigLoaded()
* @param mixed[] &$realConfig array of config variables
* @param mixed[] &$config array of config variables
* @return void
*/
public function onConfigLoaded(array &$realConfig)
public function onConfigLoaded(array &$config)
{
global $config;
$this->defineConstants();
$this->loadRootDirConfig($realConfig);
$this->loadRootDirConfig($config);
$this->enablePlugins();
$config = &$realConfig;
$GLOBALS['config'] = &$config;
$this->triggerEvent('config_loaded', array(&$realConfig));
$this->triggerEvent('config_loaded', array(&$config));
}
/**
@ -344,8 +342,12 @@ class PicoDeprecated extends AbstractPicoPlugin
*
* @see DummyPlugin::onPagesLoaded()
*/
public function onPagesLoaded(array &$pages, array &$currentPage = null, array &$previousPage = null, array &$nextPage = null)
{
public function onPagesLoaded(
array &$pages,
array &$currentPage = null,
array &$previousPage = null,
array &$nextPage = null
) {
// remove keys of pages array
$plainPages = array();
foreach ($pages as &$pageData) {

@ -270,8 +270,12 @@ final class DummyPlugin extends AbstractPicoPlugin
* @param array|null &$nextPage data of the next page
* @return void
*/
public function onPagesLoaded(array &$pages, array &$currentPage = null, array &$previousPage = null, array &$nextPage = null)
{
public function onPagesLoaded(
array &$pages,
array &$currentPage = null,
array &$previousPage = null,
array &$nextPage = null
) {
// your code
}

@ -285,7 +285,6 @@ blockquote {
/* Small Devices, Tablets */
@media only screen and (max-width : 768px) {
.inner {
width: 85%;
}
@ -324,12 +323,10 @@ blockquote {
#header nav:hover ul {
display: block;
}
}
/* Extra Small Devices, Phones */
@media only screen and (max-width : 480px) {
.inner {
width: 85%;
}

Loading…
Cancel
Save