久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

CakePHP:從 3.6.x 升級到 4.0“缺少模板異常"

CakePHP: upgrade from 3.6.x to 4.0 quot;Missing Template Exceptionquot;(CakePHP:從 3.6.x 升級到 4.0“缺少模板異常)
本文介紹了CakePHP:從 3.6.x 升級到 4.0“缺少模板異常"的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我遵循了升級指南(在我從 3.6 升級到 3.8 之后)但我收到這個錯誤:

I followed the upgrade guide (after I upgraded from 3.6 to 3.8) but I get this error:

錯誤:[CakeViewExceptionMissingTemplateException] 模板文件Errorerror500.ctp";不見了

Error: [CakeViewExceptionMissingTemplateException] Template file "Errorerror500.ctp" is missing

....

如果要自定義此錯誤消息,請創建 srcTemplateErrorfatal_error.ctp

在升級過程之后,我的模板移動到 app_name emplates 目錄并重命名為 *.php 而不是 *.ctp .我用新路徑更新了 app.phpapp.default.php :

After the upgrade procedure my templates moved to app_name emplates directory and renamed to *.php instead of *.ctp . I updated the app.php and app.default.php with the new paths:

'App' => [
        'namespace' => 'App',
        'encoding' => env('APP_ENCODING', 'UTF-8'),
        'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'),
        'defaultTimezone' => env('APP_DEFAULT_TIMEZONE', 'UTC'),
        'base' => false,
        'dir' => 'src',
        'webroot' => 'webroot',
        'wwwRoot' => WWW_ROOT,
        //'baseUrl' => env('SCRIPT_NAME'),
        'fullBaseUrl' => false,
        'imageBaseUrl' => 'img/',
        'cssBaseUrl' => 'css/',
        'jsBaseUrl' => 'js/',
        'paths' => [
            'plugins' => [ROOT . DS . 'plugins' . DS],
            'templates' => [ROOT . DS . 'templates' . DS],
            'locales' => [ROOT . DS  . 'Locale' . DS],
        ],
    ],

但應用程序仍然在尋找帶有 .ctp 擴展名和 srcTemplate...

But still the application is looking for the template files with .ctp extension and under srcTemplate...

我錯過了什么?

推薦答案

根據我的經驗:

將 CakePHP 3.x 升級到 4.x

  • 作曲家更新
  • 從 --level 0 到 2 運行 phpstan 并在審查器中修復您的代碼或測試
  • 閱讀 4.0 遷移指南:https://book.cakephp.org/4/en/appendices/4-0-migration-guide.html
  • 閱讀 4.0 升級指南:https://book.cakephp.org/4/en/appendices/4-0-upgrade-guide.html步驟:
  • 安裝升級工具
  • 重命名語言環境文件
  • 重命名模板文件
  • 重命名模板和區域設置文件后,請確保將 App.paths.locales 和 App.paths.templates 路徑更新為正確.
  • 從您的應用程序編寫器文件中刪除所有 cakephp/* (cakephp3) 包,還有 phpstan、代碼標準、phpunit、.. 運行 composer update
  • 應用 Rector 重構
  • composer require --update-with-dependencies "phpunit/phpunit:^8.0"
  • composer require --update-with-dependencies "cakephp/cakephp:4.0.*"
  • 在您的應用程序文件夾中安裝新的 cakephp4.示例:mkdir cakephp4 &&cd cakeph4;并運行 composer create-project --prefer-dist cakephp/app:4.* .;
  • 將舊的 cakephp 文件與 cakephp4 文件夾中的文件進行比較,更新所有文件并復制丟失的文件
  • 刪除 cakephp4 和升級文件夾
  • 不要忘記在你的 php 文件頂部添加 <?php declare(strict_types=1);
  • composer cs-check 然后 composer cs-fix
  • composer update
  • run phpstan from --level 0 to 2 and fix your code or test in scrutinizer
  • read 4.0 Migration Guide : https://book.cakephp.org/4/en/appendices/4-0-migration-guide.html
  • read 4.0 Upgrade Guide : https://book.cakephp.org/4/en/appendices/4-0-upgrade-guide.html Steps:
  • Install the upgrade tool
  • Rename locale files
  • Rename template files
  • Once you've renamed your template and locale files, make sure you update App.paths.locales and App.paths.templates paths to be correct.
  • From your app composer file remove all cakephp/* (cakephp3) packages, also phpstan, code standards, phpunit,.. run composer update
  • Applying Rector Refactorings
  • composer require --update-with-dependencies "phpunit/phpunit:^8.0"
  • composer require --update-with-dependencies "cakephp/cakephp:4.0.*"
  • Install fresh cakephp4 inside your app folder. Example: mkdir cakephp4 && cd cakeph4; and run composer create-project --prefer-dist cakephp/app:4.* .;
  • compare your old cakephp files with files from cakephp4 folder, update all and copy missing files
  • delete cakephp4 and upgrade folders
  • don't forget at top of you php files to add <?php declare(strict_types=1);
  • composer cs-check then composer cs-fix

這篇關于CakePHP:從 3.6.x 升級到 4.0“缺少模板異常"的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Cannot use #39;Object as class name as it is reserved Cake 2.2.x(不能使用 Object 作為類名,因為它是保留的 Cake 2.2.x)
Session is lost after an OAuth redirect(OAuth 重定向后會話丟失)
Pagination Sort in Cakephp 3.x(Cakephp 3.x 中的分頁排序)
CakePHP Shared core for multiple apps(CakePHP 多個應用程序的共享核心)
Login [ Auth-gt;identify() ] always false on CakePHP 3(在 CakePHP 3 上登錄 [ Auth-identify() ] 始終為 false)
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 87 bytes)(致命錯誤:允許的內存大小為 134217728 字節已用盡(嘗試分配 87 字節))
主站蜘蛛池模板: 日韩精品色网 | 亚洲久久一区 | 久久国产精品久久久久久久久久 | 国产一区免费 | 久久中文字幕一区 | 91久久精品一区二区三区 | 91在线网站| 久久久久久国产精品免费免费狐狸 | 91亚洲一区 | 日韩视频在线免费观看 | av网站在线播放 | 国产一区二区免费电影 | 亚洲在线中文字幕 | 国产美女特级嫩嫩嫩bbb片 | 一区二区三区在线播放 | 一级做a爰片性色毛片16美国 | 真人女人一级毛片免费播放 | 久久精品国产一区 | 久久久精品一区二区三区 | 精品国产黄a∨片高清在线 成人区精品一区二区婷婷 日本一区二区视频 | 日韩视频在线观看一区二区 | 一区日韩| 久久久国产一区二区三区四区小说 | caoporn国产精品免费公开 | 91午夜在线| 欧美一级免费看 | 日韩午夜网站 | 国产亚洲精品精品国产亚洲综合 | 国产视频一区二区在线观看 | 在线免费黄色小视频 | 久久网一区二区三区 | 伊人二区 | 免费v片 | 日韩久久精品电影 | 日韩在线一区视频 | 在线一区视频 | 亚洲a视频 | 一区二区三区四区在线免费观看 | 91麻豆精品国产91久久久更新资源速度超快 | 国产精品视频综合 | 欧美色性|