Skip to content

Instantly share code, notes, and snippets.

View nanasess's full-sized avatar
🍣
Sushi chef

Kentaro Ohkouchi nanasess

🍣
Sushi chef
View GitHub Profile
@nanasess
nanasess / config.php
Created November 21, 2019 12:56
ec-cube2 configuration of Azure WebApps on localdb
<?php
preg_match('/Database=(.*);Data Source=(.*):(.*);User Id=(.*);Password=(.*)$/', $_SERVER['MYSQLCONNSTR_localdb'], $matches);
list($ds, $dbname, $dbhost, $dbport, $dbuser, $dbpass) = $matches;
define('ECCUBE_INSTALL', 'ON');
define('HTTP_URL', 'https://example.azurewebsites.net/');
define('HTTPS_URL', 'https://example.azurewebsites.net/');
define('ROOT_URLPATH', '/');
define('DOMAIN_NAME', '');
define('DB_TYPE', 'mysql');
define('DB_USER', $dbuser);
@nanasess
nanasess / generator.php
Created August 5, 2019 10:57
データ生成スクリプト for EC-CUBE2.17
<?php
require __DIR__.'/require.php';
ini_set('display_errors', 1);
// Here you can initialize variables that will be available to your tests
$config = [
'fixture_customer_num' => 10, // 会員数
'fixture_product_num' => 30000, // 商品数
'fixture_order_num' => 1 // 注文数
];
@nanasess
nanasess / eccube-2.13.5-2.17.patch
Created August 3, 2019 02:54
EC-CUBE2.13.5 と 2.17-RC の差分
diff -urb 2_13/.coveralls.yml 2_17/.coveralls.yml
--- 2_13/.coveralls.yml 2019-08-03 11:41:43.000000000 +0900
+++ 2_17/.coveralls.yml 2019-08-03 09:51:39.000000000 +0900
@@ -1,5 +1,4 @@
# for php-coveralls
# see also. https://coveralls.io
-src_dir: data
coverage_clover: reports/coverage/coverage.xml
json_path: reports/coverage/coveralls-upload.json
diff -urb 2_13/.gitignore 2_17/.gitignore
@nanasess
nanasess / createEcCubeData-v40.php
Last active February 21, 2019 07:20
データ生成スクリプト for EC-CUBE4
#!/usr/local/bin/php -q
<?php
use Doctrine\ORM\EntityManagerInterface;
use Eccube\Kernel;
use Dotenv\Dotenv;
/*
* EC-CUBE データ生成スクリプト
*
* Copyright(c) 2000-2014 LOCKON CO.,LTD. All Rights Reserved.
@nanasess
nanasess / wordpress-relate-eccube.patch
Created December 8, 2018 08:17
EC-CUBEの定数を変更する
diff --git a/data/class/SC_Initial.php b/data/class/SC_Initial.php
index aa25b299b2..f57c908dc9 100644
--- a/data/class/SC_Initial.php
+++ b/data/class/SC_Initial.php
@@ -83,10 +83,10 @@ class SC_Initial
*/
public function defineDSN()
{
- if (defined('DB_TYPE') && defined('DB_USER') && defined('DB_PASSWORD')
- && defined('DB_SERVER') && defined('DB_PORT') && defined('DB_NAME')
#!/bin/sh
## ATTENTION IIS の場合は web.config を .htaccess に変更すること!
ECCUBE_HOST=http://example.com/ec-cube
while read TARGET
do
echo -n "$ECCUBE_HOST/$TARGET..."
STATUS=`curl -L -s $ECCUBE_HOST/$TARGET -o /dev/null -w '%{http_code}\n'`
if [ $STATUS = '200' ]
@nanasess
nanasess / symfony-profiler-on-production.patch
Last active April 19, 2021 14:58
Symfony Profiler on APP_ENV=prod
From 796868cf2bfece8e0912fe3c30a37e76d505da5c Mon Sep 17 00:00:00 2001
From: Kentaro Ohkouchi <nanasess@fsm.ne.jp>
Date: Thu, 16 Aug 2018 09:35:23 +0900
Subject: [PATCH] =?UTF-8?q?WebProfiler=20=E3=82=92=20production=20?=
=?UTF-8?q?=E3=83=A2=E3=83=BC=E3=83=89=E3=81=A7=E5=8B=95=E4=BD=9C=E3=81=95?=
=?UTF-8?q?=E3=81=9B=E3=82=8B=E8=A8=AD=E5=AE=9A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
diff --git a/src/Eccube/Service/OrderHelper.php b/src/Eccube/Service/OrderHelper.php
index 6753b31af..bdad561cd 100644
--- a/src/Eccube/Service/OrderHelper.php
+++ b/src/Eccube/Service/OrderHelper.php
@@ -21,6 +21,7 @@ use Eccube\Entity\Cart;
use Eccube\Entity\CartItem;
use Eccube\Entity\Customer;
use Eccube\Entity\CustomerAddress;
+use Eccube\Entity\ItemHolderInterface;
use Eccube\Entity\Master\OrderItemType;
@nanasess
nanasess / categories.js
Last active March 27, 2018 00:16
ツリーを処理するサンプル
var Category = function (name, child) {
var self = this;
this.name = name;
this.children = child;
this.accept = function(Visitor) {
Visitor.visit(self);
};
};
var Visitor = function () {
@nanasess
nanasess / csrfchecker-ajax.diff
Created March 23, 2018 05:57
CSRF token validation for ajax
diff --git a/src/Eccube/Controller/AbstractController.php b/src/Eccube/Controller/AbstractController.php
index 0f1c17500..b4caae677 100644
--- a/src/Eccube/Controller/AbstractController.php
+++ b/src/Eccube/Controller/AbstractController.php
@@ -32,6 +32,7 @@ use Eccube\Common\EccubeConfig;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\FormFactoryInterface;
+use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;