2017-03-01 36 views
0

私のヒーローでは、postgre addonをデータベースとして使用しています。私のcakephp 3アプリでは、ファイルapp.phpを変更し、heroku postgreデータベースへの接続を設定します。私のCakePHPのアプリのすべてがうまくローカルホスト上で実行されますが、私はenv('DEBUG', true)env('DEBUG', false)に内部エラーを示すサーバーページをapp.phpのファイルを変更する場合はHerokuのサーバ上で、ページがherokuでCakephpクラス 'DebugBarFilter'が見つかりません

Class'DebugKit\Routing\Filter\DebugBarFilter' not found 
Error in: ROOT/plugins/DebugKit/config/bootstrap.php, line 21 

を示します。

私はHerokuにもmysqlをインストールする必要がありますか? DebugKitプラグインはデフォルトでそれを使用しているからですか?それとも、エラーが表示されないようにDebugKitをアンインストール/スキップすることができますか?私は本当に私のサーバー上でDebugKitプラグインが必要ないからです。以下は私のbootstrap.phpファイルです:

<?php 
/** 
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) 
* 
* Licensed under The MIT License 
* For full copyright and license information, please see the LICENSE.txt 
* Redistributions of files must retain the above copyright notice. 
* 
* @copyright  Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) 
* @link   http://cakephp.org CakePHP(tm) Project 
* @license  http://www.opensource.org/licenses/mit-license.php MIT License 
*/ 
use Cake\Core\Configure; 
use Cake\Core\Plugin; 
use Cake\Datasource\ConnectionManager; 
use Cake\Event\EventManager; 
use Cake\Log\Log; 
use Cake\Routing\DispatcherFactory; 
use DebugKit\Routing\Filter\DebugBarFilter; 
$debugBar = new DebugBarFilter(EventManager::instance(), (array)Configure::read('DebugKit')); 
if (!$debugBar->isEnabled() || php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg') { 
    return; 
} 
$hasDebugKitConfig = ConnectionManager::config('debug_kit'); 
if (!$hasDebugKitConfig && !in_array('sqlite', PDO::getAvailableDrivers())) { 
    $msg = 'DebugKit not enabled. You need to either install pdo_sqlite, ' . 
     'or define the "debug_kit" connection name.'; 
    Log::warning($msg); 
    return; 
} 
if (!$hasDebugKitConfig) { 
    ConnectionManager::config('debug_kit', [ 
     'className' => 'Cake\Database\Connection', 
     'driver' => 'Cake\Database\Driver\Sqlite', 
     'database' => TMP . 'debug_kit.sqlite', 
     'encoding' => 'utf8', 
     'cacheMetadata' => true, 
     'quoteIdentifiers' => false, 
    ]); 
} 
if (Plugin::routes('DebugKit') === false) { 
    require __DIR__ . DS . 'routes.php'; 
} 
// Setup toolbar 
$debugBar->setup(); 
DispatcherFactory::add($debugBar); 

答えて

0

ソリューションが見つかり、

Plugin::load('DebugKit', ['bootstrap' => true]); 
0

あなたはまた、すべてのプラグインをロードするには

Plugin::loadAll(); 

を使用することができ、このファイルに以下の行をコメントアウト

関連する問題