[EC-CUBE] EC-CUBE3.0.17
[PHP] 5.6.40
[データベース] MySQL 5.7.27
[WEBサーバ] Apache
[導入プラグインの有無]
イプシロン決済モジュール(3.0系)
[現象]
イプシロン決済プラグインの新規ページ(コンビニ決済のコンビニ選択ページ)で、ヘッダ・フッタが表示されません。
dtb_page_layoutに追加されたページ情報が登録されていないのが原因のようですが、
登録方法を解説しているサイトは複数あるものの、どこも新規の自作プラグインを想定しております。
当方PHP知識がほぼなく、今回のような既存プラグインのPluginManager.phpへの正しい追記方法が分からず困っております。
下記のPluginManager.phpの場合、どのように挿入すれば宜しいのか教えて頂けないでしょうか。
イプシロン決済プラグインの現状のPluginManager.php
<?php
namespace Plugin\GmoEpsilon;
use Eccube\Plugin\AbstractPluginManager;
use Symfony\Component\Filesystem\Filesystem;
class PluginManager extends AbstractPluginManager
{
public function __construct()
{
// コピー元のディレクトリ
$this->origin = __DIR__ . '/Resource/assets';
// コピー先のディレクトリ
$this->target = __DIR__ . '/../../../html';
}
public function install($config, $app)
{
$this->migrationSchema($app, __DIR__ . '/Migration', $config['code']);
// リソースファイルのコピー
$this->copyAssets();
}
public function uninstall($config, $app)
{
$this->migrationSchema($app, __DIR__ . '/Migration', $config['code'], 0);
// リソースファイルの削除
$this->removeAssets();
}
public function enable($config, $app)
{
}
public function disable($config, $app)
{
}
public function update($config, $app)
{
$this->migrationSchema($app, __DIR__ . '/Migration', $config['code']);
// リソースファイルのコピー
$this->copyAssets();
}
/**
* ファイルをコピー
*/
private function copyAssets()
{
$file = new Filesystem();
$file->mirror($this->origin, $this->target);
}
/**
* コピーしたファイルを削除
*/
private function removeAssets()
{
$file = new Filesystem();
$file->remove($this->target . '/epsilon_recv.php');
$file->remove($this->target . '/epsilon_pay_complete.php');
}
}
引用元:
https://gist.github.com/kurozumi/5d98a761bee251ded81a389f5d212413【EC-CUBE3】プラグインを有効化したときにdtb_page_layoutにページ情報を登録
<?php
/*
* This file is part of the SamplePlugin
*
* Copyright (C) 2017 サンプルプラグイン
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Plugin\SamplePlugin;
use Eccube\Application;
use Eccube\Plugin\AbstractPluginManager;
class PluginManager extends AbstractPluginManager
{
/**
* プラグインインストール時の処理
*
* @param $config
* @param Application $app
* @throws \Exception
*/
public function install($config, Application $app)
{
}
/**
* プラグイン削除時の処理
*
* @param $config
* @param Application $app
*/
public function uninstall($config, Application $app)
{
$this->migrationSchema($app, __DIR__.'/Resource/doctrine/migration', $config['code'], 0);
}
/**
* プラグイン有効時の処理
*
* @param $config
* @param Application $app
* @throws \Exception
*/
public function enable($config, Application $app)
{
$this->migrationSchema($app, __DIR__.'/Resource/doctrine/migration', $config['code']);
}
/**
* プラグイン無効時の処理
*
* @param $config
* @param Application $app
* @throws \Exception
*/
public function disable($config, Application $app)
{
}
/**
* プラグイン更新時の処理
*
* @param $config
* @param Application $app
* @throws \Exception
*/
public function update($config, Application $app)
{
$this->migrationSchema($app, __DIR__.'/Resource/doctrine/migration', $config['code']);
}
}