From 9585939d9fd6c105e12570668fc920f833662953 Mon Sep 17 00:00:00 2001 From: Hisateru Tanaka Date: Wed, 8 Jun 2016 19:39:25 +0900 Subject: [PATCH 01/28] Fixes #11723: Fixed PHP 7 + XDebug error handling displaying "Expected array for frame 0" --- framework/CHANGELOG.md | 1 + framework/base/ErrorException.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 55db3db..535c4ec 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -27,6 +27,7 @@ Yii Framework 2 Change Log - Bug #11527: Fixed `bigPrimaryKey()` for SQLite (dynasource) - Bug #11686: `BaseArrayHelper::isIn()` comparison did not work in strict mode (taobig) - Enh #11679: Extracted `CheckAccessInterface` from `ManagerInterface` (SamMousa, samdark, mdomba) +- Bug #11723: Fixed PHP 7 + XDebug error handling displaying "Expected array for frame 0" (tanakahisateru) 2.0.8 April 28, 2016 diff --git a/framework/base/ErrorException.php b/framework/base/ErrorException.php index ec1dc58..d9da27b 100644 --- a/framework/base/ErrorException.php +++ b/framework/base/ErrorException.php @@ -43,8 +43,11 @@ class ErrorException extends \ErrorException parent::__construct($message, $code, $severity, $filename, $lineno, $previous); if (function_exists('xdebug_get_function_stack')) { - $trace = array_slice(array_reverse(xdebug_get_function_stack()), 3, -1); - foreach ($trace as &$frame) { + // XDebug trace can't be modified and used directly with PHP 7 + // @see https://github.com/yiisoft/yii2/pull/11723 + $xDebugTrace = array_slice(array_reverse(xdebug_get_function_stack()), 3, -1); + $trace = []; + foreach ($xDebugTrace as $frame) { if (!isset($frame['function'])) { $frame['function'] = 'unknown'; } @@ -60,6 +63,7 @@ class ErrorException extends \ErrorException if (isset($frame['params']) && !isset($frame['args'])) { $frame['args'] = $frame['params']; } + $trace[] = $frame; } $ref = new \ReflectionProperty('Exception', 'trace'); From b6a05929039dccabf47e1ab60a7137404c9f1f8a Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Thu, 9 Jun 2016 14:33:13 +0200 Subject: [PATCH 02/28] fixed broken links in the guide --- docs/documentation_style_guide.md | 13 ++++++++++++- docs/guide-es/concept-aliases.md | 2 +- docs/guide-es/runtime-routing.md | 2 +- docs/guide-es/structure-controllers.md | 2 +- docs/guide-ja/structure-assets.md | 2 +- docs/guide-ja/tutorial-i18n.md | 2 +- docs/guide-pl/input-validation.md | 2 +- docs/guide-pt-BR/caching-http.md | 2 +- docs/guide-pt-BR/output-data-providers.md | 2 +- docs/guide-ru/concept-aliases.md | 2 +- docs/guide-zh-CN/concept-events.md | 2 +- docs/guide-zh-CN/db-dao.md | 2 +- docs/guide-zh-CN/rest-response-formatting.md | 4 ++-- docs/guide-zh-CN/structure-assets.md | 2 +- docs/guide-zh-CN/structure-views.md | 2 +- docs/guide-zh-CN/structure-widgets.md | 2 +- docs/guide/tutorial-i18n.md | 2 +- 17 files changed, 29 insertions(+), 18 deletions(-) diff --git a/docs/documentation_style_guide.md b/docs/documentation_style_guide.md index ad8ef1a..846fade 100644 --- a/docs/documentation_style_guide.md +++ b/docs/documentation_style_guide.md @@ -51,4 +51,15 @@ containing the translations. The following shows an example for german: ## Capitalizations * Web, not web -* the guide or this guide, not the Guide \ No newline at end of file +* the guide or this guide, not the Guide + +## validating the docs + +The following are some scripts that help find broken links and other issues in the guide: + +Find broken links (some false-positives may occur): + + grep -rniP "\[\[[^\],']+?\][^\]]" docs/guide* + grep -rniP "[^\[]\[[^\]\[,']+?\]\]" docs/guide* + + \ No newline at end of file diff --git a/docs/guide-es/concept-aliases.md b/docs/guide-es/concept-aliases.md index 743eccf..a44566d 100644 --- a/docs/guide-es/concept-aliases.md +++ b/docs/guide-es/concept-aliases.md @@ -112,7 +112,7 @@ utilizadas regularmente. La siguiente es la lista de alias predefinidos por Yii: - `@runtime`: la [[yii\base\Application::runtimePath|ruta de ejecución]] de la aplicación en ejecución. Por defecto `@app/runtime`. - `@webroot`: el directorio raíz Web de la aplicación Web se está ejecutando actualmente. - `@web`: la URL base de la aplicación web se ejecuta actualmente. Tiene el mismo valor que [[yii\web\Request::baseUrl]]. -- `@vendor`: el [[yii\base\Application::vendorPath|directorio vendor de Composer]. Por defecto `@app/vendor`. +- `@vendor`: el [[yii\base\Application::vendorPath|directorio vendor de Composer]]. Por defecto `@app/vendor`. - `@bower`, el directorio raíz que contiene [paquetes bower](http://bower.io/). Por defecto `@vendor/bower`. - `@npm`, el directorio raíz que contiene [paquetes npm](https://www.npmjs.org/). Por defecto `@vendor/npm`. diff --git a/docs/guide-es/runtime-routing.md b/docs/guide-es/runtime-routing.md index 403587a..6c12ebd 100644 --- a/docs/guide-es/runtime-routing.md +++ b/docs/guide-es/runtime-routing.md @@ -152,7 +152,7 @@ echo Url::to(['post/index'], 'https'); Hay que tener en cuenta que en el anterior ejemplo, asumimos que se está usando el formato de URL predeterminado. Si habilita el formato de URL amigable, las URLs creadas serán diferentes, de acuerdo con las -[[yii\web\UrlManager::rules|URL rules] que se usen. +[[yii\web\UrlManager::rules|URL rules]] que se usen. La ruta que se pasa al método [[yii\helpers\Url::to()]] es context sensitive. Esto quiere decir que puede ser una ruta *relativa* o una ruta *absoluta* que serán tipificadas de acuerdo con las siguientes reglas: diff --git a/docs/guide-es/structure-controllers.md b/docs/guide-es/structure-controllers.md index 4758300..c9fb8b0 100644 --- a/docs/guide-es/structure-controllers.md +++ b/docs/guide-es/structure-controllers.md @@ -312,7 +312,7 @@ los usuarios. * Para [[yii\web\Application|aplicaciones Web]], el valor de retorno pueden ser también datos arbitrarios que serán asignados a [[yii\web\Response::data]] y más adelante convertidos a una cadena representando el cuerpo de la respuesta. -* Para [[yii\console\Application|aplicaciones de consola], el valor de retorno puede ser también un entero representando +* Para [[yii\console\Application|aplicaciones de consola]], el valor de retorno puede ser también un entero representando el [[yii\console\Response::exitStatus|status de salida]] de la ejecución del comando. En los ejemplos mostrados arriba, los resultados de las acciones son todas cadenas que serán tratadas como el cuerpo de la respuesta diff --git a/docs/guide-ja/structure-assets.md b/docs/guide-ja/structure-assets.md index 49cad1b..8f6e799 100644 --- a/docs/guide-ja/structure-assets.md +++ b/docs/guide-ja/structure-assets.md @@ -218,7 +218,7 @@ AppAsset::register($this); // $this はビューオブジェクトを表す アセットバンドルがビューに登録されるとき、舞台裏では、依存している全てのアセットバンドルが Yii によって登録されます。 そして、アセットバンドルがウェブからはアクセス出来ないディレクトリに配置されている場合は、アセットバンドルがウェブディレクトリに発行されます。 その後、ビューがページをレンダリングするときに、登録されたバンドルのリストに挙げられている CSS と JavaScript ファイルのための `` タグと `