この記事で使用したバージョン
アプリ | バージョン | インストールパス | URL |
---|---|---|---|
BaserCMS | 4.0.4 | /public_html | https://cube3.example.jp/ |
BaserCube | 2.0.0 | /public_html/app/Plugin/ | - |
EC-CUBE | 3.0.14 | /public_html/eccube | https://cube3.example.jp/ec/ |
プラグインの設定
app/Plugin/BaserCube/Config/setting.php
$config = array(
'BaserCube' => array(
// EC-CUBE設置PATH: public_html/eccube
// WWW_ROOT . DS となっているが パスがおかしくなるので DS削除
'EcConfigPath' => WWW_ROOT . 'eccube' ,
// EC-CUBE設置URL(Base):
// 設定によりけりだが https の設定変更が必須の場合もあるが
'EcUrl' => 'https://' . $_SERVER['HTTP_HOST'] . '' ,
),
);
テスト環境でエラーとなる場合はこうなる
Event/BaserCubeControllerEventListener.php
// 以下以外にも設定ファイルが存在しない場合のエラーとして出力メッセージの可視レベルが protected のため エラーとなる
// 別のサーバーのDBを使っている場合は必要が無いのだが localhost 設定の場合 接続先ホストが存在しないエラーとなる
$dbConfig = array(
'datasource' => $datasource,
'persistent' => false,
'host' => $ecDatabase['database']['host']?:"localhost",
'port' => $ecDatabase['database']['port'],
'login' => $ecDatabase['database']['user'],
'password' => $ecDatabase['database']['password'],
'database' => $ecDatabase['database']['dbname'],
'schema' => '',
'prefix' => '',
'encoding' => $ecDatabase['database']['charset'],
);