Skip to content

Instantly share code, notes, and snippets.

View chihiro-adachi's full-sized avatar

Chihiro Adachi chihiro-adachi

View GitHub Profile
test
test3
<?php
namespace Plugin\Sample;
use Eccube\Application;
use Eccube\Event\EccubeEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class Functions implements EventSubscriberInterface
{
$this->register(new \Dflydev\Silex\Provider\DoctrineOrm\DoctrineOrmServiceProvider(), array(
'orm.proxies_dir' => __DIR__.'/../../app/cache/doctrine',
'orm.em.options' => array(
'mappings' => $ormMappings,
'metadata_cache' => array(
'driver' => 'filesystem',
'path' => _DIR__.'/../../app/cache/doctrine/metadata',
),
),
<?php
if (function_exists('eccube_log_info') === false) {
function eccube_log_emergency($message, array $context = array())
{
$GLOBALS['eccube_logger']->emergency($message, $context);
}
function eccube_log_alert($message, array $context = array())
@chihiro-adachi
chihiro-adachi / TopController.php
Created March 22, 2017 09:32
FormTypeのサンプル
<?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
<?php
namespace Plugin\Yamiichi\ServiceProvider;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Query\Filter\SQLFilter;
use Silex\Application as BaseApplication;
use Silex\ServiceProviderInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
@chihiro-adachi
chihiro-adachi / RankServiceProvider.php
Created March 28, 2017 05:23
RankServiceProvider
<?php
namespace Plugin\Rank\ServiceProvider;
use Doctrine\Common\EventSubscriber;
use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
use Doctrine\ORM\Events;
use Eccube\Entity\OrderDetail;
use Eccube\Entity\ProductClass;
use Eccube\Entity\ShipmentItem;
@chihiro-adachi
chihiro-adachi / HogeServiceProvider.php
Created March 29, 2017 08:12
規格とかのcollection系に項目追加するサンプル
<?php
namespace Plugin\Hoge\ServiceProvider;
use Eccube\Entity\ProductClass;
use Eccube\Event\EccubeEvents;
use Eccube\Event\EventArgs;
use Eccube\Event\TemplateEvent;
use Silex\Application as BaseApplication;
use Silex\ServiceProviderInterface;
@chihiro-adachi
chihiro-adachi / auth-code-grant-openid.php
Created July 31, 2017 09:07
authorization code grant のサンプル(open id connect版)
<?php
require_once __DIR__.'/vendor/autoload.php';
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
/**
* authorization code grant のサンプル(open id connect版)
*
* 登場人物一覧