public function createApplication() { $app = new \Eccube\Application(); $app->initialize(); $app->initializePlugin(); $app->boot(); $paths = array(); $paths[] = $app['config']['template_admin_realdir']; $paths[] = $app['config']['template_realdir']; $paths[] = $app['config']['template_default_realdir']; $app['twig.loader']->addLoader(new \Twig_Loader_Filesystem($paths)); $app['admin'] = true; $app['front'] = true; return $app; }
public function postUp(Schema $schema) { $app = new \Eccube\Application(); $app->boot(); $pluginCode = 'Holiday'; $pluginName = '定休日管理プラグイン'; $datetime = date('Y-m-d H:i:s'); $insert = "INSERT INTO plg_holiday_plugin(plugin_code, plugin_name, create_date, update_date) VALUES ('{$pluginCode}', '{$pluginName}', '{$datetime}', '{$datetime}');"; $this->connection->executeUpdate($insert); /* 定休日基本設定 */ $insert = "INSERT INTO plg_holiday_config(config_data, create_date, update_date) VALUES ('2', '{$datetime}', '{$datetime}');"; $this->connection->executeUpdate($insert); /* 定休日曜日設定 */ $insert = "INSERT INTO plg_holiday_week(week, create_date, update_date) VALUES ('" . serialize(null) . "', '{$datetime}', '{$datetime}');"; $this->connection->executeUpdate($insert); /* 初期設定の定休日設定 */ $Holiday_Title = array("元日(1月1日)", "成人の日(1月第2月曜日)", "建国記念の日(2月11日)", "春分の日(3月21日)", "昭和の日(4月29日)", "憲法記念日(5月3日)", "みどりの日(5月4日)", "こどもの日(5月5日)", "海の日(7月第3月曜日)", "敬老の日(9月第3月曜日)", "秋分の日(9月23日)", "体育の日(10月第2月曜日)", "文化の日(11月3日)", "勤労感謝の日(11月23日)", "天皇誕生日(12月23日)"); $Holiday_Month = array("1", "1", "2", "3", "4", "5", "5", "5", "7", "9", "9", "10", "11", "11", "12"); $Holiday_Day = array("1", "14", "11", "21", "29", "3", "4", "5", "21", "15", "23", "13", "3", "23", "23"); $Holiday_Rank = array("100", "99", "98", "97", "96", "95", "94", "93", "92", "91", "90", "89", "88", "87", "86"); for ($i = 0; $i < count($Holiday_Title); $i++) { $Holiday_insert = "INSERT INTO plg_holiday(title, month, day, rank, create_date, update_date)\n\t\t\tVALUES ('" . $Holiday_Title[$i] . "', '" . $Holiday_Month[$i] . "', '" . $Holiday_Day[$i] . "', '" . $Holiday_Rank[$i] . "', '{$datetime}', '{$datetime}');"; $this->connection->executeUpdate($Holiday_insert); } /* ブロックの追加 */ $Block_insert = "INSERT INTO dtb_block(\n\t\t\t\t\t\tblock_id, device_type_id, block_name, file_name, logic_flg, deletable_flg, create_date, update_date\n\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t(SELECT max(block_id) +1 as block_id FROM dtb_block AS sel_dtb_block WHERE device_type_id = 10), '10', '定休日カレンダー', 'pg_calendar', 0, 0, '{$datetime}', '{$datetime}'\n\t\t\t\t\t);"; $this->connection->executeUpdate($Block_insert); /* ブロックファイルとCSSファイルの生成 */ $pg_calendar_filename = $app['config']['block_realdir'] . "/pg_calendar.twig"; $pg_calendar = file_get_contents($app['config']['plugin_realdir'] . "/Holiday/View/default/pg_calendar.twig"); file_put_contents($pg_calendar_filename, $pg_calendar); $pg_calendar_css_filename = $app['config']['template_html_realdir'] . "/css/pg_calendar.css"; $pg_calendar_css = file_get_contents($app['config']['plugin_realdir'] . "/Holiday/View/default/pg_calendar.css"); file_put_contents($pg_calendar_css_filename, $pg_calendar_css); }
public function postUp(Schema $schema) { $app = new \Eccube\Application(); $app->boot(); $pluginCode = 'Maker'; $pluginName = 'メーカー管理'; $datetime = date('Y-m-d H:i:s'); $insert = "INSERT INTO plg_maker_plugin(\r\n plugin_code, plugin_name, create_date, update_date)\r\n VALUES ('{$pluginCode}', '{$pluginName}', '{$datetime}', '{$datetime}'\r\n );"; $this->connection->executeUpdate($insert); }
/** * @param Schema $schema */ public function up(Schema $schema) { // this up() migration is auto-generated, please modify it to your needs // pageを追加 $app = new \Eccube\Application(); $app->initialize(); $app->boot(); $em = $app['orm.em']; $DeviceType = $app['eccube.repository.master.device_type']->find(10); $PageLayout = new PageLayout(); $PageLayout->setDeviceType($DeviceType); $PageLayout->setName('商品購入/配送方法選択'); $PageLayout->setUrl('shopping_delivery'); $PageLayout->setFileName('Shopping/index'); $PageLayout->setEditFlg(2); $PageLayout->setMetaRobots('noindex'); $em->persist($PageLayout); $PageLayout = new PageLayout(); $PageLayout->setDeviceType($DeviceType); $PageLayout->setName('商品購入/支払方法選択'); $PageLayout->setUrl('shopping_payment'); $PageLayout->setFileName('Shopping/index'); $PageLayout->setEditFlg(2); $PageLayout->setMetaRobots('noindex'); $em->persist($PageLayout); $PageLayout = new PageLayout(); $PageLayout->setDeviceType($DeviceType); $PageLayout->setName('商品購入/お届け先変更'); $PageLayout->setUrl('shopping_shipping_change'); $PageLayout->setFileName('Shopping/index'); $PageLayout->setEditFlg(2); $PageLayout->setMetaRobots('noindex'); $em->persist($PageLayout); $PageLayout = new PageLayout(); $PageLayout->setDeviceType($DeviceType); $PageLayout->setName('商品購入/お届け先変更'); $PageLayout->setUrl('shopping_shipping_edit_change'); $PageLayout->setFileName('Shopping/index'); $PageLayout->setEditFlg(2); $PageLayout->setMetaRobots('noindex'); $em->persist($PageLayout); $PageLayout = new PageLayout(); $PageLayout->setDeviceType($DeviceType); $PageLayout->setName('商品購入/お届け先の複数指定'); $PageLayout->setUrl('shopping_shipping_multiple_change'); $PageLayout->setFileName('Shopping/index'); $PageLayout->setEditFlg(2); $PageLayout->setMetaRobots('noindex'); $em->persist($PageLayout); $em->flush(); }
/** * @param Schema $schema */ public function up(Schema $schema) { // this up() migration is auto-generated, please modify it to your needs if (!$schema->hasTable(self::NAME)) { return true; } $app = new \Eccube\Application(); $app->initialize(); $app->boot(); $em = $app["orm.em"]; /* $CsvType = new CsvType(); $CsvType->setId(1); $CsvType->setName('商品CSV'); $CsvType->setRank(3); $em->persist($CsvType); $CsvType = new CsvType(); $CsvType->setId(2); $CsvType->setName('会員CSV'); $CsvType->setRank(4); $em->persist($CsvType); $CsvType = new CsvType(); $CsvType->setId(3); $CsvType->setName('受注CSV'); $CsvType->setRank(1); $em->persist($CsvType); $CsvType = new CsvType(); $CsvType->setId(4); $CsvType->setName('配送CSV'); $CsvType->setRank(2); $em->persist($CsvType); $CsvType = new CsvType(); $CsvType->setId(5); $CsvType->setName('カテゴリCSV'); $CsvType->setRank(5); $em->persist($CsvType); $em->flush(); */ }
/** * @param Schema $schema */ public function up(Schema $schema) { // this up() migration is auto-generated, please modify it to your needs // pageを追加 $app = new \Eccube\Application(); $app->initialize(); $app->boot(); $em = $app['orm.em']; $DeviceType = $app['eccube.repository.master.device_type']->find(10); $PageLayout = new PageLayout(); $PageLayout->setDeviceType($DeviceType); $PageLayout->setName('商品購入/お届け先の追加'); $PageLayout->setUrl('shopping_shipping_edit'); $PageLayout->setFileName('Shopping/shipping_edit'); $PageLayout->setEditFlg(2); $PageLayout->setMetaRobots('noindex'); $em->persist($PageLayout); $PageLayout = new PageLayout(); $PageLayout->setDeviceType($DeviceType); $PageLayout->setName('商品購入/お届け先の複数指定(お届け先の追加)'); $PageLayout->setUrl('shopping_shipping_multiple_edit'); $PageLayout->setFileName('Shopping/shipping_multiple_edit'); $PageLayout->setEditFlg(2); $PageLayout->setMetaRobots('noindex'); $em->persist($PageLayout); $PageLayout = new PageLayout(); $PageLayout->setDeviceType($DeviceType); $PageLayout->setName('商品購入/購入エラー'); $PageLayout->setUrl('shopping_error'); $PageLayout->setFileName('Shopping/shopping_error'); $PageLayout->setEditFlg(2); $PageLayout->setMetaRobots('noindex'); $em->persist($PageLayout); $PageLayout = new PageLayout(); $PageLayout->setDeviceType($DeviceType); $PageLayout->setName('ご利用ガイド'); $PageLayout->setUrl('help_guide'); $PageLayout->setFileName('Help/guide'); $PageLayout->setEditFlg(2); $em->persist($PageLayout); $PageLayout = new PageLayout(); $PageLayout->setDeviceType($DeviceType); $PageLayout->setName('パスワード再発行(入力ページ)'); $PageLayout->setUrl('forgot'); $PageLayout->setFileName('Forgot/index'); $PageLayout->setEditFlg(2); $em->persist($PageLayout); $PageLayout = new PageLayout(); $PageLayout->setDeviceType($DeviceType); $PageLayout->setName('パスワード再発行(完了ページ)'); $PageLayout->setUrl('forgot_complete'); $PageLayout->setFileName('Forgot/complete'); $PageLayout->setEditFlg(2); $PageLayout->setMetaRobots('noindex'); $em->persist($PageLayout); $PageLayout = new PageLayout(); $PageLayout->setDeviceType($DeviceType); $PageLayout->setName('パスワード変更((完了ページ)'); $PageLayout->setUrl('forgot_reset'); $PageLayout->setFileName('Forgot/reset'); $PageLayout->setEditFlg(2); $PageLayout->setMetaRobots('noindex'); $em->persist($PageLayout); $em->flush(); // 文言、URLの修正 $this->addSql("UPDATE dtb_page_layout SET url = 'help_agreement', file_name = 'Help/agreement' WHERE file_name = 'Entry/kiyaku';"); $this->addSql("UPDATE dtb_page_layout SET url = 'shopping_shipping_multiple', file_name = 'Shopping/shipping_multiple' WHERE file_name = 'Shopping/multiple';"); $this->addSql("UPDATE dtb_page_layout SET page_name = '商品購入' WHERE page_name = '商品購入/ログイン';"); $this->addSql("UPDATE dtb_page_layout SET page_name = 'MYページ/お届け先一覧' WHERE page_name = 'MYページ/お届け先変更';"); $this->addSql("UPDATE dtb_page_layout SET file_name = 'Mypage/delivery_edit' WHERE page_name = 'MYページ/お届け先追加';"); // 不要なレコードを削除 $this->addSql("DELETE from dtb_page_layout WHERE file_name = 'Shopping/payment';"); $this->addSql("DELETE from dtb_page_layout WHERE file_name = 'Shopping/confirm';"); }
/** * マイグレーションを実行し, 完了画面を表示させる * * @param InstallApplication $app * @param Request $request * * @return \Symfony\Component\HttpFoundation\Response */ public function migration_end(InstallApplication $app, Request $request) { $this->doMigrate(); $config_app = new \Eccube\Application(); // install用のappだとconfigが取れないので $config_app->initialize(); $config_app->boot(); \Eccube\Util\Cache::clear($config_app, true); return $app['twig']->render('migration_end.twig'); }
/** * マイグレーションを実行し, 完了画面を表示させる * * @param InstallApplication $app * @param Request $request * * @return \Symfony\Component\HttpFoundation\Response */ public function migration_end(InstallApplication $app, Request $request) { $this->doMigrate(); $config_app = new \Eccube\Application(); // install用のappだとconfigが取れないので $config_app->initialize(); $config_app->boot(); \Eccube\Util\Cache::clear($config_app, true); return $app['twig']->render('migration_end.twig', array('publicPath' => '..' . RELATIVE_PUBLIC_DIR_PATH . '/')); }
protected function deletePageLayout() { if (version_compare(\Eccube\Common\Constant::VERSION, '3.0.8', '<=')) { $app = new \Eccube\Application(); $app->initialize(); $app->boot(); } else { $app = \Eccube\Application::getInstance(); } $em = $app['orm.em']; /** @var $repos \Eccube\Repository\PageLayoutRepository */ $repos = $em->getRepository('Eccube\\Entity\\PageLayout'); $DeviceType = $app['eccube.repository.master.device_type']->find(DeviceType::DEVICE_TYPE_PC); $PageLayout = $this->findPageLayout($repos, $DeviceType, 'products_detail_review'); $em->remove($PageLayout); $PageLayout = $this->findPageLayout($repos, $DeviceType, 'products_detail_review_complete'); $em->remove($PageLayout); $PageLayout = $this->findPageLayout($repos, $DeviceType, 'products_detail_review_error'); $em->remove($PageLayout); $em->flush(); }