Skip to content

Commit

Permalink
The first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhhd-kimei committed May 1, 2017
0 parents commit e2b9a36
Show file tree
Hide file tree
Showing 8,393 changed files with 1,206,233 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
27 changes: 27 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
DirectoryIndex index.php index.html .ht

<FilesMatch "^composer|^autoload|^cli-config|^COPYING|\.(ini|lock|dist|git|sh|bak|swp)$">
order allow,deny
deny from all
</FilesMatch>

<Files ~ "index.php|index_dev.php">
order deny,allow
allow from all
</Files>

<IfModule mod_rewrite.c>
RewriteEngine On

# Authorization ヘッダが取得できない環境への対応
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]

# さくらのレンタルサーバでサイトへのアクセスをSSL経由に制限する場合の対応
# RewriteCond %{HTTP:x-sakura-forwarded-for} !^$
# RewriteRule ^(.*) - [E=HTTPS:on]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !^(.*)\.(gif|png|jpe?g|css|ico|js|svg)$ [NC]
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
339 changes: 339 additions & 0 deletions COPYING

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions app/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
order allow,deny
deny from all
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php

namespace Plugin\HelloWorld\ServiceProvider;

use Silex\Application as BaseApplication;
use Silex\ServiceProviderInterface;
use Eccube\Common\Constant;


// include log functions (for 3.0.0 - 3.0.11)
require_once __DIR__.'/../log.php';

/**
* Class HelloWorldServiceProvider
*/
class HelloWorldServiceProvider implements ServiceProviderInterface {
/**
* register.
*
* @param BaseApplication $app
*/
public function register(BaseApplication $app) {
// 管理画面定義
$admin = $app['controllers_factory'];
// 強制SSL
if ($app['config']['force_ssl'] == Constant::ENABLED) {
$admin->requireHttps();
}

$app->mount('/'.trim($app['config']['admin_route'], '/').'/', $admin);

// Serviceの定義
$app['salesreport.service.sales_report'] = $app->share(function () use ($app) {
return new SalesReportService($app);
});

// initialize logger (for 3.0.0 - 3.0.8)
if (!method_exists('Eccube\Application', 'getInstance')) {
eccube_log_init($app);
}

// サブナビの拡張
$app['config'] = $app->share($app->extend('config', function ($config) {
$nav = array(
'id' => 'admin_plugin_helloworld',
'name' => 'Hello World',
'has_child' => 'true',
'icon' => 'cb-chart',
'child' => array(
array(
'id' => 'admin_plugin_helloword_test',
'url' => 'admin_plugin_helloword_test',
'name' => 'Test',
),
),
);

$config['nav'][] = $nav;

return $config;
}

/**
* boot.
*
* @param BaseApplication $app
*/
public function boot(BaseApplication $app)
{
}
}
7 changes: 7 additions & 0 deletions app/Plugin/HelloWorld/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: HDK Hello World
code: HelloWorld
version: 1.0.0
service:
- HelloWorldServiceProvider
const:
product_maximum_display: 20
169 changes: 169 additions & 0 deletions app/Plugin/HelloWorld/log.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
<?php
/*
* This file is part of the Sales Report plugin
*
* Copyright (C) 2016 LOCKON CO.,LTD. All Rights Reserved.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Plugin\SalesReport\Util\Version;

if (Version::isSupportLogFunction()) {
return;
}
if (function_exists('log_emergency') === false) {
/**
* Log emergency.
* Urgent alert. System is unusable.
*
* @param string $message
* @param array $context
*/
function log_emergency($message, array $context = array())
{
if (isset($GLOBALS['eccube_logger'])) {
$GLOBALS['eccube_logger']->emergency($message, $context);
}
}
}
if (function_exists('log_alert') === false) {
/**
* Log alert.
* Action must be taken immediately.
*
* Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.
*
* @param string $message
* @param array $context
*/
function log_alert($message, array $context = array())
{
if (isset($GLOBALS['eccube_logger'])) {
$GLOBALS['eccube_logger']->alert($message, $context);
}
}
}
if (function_exists('log_critical') === false) {
/**
* Log critical.
* Critical conditions.
*
* Application component unavailable, unexpected exception.
*
* @param string $message
* @param array $context
*/
function log_critical($message, array $context = array())
{
if (isset($GLOBALS['eccube_logger'])) {
$GLOBALS['eccube_logger']->critical($message, $context);
}
}
}
if (function_exists('log_error') === false) {
/**
* Log error.
* Runtime errors that do not require immediate action but should typically be logged and monitored.
*
* Error content at the time of occurrence Exception.
*
* @param string $message
* @param array $context
*/
function log_error($message, array $context = array())
{
if (isset($GLOBALS['eccube_logger'])) {
$GLOBALS['eccube_logger']->error($message, $context);
}
}
}
if (function_exists('log_warning') === false) {
/**
* Log warning.
* Exceptional occurrences that are not errors.
*
* Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.
*
* @param string $message
* @param array $context
*/
function log_warning($message, array $context = array())
{
if (isset($GLOBALS['eccube_logger'])) {
$GLOBALS['eccube_logger']->warning($message, $context);
}
}
}
if (function_exists('log_notice') === false) {
/**
* Log notice.
* Normal but significant events.
*
* @param string $message
* @param array $context
*/
function log_notice($message, array $context = array())
{
if (isset($GLOBALS['eccube_logger'])) {
$GLOBALS['eccube_logger']->notice($message, $context);
}
}
}
if (function_exists('log_info') === false) {
/**
* Log info.
* Interesting events.
*
* Logging to confirm the operation was performed.
*
* @param string $message
* @param array $context
*/
function log_info($message, array $context = array())
{
if (isset($GLOBALS['eccube_logger'])) {
$GLOBALS['eccube_logger']->info($message, $context);
}
}
}
if (function_exists('log_debug') === false) {
/**
* Log debug.
* Detailed debug information.
*
* HTTP communication log.
* Log you want to output at the time of development
*
* @param string $message
* @param array $context
*/
function log_debug($message, array $context = array())
{
if (isset($GLOBALS['eccube_logger'])) {
$GLOBALS['eccube_logger']->debug($message, $context);
}
}
}
if (function_exists('eccube_log_init') === false) {
/**
* Init log function for ec-cube <= 3.0.8.
*
* @param object $app
*/
function eccube_log_init($app)
{
if (isset($GLOBALS['eccube_logger'])) {
return;
}
$GLOBALS['eccube_logger'] = $app['monolog'];
$app['eccube.monolog.factory'] = $app->protect(function ($config) use ($app) {
return $app['monolog'];
});
}
}
// 3.0.9以上の場合は初期化処理を行う.
if (method_exists('Eccube\Application', 'getInstance')) {
$app = \Eccube\Application::getInstance();
eccube_log_init($app);
}
Loading

0 comments on commit e2b9a36

Please sign in to comment.