Skip to content
Permalink
Browse files

3.3.0

  • Loading branch information...
bastianallgeier committed Nov 5, 2019
2 parents b884677 + 434ba12 commit 3175afeac359524da0896c4671cc9cffb08eb3e7
Showing 438 changed files with 8,022 additions and 3,448 deletions.
@@ -12,6 +12,7 @@
*.sublime-project
*.sublime-workspace
/.vscode
/.idea

# tests
/panel/cypress
@@ -44,9 +44,9 @@ return PhpCsFixer\Config::create()
'no_useless_return' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha'],
// 'phpdoc_add_missing_param_annotation' => ['only_untyped' => false], // adds params in the wrong order
// 'phpdoc_align' => ['align' => 'vertical'], // added in a second step
'phpdoc_align' => ['align' => 'left'],
'phpdoc_indent' => true,
// 'phpdoc_scalar' => true, // added in a second step
'phpdoc_scalar' => true,
'phpdoc_trim' => true,
'short_scalar_cast' => true,
'single_line_comment_style' => true,
@@ -1,5 +1,6 @@
language: php
os: linux
dist: bionic
sudo: false
services:
- memcached
@@ -8,38 +9,46 @@ php:
- 7.1
- 7.2
- 7.3
- 7.4snapshot
jobs:
allow_failures:
- php: 7.4snapshot

before_install:
- echo yes | pecl install -f apcu
- phpenv config-add ./tests/php.ini
# set up PHP config
- phpenv config-rm xdebug.ini || true # code coverage is generated with PCOV
- phpenv config-add tests/php.ini

# ensure that the Composer config is valid
- composer validate

install:
# Install composer packages, will also trigger dump-autoload
- composer self-update
- composer require phpunit/phpunit ^7
- composer require friendsofphp/php-cs-fixer
- composer install --no-interaction --ignore-platform-reqs
# install Composer packages, will also trigger dump-autoload
- composer require -n --ignore-platform-reqs "phwoolcon/ci-pecl-cacher" "phpunit/phpunit:^7" "pcov/clobber" "friendsofphp/php-cs-fixer" "php-coveralls/php-coveralls"
- composer install -n --ignore-platform-reqs --no-suggest

# Install coveralls.phar
- wget -c -nc --retry-connrefused --tries=0 https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
- chmod +x php-coveralls.phar
- php php-coveralls.phar --version
# install and cache PHP extensions
- ./vendor/bin/ci-pecl-install memcached
- ./vendor/bin/ci-pecl-install pcov

before_script:
- mkdir -p build/logs
- ./vendor/bin/pcov clobber
- ls -al

script:
- composer validate
- ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --config .php_cs --verbose --diff --dry-run
- PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --config .php_cs --verbose --diff --dry-run

after_success:
- travis_retry php php-coveralls.phar -v
- travis_retry ./vendor/bin/php-coveralls -v

cache:
directories:
- vendor
- $HOME/.composer/cache
- $HOME/.php-cs-fixer
- $HOME/pecl_cache

matrix:
fast_finish: true
@@ -1,7 +1,7 @@
{
"name": "getkirby/cms",
"description": "The Kirby 3 core",
"version": "3.2.5",
"version": "3.3.0",
"license": "proprietary",
"keywords": ["kirby", "cms", "core"],
"homepage": "https://getkirby.com",
@@ -40,7 +40,7 @@
}
},
"scripts": {
"analyze": "phpstan analyse src",
"analyze": "phpstan analyse",
"test": "phpunit --stderr --coverage-html=tests/coverage",
"zip": "composer archive --format=zip --file=dist",
"build": "./scripts/build",

Some generated files are not rendered by default. Learn more.

@@ -32,6 +32,9 @@
'database' => 'Kirby\Database\Database',
'db' => 'Kirby\Database\Db',
// exceptions
'errorpageexception' => 'Kirby\Exception\ErrorPageException',
// http classes
'cookie' => 'Kirby\Http\Cookie',
'header' => 'Kirby\Http\Header',
@@ -7,7 +7,7 @@
// csrf token check
if ($auth->type() === 'session' && $auth->csrf() === false) {
throw new PermissionException('Unauthenticated', 403);
throw new PermissionException('Unauthenticated');
}
// get user from session or basic auth
@@ -19,5 +19,5 @@
return $user;
}
throw new PermissionException('Unauthenticated', 403);
throw new PermissionException('Unauthenticated');
};
@@ -27,8 +27,7 @@
*/
'languages' => [
'model' => 'language',
'type' => 'Kirby\Cms\Languages',
'view' => 'compact'
'type' => 'Kirby\Cms\Languages'
],
/**
@@ -48,13 +48,16 @@
return $file->next();
},
'nextWithTemplate' => function (File $file) {
$files = $file->templateSiblings()->sortBy('sort', 'asc');
$files = $file->templateSiblings()->sortBy('sort', 'asc', 'filename', 'asc');
$index = $files->indexOf($file);
return $files->nth($index + 1);
},
'niceSize' => function (File $file) {
return $file->niceSize();
},
'options' => function (File $file) {
return $file->permissions()->toArray();
return $file->panelOptions();
},
'panelIcon' => function (File $file) {
return $file->panelIcon();
@@ -69,32 +72,23 @@
return $file->prev();
},
'prevWithTemplate' => function (File $file) {
$files = $file->templateSiblings()->sortBy('sort', 'asc');
$files = $file->templateSiblings()->sortBy('sort', 'asc', 'filename', 'asc');
$index = $files->indexOf($file);
return $files->nth($index - 1);
},
'niceSize' => function (File $file) {
return $file->niceSize();
},
'panelIcon' => function (File $file) {
return $file->panelIcon();
},
'panelImage' => function (File $file) {
return $file->panelImage();
},
'parent' => function (File $file) {
return $file->parent();
},
'parents' => function (File $file) {
return $file->parents()->flip();
},
'template' => function (File $file) {
return $file->template();
},
'size' => function (File $file) {
return $file->size();
},
'template' => function (File $file) {
return $file->template();
},
'thumbs' => function ($file) {
if ($file->isResizable() === false) {
return null;
@@ -31,12 +31,14 @@
],
'type' => 'Kirby\Cms\Language',
'views' => [
'compact' => [
'default' => [
'code',
'default',
'direction',
'locale',
'name',
'rules',
'direction'
'url'
]
]
];
@@ -27,7 +27,7 @@
return $page->errors();
},
'files' => function (Page $page) {
return $page->files()->sortBy('sort', 'asc');
return $page->files()->sortBy('sort', 'asc', 'filename', 'asc');
},
'hasChildren' => function (Page $page) {
return $page->hasChildren();
@@ -56,7 +56,7 @@
return $page->num();
},
'options' => function (Page $page) {
return $page->permissions()->toArray();
return $page->panelOptions(['preview']);
},
'panelIcon' => function (Page $page) {
return $page->panelIcon();
@@ -24,7 +24,7 @@
return $site->drafts();
},
'files' => function (Site $site) {
return $site->files()->sortBy('sort', 'asc');
return $site->files()->sortBy('sort', 'asc', 'filename', 'asc');
},
'options' => function (Site $site) {
return $site->permissions()->toArray();
@@ -98,7 +98,7 @@
'isInstalled',
'isLocal',
'kirbytext',
'languages' => 'compact',
'languages',
'license',
'multilang',
'requirements',
@@ -24,7 +24,7 @@
return $user->email();
},
'files' => function (User $user) {
return $user->files()->sortBy('sort', 'asc');
return $user->files()->sortBy('sort', 'asc', 'filename', 'asc');
},
'id' => function (User $user) {
return $user->id();
@@ -39,7 +39,7 @@
return $user->next();
},
'options' => function (User $user) {
return $user->permissions()->toArray();
return $user->panelOptions();
},
'permissions' => function (User $user) {
return $user->role()->permissions()->toArray();
@@ -27,7 +27,7 @@
'pattern' => '(:all)/files',
'method' => 'GET',
'action' => function (string $path) {
return $this->parent($path)->files()->sortBy('sort', 'asc');
return $this->parent($path)->files()->sortBy('sort', 'asc', 'filename', 'asc');
}
],
[
@@ -6,6 +6,7 @@
use Kirby\Cms\FileVersion;
use Kirby\Cms\Template;
use Kirby\Data\Data;
use Kirby\Http\Server;
use Kirby\Image\Darkroom;
use Kirby\Text\Markdown;
use Kirby\Text\SmartyPants;
@@ -26,6 +27,30 @@
return $url;
},
/**
* Object and variable dumper
* to help with debugging.
*
* @param \Kirby\Cms\App $kirby Kirby instance
* @param mixed $variable
* @param bool $echo
* @return string
*/
'dump' => function (App $kirby, $variable, bool $echo = true) {
if (Server::cli() === true) {
$output = print_r($variable, true) . PHP_EOL;
} else {
$output = '<pre>' . print_r($variable, true) . '</pre>';
}
if ($echo === true) {
echo $output;
}
return $output;
},
/**
* Modify URLs for file objects
*

0 comments on commit 3175afe

Please sign in to comment.
You can’t perform that action at this time.