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; }
private function getMigration() { $app = new \Eccube\Application(); $app->initDoctrine(); $config = new Configuration($app['db']); $config->setMigrationsNamespace('DoctrineMigrations'); $migrationDir = __DIR__ . '/../../Resource/doctrine/migration'; $config->setMigrationsDirectory($migrationDir); $config->registerMigrationsFromDirectory($migrationDir); $migration = new Migration($config); return $migration; }
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 createApplication() { $app = new \Eccube\Application(); $app->register(new MonologServiceProvider(), array('monolog.handler' => $app->share(function () use($app) { return new TestHandler($app['monolog.level']); }))); return $app; }
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(); */ }
public function createApplication($users = array()) { $app = new \Eccube\Application(); // ログの内容をERRORレベルでしか出力しないように設定を上書き $app['config'] = $app->share($app->extend('config', function ($config, \Silex\Application $app) { $config['log']['log_level'] = 'ERROR'; $config['log']['action_level'] = 'ERROR'; $config['log']['passthru_level'] = 'ERROR'; $channel = $config['log']['channel']; foreach (array('monolog', 'front', 'admin') as $key) { $channel[$key]['log_level'] = 'ERROR'; $channel[$key]['action_level'] = 'ERROR'; $channel[$key]['passthru_level'] = 'ERROR'; } $config['log']['channel'] = $channel; return $config; })); $app->initLogger(); $app->register(new SecurityServiceProvider(), array('security.firewalls' => array('default' => array('http' => true, 'users' => $users)))); return $app; }
<?php /* * This file is part of EC-CUBE * * Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved. * * http://www.lockon.co.jp/ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ use Doctrine\ORM\Tools\Console\ConsoleRunner; $app = new \Eccube\Application(); $app->initialize(); return ConsoleRunner::createHelperSet($app['orm.em']);
public function createApplication() { $app = new \Eccube\Application(); $app->register(new SecurityServiceProvider(), array('security.firewalls' => array('default' => array('http' => true, 'users' => array('fabien' => array('ROLE_ADMIN', '5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg==')))))); return $app; }
public function createApplication() { $app = new \Eccube\Application(); $app->register(new TranslationServiceProvider()); return $app; }
public function createApplication() { $app = new \Eccube\Application(); $app->register(new SwiftmailerServiceProvider()); return $app; }
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(); }
public function createApplication() { $app = new \Eccube\Application(); $app->register(new UrlGeneratorServiceProvider()); return $app; }
<?php use Codeception\Util\Fixtures; use Faker\Factory as Faker; $config = parse_ini_file('tests/acceptance/config.ini', true); /** * create fixture * このデータは$appを使って直接eccubeのデータベースに作成される * よってCodeceptionの設定によってコントロールされず、テスト後もデータベース内にこのデータは残る * データの件数によって、作成するかどうか判定される */ require_once $config['eccube_path'] . 'autoload.php'; $app = Eccube\Application::getInstance(); // Disable to TransactionListener. $app->setTestMode(true); $app->initialize(); $app->initializePlugin(); $app->register(new \Eccube\Tests\ServiceProvider\FixtureServiceProvider()); $app->boot(); // この Fixture は Cest ではできるだけ使用せず, 用途に応じた Fixture を使用すること Fixtures::add('app', $app); use Eccube\Common\Constant; use Eccube\Entity\Customer; use Eccube\Entity\Master\CustomerStatus; $faker = Faker::create('ja_JP'); Fixtures::add('faker', $faker); $num = $app['orm.em']->getRepository('Eccube\\Entity\\Customer')->createQueryBuilder('o')->select('count(o.id)')->where('o.del_flg = 0')->getQuery()->getSingleScalarResult(); if ($num < $config['fixture_customer_num']) { $num = $config['fixture_customer_num'] - $num; for ($i = 0; $i < $num; $i++) { $email = microtime(true) . '.' . $faker->safeEmail;
// This check prevents access to debug front controllers that are deployed by accident to production servers. // Feel free to remove this, extend it, or make something more sophisticated. $allow = array('127.0.0.1', 'fe80::1', '::1'); /* if (isset($_SERVER['HTTP_CLIENT_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !in_array(@$_SERVER['REMOTE_ADDR'], $allow) ) { header('HTTP/1.0 403 Forbidden'); exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); } */ require_once __DIR__ . '/../autoload.php'; Debug::enable(); // load configs. $app = new Eccube\Application(); // debug enable. $app['debug'] = true; // initialize servicies. $app->initialize(); $app->initializePlugin(); // load config dev $conf = $app['config']; $app['config'] = $app->share(function () use($conf) { $confarray = array(); $config_dev_file = __DIR__ . '/../app/config/eccube/config_dev.yml'; if (file_exists($config_dev_file)) { $config_dev = Yaml::parse(file_get_contents($config_dev_file)); if (isset($config_dev)) { $confarray = array_replace_recursive($confarray, $config_dev); }
/** * マイグレーションを実行し, 完了画面を表示させる * * @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 . '/')); }
<?php require_once __DIR__ . '/../vendor/autoload.php'; $app = new Eccube\Application(); $app['debug'] = true; $app->run();
public function createApplication($users = array()) { $app = new \Eccube\Application(); $app->register(new SecurityServiceProvider(), array('security.firewalls' => array('default' => array('http' => true, 'users' => $users)))); return $app; }
/** * @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';"); }
* * http://www.lockon.co.jp/ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ require __DIR__ . '/../autoload.php'; ini_set('display_errors', 'Off'); error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT); $app = new Eccube\Application(); // インストールされてなければインストーラにリダイレクト if ($app['config']['eccube_install']) { $app->initialize(); $app->initializePlugin(); $app->run(); } else { $location = str_replace('index.php', 'install.php', $_SERVER['SCRIPT_NAME']); header('Location:' . $location); exit; }