Skip to content

Commit

Permalink
Merge branch 'release/1.6.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed May 9, 2019
2 parents 9da054f + 954d4cd commit 1b6bd6a
Show file tree
Hide file tree
Showing 15 changed files with 670 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v1.6.2
## 05/09/2019

1. [](#new)
* Fixed a few issues found by phpstan
* Added `ru` and `uk` translations [#36](https://github.com/getgrav/grav-plugin-error/pull/36)

# v1.6.1
## 03/09/2018

Expand Down
4 changes: 2 additions & 2 deletions blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Error
version: 1.6.1
version: 1.6.2
description: Displays the error page.
icon: warning
author:
Expand Down Expand Up @@ -28,5 +28,5 @@ form:
routes.404:
type: text
size: medium
label: 404 Route
label: PLUGIN_ERROR.ROUTE_404
default: '/error'
2 changes: 1 addition & 1 deletion cli/LogCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected function serve()
}

/**
* @param $line
* @param string $line
*
* @return null|string
*/
Expand Down
39 changes: 39 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "getgrav/grav-plugin-error",
"type": "grav-plugin",
"description": "Error plugin for Grav CMS",
"keywords": ["error", "plugin"],
"homepage": "https://github.com/getgrav/grav-plugin-error",
"license": "MIT",
"authors": [
{
"name": "Team Grav",
"email": "[email protected]",
"homepage": "https://getgrav.org",
"role": "Developer"
}
],
"support": {
"issues": "https://github.com/getgrav/grav-plugin-error/issues",
"irc": "https://chat.getgrav.org",
"forum": "https://getgrav.org/forum",
"docs": "https://github.com/getgrav/grav-plugin-error/blob/master/README.md"
},
"autoload": {
"psr-4": {
"Grav\\Plugin\\Console\\": "cli/"
},
"classmap": [
"error.php"
]
},
"config": {
"platform": {
"php": "7.1.3"
}
},
"scripts": {
"test": "vendor/bin/codecept run unit",
"test-windows": "vendor\\bin\\codecept run unit"
}
}
27 changes: 23 additions & 4 deletions error.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
namespace Grav\Plugin;

use Composer\Autoload\ClassLoader;
use Grav\Common\Plugin;
use Grav\Common\Grav;
use Grav\Common\Page\Page;
use Grav\Common\Page\Pages;
use Grav\Common\Page\Types;
Expand All @@ -16,12 +16,31 @@ class ErrorPlugin extends Plugin
public static function getSubscribedEvents()
{
return [
'onPageNotFound' => ['onPageNotFound', 0],
'onGetPageTemplates' => ['onGetPageTemplates', 0],
'onTwigTemplatePaths' => ['onTwigTemplatePaths', -10]
'onCliInitialize' => [
['autoload', 100000],
],
'onPageNotFound' => [
['onPageNotFound', 0]
],
'onGetPageTemplates' => [
['onGetPageTemplates', 0]
],
'onTwigTemplatePaths' => [
['onTwigTemplatePaths', -10]
]
];
}

/**
* [onPluginsInitialized:100000] Composer autoload.
*
* @return ClassLoader
*/
public function autoload()
{
return require __DIR__ . '/vendor/autoload.php';
}

/**
* Display error page if no page was found for the current route.
*
Expand Down
7 changes: 7 additions & 0 deletions languages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ en:
PLUGIN_ERROR:
ERROR: "Error"
ERROR_MESSAGE: "Woops. Looks like this page doesn't exist."
ROUTE_404: "404 Route"
de:
PLUGIN_ERROR:
ERROR: "Fehler"
Expand All @@ -26,6 +27,12 @@ ru:
PLUGIN_ERROR:
ERROR: "Ошибка"
ERROR_MESSAGE: "Упс. Похоже, этой страницы не существует."
ROUTE_404: "Маршрут 404"
uk:
PLUGIN_ERROR:
ERROR: "Помилка"
ERROR_MESSAGE: "Упс. Схоже, цієї сторінки не існує."
ROUTE_404: "Маршрут 404"
da:
PLUGIN_ERROR:
ERROR: "Fejl"
Expand Down
7 changes: 7 additions & 0 deletions vendor/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit4e2f762c713c4d4aae8969c74f5623a3::getLoader();
Loading

0 comments on commit 1b6bd6a

Please sign in to comment.