Skip to content

Commit

Permalink
3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier authored Nov 5, 2019
2 parents b884677 + 434ba12 commit 3175afe
Show file tree
Hide file tree
Showing 438 changed files with 8,022 additions and 3,448 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*.sublime-project
*.sublime-workspace
/.vscode
/.idea

# tests
/panel/cypress
Expand Down
4 changes: 2 additions & 2 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
37 changes: 23 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: php
os: linux
dist: bionic
sudo: false
services:
- memcached
Expand All @@ -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
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
26 changes: 13 additions & 13 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions config/aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions config/api/authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,5 +19,5 @@
return $user;
}

throw new PermissionException('Unauthenticated', 403);
throw new PermissionException('Unauthenticated');
};
3 changes: 1 addition & 2 deletions config/api/collections.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
*/
'languages' => [
'model' => 'language',
'type' => 'Kirby\Cms\Languages',
'view' => 'compact'
'type' => 'Kirby\Cms\Languages'
],

/**
Expand Down
24 changes: 9 additions & 15 deletions config/api/models/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions config/api/models/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@
],
'type' => 'Kirby\Cms\Language',
'views' => [
'compact' => [
'default' => [
'code',
'default',
'direction',
'locale',
'name',
'rules',
'direction'
'url'
]
]
];
4 changes: 2 additions & 2 deletions config/api/models/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion config/api/models/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion config/api/models/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
'isInstalled',
'isLocal',
'kirbytext',
'languages' => 'compact',
'languages',
'license',
'multilang',
'requirements',
Expand Down
4 changes: 2 additions & 2 deletions config/api/models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion config/api/routes/files.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
],
[
Expand Down
25 changes: 25 additions & 0 deletions config/components.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
*
Expand Down
Loading

0 comments on commit 3175afe

Please sign in to comment.