Update to Sylius 1.3 🎉

This commit is contained in:
Mikołaj Król
2018-10-22 02:15:31 +02:00
103 changed files with 989 additions and 285 deletions

2
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,2 @@
@ @BitBagCommerce
* @Sylius/core-team

5
.gitignore vendored
View File

@@ -1,11 +1,8 @@
/bin/*
!/bin/.gitkeep
/vendor/
/node_modules/
/composer.lock
/etc/build/*
!/etc/build/.gitkeep
!/etc/build/.gitignore
/tests/Application/yarn.lock

View File

@@ -5,6 +5,7 @@ dist: trusty
sudo: false
php:
<<<<<<< HEAD
- 7.1
- 7.2
@@ -18,6 +19,10 @@ addons:
services:
- elasticsearch
=======
- 7.2
>>>>>>> c08494520e1bd10bdf10b8bddc8029d4f7d63938
cache:
yarn: true
directories:
@@ -28,22 +33,42 @@ env:
global:
- SYLIUS_CACHE_DIR=$HOME/.sylius-cache
- SYLIUS_BUILD_DIR=etc/build
<<<<<<< HEAD
=======
matrix:
- SYMFONY_VERSION="3.4.*"
- SYMFONY_VERSION="4.1.*"
>>>>>>> c08494520e1bd10bdf10b8bddc8029d4f7d63938
before_install:
- phpenv config-rm xdebug.ini
- echo "memory_limit=4096M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- mkdir -p "${SYLIUS_CACHE_DIR}"
<<<<<<< HEAD
install:
=======
- cp tests/Application/.env.test.dist tests/Application/.env.test
- set -a && source tests/Application/.env.test && set +a
install:
- composer require "symfony/symfony:${SYMFONY_VERSION}" --no-interaction --no-update
>>>>>>> c08494520e1bd10bdf10b8bddc8029d4f7d63938
- composer install --no-interaction --prefer-dist
- (cd tests/Application && yarn install)
before_script:
- (cd tests/Application && bin/console doctrine:database:create --env=test -vvv)
- (cd tests/Application && bin/console doctrine:schema:create --env=test -vvv)
<<<<<<< HEAD
- (cd tests/Application && bin/console assets:install web --env=test -vvv)
- (cd tests/Application && bin/console fos:elastica:populate --env=test)
- (cd tests/Application && yarn run gulp)
=======
- (cd tests/Application && bin/console assets:install public --env=test -vvv)
- (cd tests/Application && bin/console cache:warmup --env=test -vvv)
- (cd tests/Application && yarn build)
>>>>>>> c08494520e1bd10bdf10b8bddc8029d4f7d63938
# Configure display
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1680x1050x16
@@ -72,6 +97,7 @@ before_script:
- java -Dwebdriver.chrome.driver=$SYLIUS_CACHE_DIR/chromedriver -jar $SYLIUS_CACHE_DIR/selenium.jar > /dev/null 2>&1 &
# Run webserver
<<<<<<< HEAD
- (cd tests/Application && bin/console server:run 127.0.0.1:8080 -d web --env=test --quiet > /dev/null 2>&1 &)
script:
@@ -80,6 +106,17 @@ script:
- bin/phpunit
- bin/phpspec run
- bin/behat
=======
- (cd tests/Application && bin/console server:run 127.0.0.1:8080 -d public --env=test --quiet > /dev/null 2>&1 &)
script:
- composer validate --strict
- vendor/bin/phpstan analyse -c phpstan.neon -l max src/
- vendor/bin/phpunit
- vendor/bin/phpspec run
- vendor/bin/behat --strict -vvv --no-interaction || vendor/bin/behat --strict -vvv --no-interaction --rerun
>>>>>>> c08494520e1bd10bdf10b8bddc8029d4f7d63938
after_failure:
- vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles "${SYLIUS_BUILD_DIR}/*.log"

View File

@@ -10,10 +10,13 @@ default:
- tests/Behat/Resources/services.yml
FriendsOfBehat\SymfonyExtension:
env_file: tests/Application/.env.test
kernel:
class: AppKernel
path: tests/Application/app/AppKernel.php
bootstrap: vendor/autoload.php
env: test
debug: true
class: Tests\BitBag\SyliusElasticsearchPlugin\Application\Kernel
path: tests/Application/Kernel.php
bootstrap: ~
Lakion\Behat\MinkDebugExtension:
directory: etc/build

1
bin/behat Symbolic link
View File

@@ -0,0 +1 @@
../vendor/behat/behat/bin/behat

1
bin/doctrine Symbolic link
View File

@@ -0,0 +1 @@
../vendor/doctrine/orm/bin/doctrine

1
bin/doctrine-dbal Symbolic link
View File

@@ -0,0 +1 @@
../vendor/doctrine/dbal/bin/doctrine-dbal

1
bin/doctrine-migrations Symbolic link
View File

@@ -0,0 +1 @@
../vendor/doctrine/migrations/bin/doctrine-migrations

1
bin/ecs Symbolic link
View File

@@ -0,0 +1 @@
../vendor/symplify/easy-coding-standard/bin/ecs

1
bin/php-cs-fixer Symbolic link
View File

@@ -0,0 +1 @@
../vendor/friendsofphp/php-cs-fixer/php-cs-fixer

1
bin/phpcbf Symbolic link
View File

@@ -0,0 +1 @@
../vendor/squizlabs/php_codesniffer/bin/phpcbf

1
bin/phpcs Symbolic link
View File

@@ -0,0 +1 @@
../vendor/squizlabs/php_codesniffer/bin/phpcs

1
bin/phpspec Symbolic link
View File

@@ -0,0 +1 @@
../vendor/phpspec/phpspec/bin/phpspec

1
bin/phpstan Symbolic link
View File

@@ -0,0 +1 @@
../vendor/phpstan/phpstan-shim/phpstan

1
bin/phpstan.phar Symbolic link
View File

@@ -0,0 +1 @@
../vendor/phpstan/phpstan-shim/phpstan.phar

1
bin/phpunit Symbolic link
View File

@@ -0,0 +1 @@
../vendor/phpunit/phpunit/phpunit

View File

@@ -0,0 +1 @@
../vendor/se/selenium-server-standalone/bin/selenium-server-standalone

View File

@@ -0,0 +1 @@
../vendor/league/uri-hostname-parser/bin/update-psl-icann-section

1
bin/upload-screenshots Symbolic link
View File

@@ -0,0 +1 @@
../vendor/lakion/mink-debug-extension/travis/tools/upload-screenshots

1
bin/upload-textfiles Symbolic link
View File

@@ -0,0 +1 @@
../vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles

1
bin/wait-for-port Symbolic link
View File

@@ -0,0 +1 @@
../vendor/lakion/mink-debug-extension/travis/tools/wait-for-port

View File

@@ -4,28 +4,31 @@
"description": "BitBag Elasticsearch plugin for Sylius.",
"license": "MIT",
"require": {
"php": "^7.1",
"sylius/sylius": "^1.1",
"php": "^7.2",
"sylius/sylius": "^1.3",
"friendsofsymfony/elastica-bundle": "^5.0"
},
"require-dev": {
"behat/behat": "^3.3",
"behat/mink": "^1.7",
"behat/behat": "^3.4",
"behat/mink": "^1.7@dev",
"behat/mink-browserkit-driver": "^1.3",
"behat/mink-extension": "^2.2",
"behat/mink-selenium2-driver": "^1.3",
"friends-of-behat/context-service-extension": "^1.0",
"friends-of-behat/cross-container-extension": "^1.0",
"friends-of-behat/context-service-extension": "^1.2",
"friends-of-behat/cross-container-extension": "^1.1",
"friends-of-behat/service-container-extension": "^1.0",
"friends-of-behat/symfony-extension": "^1.0",
"friends-of-behat/variadic-extension": "^1.0",
"friends-of-behat/symfony-extension": "^1.2.1",
"friends-of-behat/variadic-extension": "^1.1",
"lakion/mink-debug-extension": "^1.2.3",
"phpspec/phpspec": "^3.2",
"phpstan/phpstan-shim": "^0.9.2",
"phpunit/phpunit": "^5.6",
"se/selenium-server-standalone": "^2.52",
"sylius-labs/coding-standard": "^2.0"
"phpspec/phpspec": "^5.0",
"sylius-labs/coding-standard": "^2.0",
"symfony/browser-kit": "^3.4|^4.1",
"symfony/debug-bundle": "^3.4|^4.1",
"symfony/dotenv": "^3.4|^4.1",
"symfony/intl": "^3.4|^4.1",
"symfony/web-profiler-bundle": "^3.4|^4.1",
"symfony/web-server-bundle": "^3.4|^4.1",
"sensiolabs/security-checker": "^4.1"
},
"prefer-stable": true,
"autoload": {
@@ -33,11 +36,5 @@
"BitBag\\SyliusElasticsearchPlugin\\": "src/",
"Tests\\BitBag\\SyliusElasticsearchPlugin\\": "tests/"
}
},
"autoload-dev": {
"classmap": ["tests/Application/app/AppKernel.php"]
},
"config": {
"bin-dir": "bin"
}
}

View File

@@ -1,2 +1,2 @@
imports:
- { resource: 'vendor/sylius-labs/coding-standard/easy-coding-standard.yml' }
- { resource: 'vendor/sylius-labs/coding-standard/easy-coding-standard.yml' }

View File

@@ -1,11 +0,0 @@
parameters:
excludes_analyse:
# Makes PHPStan crash
- 'src/DependencyInjection/Configuration.php'
# Test dependencies
- 'tests/Application/app/**.php'
- 'tests/Application/src/**.php'
ignoreErrors:
- '/Parameter #1 $configuration of method Symfony\Component\DependencyInjection\Extension\Extension::processConfiguration() expects Symfony\Component\Config\Definition\ConfigurationInterface, Symfony\Component\Config\Definition\ConfigurationInterface|null given./'

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.6/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="BitBagSyliusElasticsearchPlugin Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<php>
<server name="KERNEL_CLASS_PATH" value="/tests/Application/AppKernel.php" />
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" />
</php>
</phpunit>

15
tests/Application/.babelrc Executable file
View File

@@ -0,0 +1,15 @@
{
"presets": [
["env", {
"targets": {
"node": "6"
},
"useBuiltIns": true
}]
],
"plugins": [
["transform-object-rest-spread", {
"useBuiltIns": true
}]
]
}

23
tests/Application/.env.dist Executable file
View File

@@ -0,0 +1,23 @@
# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file
# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production.
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
###> symfony/framework-bundle ###
APP_ENV=dev
APP_DEBUG=1
APP_SECRET=EDITME
###< symfony/framework-bundle ###
###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
DATABASE_URL=mysql://root@127.0.0.1/sylius_%kernel.environment%?serverVersion=5.5
###< doctrine/doctrine-bundle ###
###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=smtp://localhost
###< symfony/swiftmailer-bundle ###

View File

@@ -0,0 +1,23 @@
# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file
# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production.
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
###> symfony/framework-bundle ###
APP_ENV=prod
APP_DEBUG=0
APP_SECRET=EDITME
###< symfony/framework-bundle ###
###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
DATABASE_URL=mysql://root@127.0.0.1/sylius_%kernel.environment%?serverVersion=5.5
###< doctrine/doctrine-bundle ###
###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=smtp://localhost
###< symfony/swiftmailer-bundle ###

View File

@@ -0,0 +1,23 @@
# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file
# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production.
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
###> symfony/framework-bundle ###
APP_ENV=test
APP_DEBUG=1
APP_SECRET=EDITME
###< symfony/framework-bundle ###
###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
DATABASE_URL=mysql://root@127.0.0.1/sylius_%kernel.environment%?serverVersion=5.5
###< doctrine/doctrine-bundle ###
###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=null://localhost
###< symfony/swiftmailer-bundle ###

20
tests/Application/.eslintrc.js Executable file
View File

@@ -0,0 +1,20 @@
module.exports = {
extends: 'airbnb-base',
env: {
node: true,
},
rules: {
'object-shorthand': ['error', 'always', {
avoidQuotes: true,
avoidExplicitReturnArrows: true,
}],
'function-paren-newline': ['error', 'consistent'],
'max-len': ['warn', 120, 2, {
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
},
};

23
tests/Application/.gitignore vendored Normal file → Executable file
View File

@@ -1,9 +1,18 @@
/node_modules/
/var/*
!/var/.gitkeep
!/var/.gitignore
/web/*
!/web/app.php
!/web/app_dev.php
!/web/app_test.php
/public/assets
/public/bundles
/public/css
/public/js
/public/media
!/public/media/image/.gitignore
/vendor
/node_modules
/.env
/.env.prod
/.env.staging
/.env.test
/.env.test_cached

View File

@@ -1,24 +0,0 @@
var gulp = require('gulp');
var chug = require('gulp-chug');
var argv = require('yargs').argv;
config = [
'--rootPath',
argv.rootPath || '../../../../../../../tests/Application/web/assets/',
'--nodeModulesPath',
argv.nodeModulesPath || '../../../../../../../tests/Application/node_modules/'
];
gulp.task('admin', function() {
gulp.src('../../vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle/Gulpfile.js', { read: false })
.pipe(chug({ args: config }))
;
});
gulp.task('shop', function() {
gulp.src('../../vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Gulpfile.js', { read: false })
.pipe(chug({ args: config }))
;
});
gulp.task('default', ['admin', 'shop']);

144
tests/Application/Kernel.php Executable file
View File

@@ -0,0 +1,144 @@
<?php
declare(strict_types=1);
namespace Tests\BitBag\SyliusElasticsearchPlugin\Application;
use ProxyManager\Proxy\VirtualProxyInterface;
use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\RouteCollectionBuilder;
final class Kernel extends BaseKernel
{
use MicroKernelTrait;
private const CONFIG_EXTS = '.{php,xml,yaml,yml}';
private const IGNORED_SERVICES_DURING_CLEANUP = [
'kernel',
'http_kernel',
'liip_imagine.mime_type_guesser',
'liip_imagine.extension_guesser',
];
public function getCacheDir(): string
{
return $this->getProjectDir() . '/var/cache/' . $this->environment;
}
public function getLogDir(): string
{
return $this->getProjectDir() . '/var/log';
}
public function registerBundles(): iterable
{
$contents = require $this->getProjectDir() . '/config/bundles.php';
foreach ($contents as $class => $envs) {
if (isset($envs['all']) || isset($envs[$this->environment])) {
yield new $class();
}
}
}
public function shutdown(): void
{
if (!$this->isTestEnvironment()) {
parent::shutdown();
return;
}
if (false === $this->booted) {
return;
}
$container = $this->getContainer();
parent::shutdown();
$this->cleanupContainer($container);
}
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
{
$container->addResource(new FileResource($this->getProjectDir() . '/config/bundles.php'));
$container->setParameter('container.dumper.inline_class_loader', true);
$confDir = $this->getProjectDir() . '/config';
$loader->load($confDir . '/{packages}/*' . self::CONFIG_EXTS, 'glob');
$loader->load($confDir . '/{packages}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, 'glob');
$loader->load($confDir . '/{services}' . self::CONFIG_EXTS, 'glob');
$loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob');
}
protected function configureRoutes(RouteCollectionBuilder $routes): void
{
$confDir = $this->getProjectDir() . '/config';
$routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob');
}
protected function getContainerBaseClass(): string
{
if ($this->isTestEnvironment()) {
return MockerContainer::class;
}
return parent::getContainerBaseClass();
}
private function isTestEnvironment(): bool
{
return 0 === strpos($this->getEnvironment(), 'test');
}
/**
* Remove all container references from all loaded services
*/
private function cleanupContainer(ContainerInterface $container): void
{
$containerReflection = new \ReflectionObject($container);
$containerServicesPropertyReflection = $containerReflection->getProperty('services');
$containerServicesPropertyReflection->setAccessible(true);
$services = $containerServicesPropertyReflection->getValue($container) ?: [];
foreach ($services as $serviceId => $service) {
if (null === $service) {
continue;
}
if (in_array($serviceId, self::IGNORED_SERVICES_DURING_CLEANUP, true)) {
continue;
}
$serviceReflection = new \ReflectionObject($service);
if ($serviceReflection->implementsInterface(VirtualProxyInterface::class)) {
continue;
}
$servicePropertiesReflections = $serviceReflection->getProperties();
$servicePropertiesDefaultValues = $serviceReflection->getDefaultProperties();
foreach ($servicePropertiesReflections as $servicePropertyReflection) {
$defaultPropertyValue = null;
if (isset($servicePropertiesDefaultValues[$servicePropertyReflection->getName()])) {
$defaultPropertyValue = $servicePropertiesDefaultValues[$servicePropertyReflection->getName()];
}
$servicePropertyReflection->setAccessible(true);
$servicePropertyReflection->setValue($service, $defaultPropertyValue);
}
}
$containerServicesPropertyReflection->setValue($container, null);
}
}

View File

@@ -1,34 +0,0 @@
<?php
declare(strict_types=1);
use Sylius\Bundle\CoreBundle\Application\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
final class AppKernel extends Kernel
{
/**
* {@inheritdoc}
*/
public function registerBundles(): array
{
return array_merge(parent::registerBundles(), [
new \Sylius\Bundle\AdminBundle\SyliusAdminBundle(),
new \Sylius\Bundle\ShopBundle\SyliusShopBundle(),
new \FOS\OAuthServerBundle\FOSOAuthServerBundle(), // Required by SyliusApiBundle
new \Sylius\Bundle\AdminApiBundle\SyliusAdminApiBundle(),
new \FOS\ElasticaBundle\FOSElasticaBundle(),
new \BitBag\SyliusElasticsearchPlugin\BitBagSyliusElasticsearchPlugin(),
]);
}
/**
* {@inheritdoc}
*/
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load($this->getRootDir() . '/config/config.yml');
}
}

View File

@@ -1,71 +0,0 @@
parameters:
locale: en_US
secret: "Heron is the best animal in the world!"
bitbag_es_excluded_filter_options: []
bitbag_es_excluded_filter_attributes: ['book_isbn', 'book_pages']
imports:
- { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" }
- { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" }
- { resource: "@SyliusShopBundle/Resources/config/app/config.yml" }
- { resource: "@SyliusAdminApiBundle/Resources/config/app/config.yml" }
- { resource: "@BitBagSyliusElasticsearchPlugin/Resources/config/config.yml" }
- { resource: "../../../../vendor/sylius/sylius/app/config/security.yml" }
framework:
translator: { fallbacks: ["%locale%", "en"] }
secret: "%secret"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: "%kernel.debug%"
form: true
csrf_protection: true
validation: { enable_annotations: true }
templating: { engines: ["twig"] }
default_locale: "%locale%"
trusted_proxies: ~
session:
storage_id: session.storage.mock_file
test: ~
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
firephp:
type: firephp
level: info
swiftmailer:
disable_delivery: true
logging: true
spool:
type: file
path: "%kernel.cache_dir%/spool"
doctrine:
dbal:
driver: "pdo_sqlite"
path: "%kernel.root_dir%/../var/db.sql"
charset: UTF8
fos_rest:
exception: ~
view:
formats:
json: true
xml: true
empty_content: 204
format_listener:
rules:
- { path: '^/api', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true }
- { path: '^/', stop: true }
sylius_theme:
sources:
test: ~

View File

@@ -1,6 +0,0 @@
imports:
- { resource: "config.yml" }
doctrine:
dbal:
path: "%kernel.root_dir%/../var/db_dev.sql"

View File

@@ -1,6 +0,0 @@
imports:
- { resource: "config.yml" }
doctrine:
dbal:
path: "%kernel.root_dir%/../var/db_test.sql"

View File

@@ -1,27 +1,43 @@
#!/usr/bin/env php
<?php
declare(strict_types=1);
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
// for more information
//umask(0000);
use Symfony\Component\Dotenv\Dotenv;
use Tests\BitBag\SyliusElasticsearchPlugin\Application\Kernel;
set_time_limit(0);
require __DIR__ . '/../../../vendor/autoload.php';
require __DIR__.'/../../../vendor/autoload.php';
$input = new ArgvInput();
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod';
if ($debug) {
Debug::enable();
if (!class_exists(Application::class)) {
throw new \RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}
$kernel = new AppKernel($env, $debug);
if (!isset($_SERVER['APP_ENV'])) {
if (!class_exists(Dotenv::class)) {
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
}
$envFile = file_exists(__DIR__.'/../.env') ? __DIR__.'/../.env' : __DIR__.'/../.env.dist';
(new Dotenv())->load($envFile);
}
$input = new ArgvInput();
$env = $input->getParameterOption(['--env', '-e'], $_SERVER['APP_ENV'] ?? 'dev', true);
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env)) && !$input->hasParameterOption('--no-debug', true);
if ($debug) {
umask(0000);
if (class_exists(Debug::class)) {
Debug::enable();
}
}
$kernel = new Kernel($env, $debug);
$application = new Application($kernel);
$application->run($input);

View File

@@ -0,0 +1,5 @@
{
"name": "sylius/plugin-skeleton-test-application",
"description": "Sylius application for plugin testing purposes (composer.json needed for project dir resolving)",
"license": "MIT"
}

View File

@@ -0,0 +1,61 @@
<?php
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
Sylius\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true],
Sylius\Bundle\MoneyBundle\SyliusMoneyBundle::class => ['all' => true],
Sylius\Bundle\CurrencyBundle\SyliusCurrencyBundle::class => ['all' => true],
Sylius\Bundle\LocaleBundle\SyliusLocaleBundle::class => ['all' => true],
Sylius\Bundle\ProductBundle\SyliusProductBundle::class => ['all' => true],
Sylius\Bundle\ChannelBundle\SyliusChannelBundle::class => ['all' => true],
Sylius\Bundle\AttributeBundle\SyliusAttributeBundle::class => ['all' => true],
Sylius\Bundle\TaxationBundle\SyliusTaxationBundle::class => ['all' => true],
Sylius\Bundle\ShippingBundle\SyliusShippingBundle::class => ['all' => true],
Sylius\Bundle\PaymentBundle\SyliusPaymentBundle::class => ['all' => true],
Sylius\Bundle\MailerBundle\SyliusMailerBundle::class => ['all' => true],
Sylius\Bundle\PromotionBundle\SyliusPromotionBundle::class => ['all' => true],
Sylius\Bundle\AddressingBundle\SyliusAddressingBundle::class => ['all' => true],
Sylius\Bundle\InventoryBundle\SyliusInventoryBundle::class => ['all' => true],
Sylius\Bundle\TaxonomyBundle\SyliusTaxonomyBundle::class => ['all' => true],
Sylius\Bundle\UserBundle\SyliusUserBundle::class => ['all' => true],
Sylius\Bundle\CustomerBundle\SyliusCustomerBundle::class => ['all' => true],
Sylius\Bundle\UiBundle\SyliusUiBundle::class => ['all' => true],
Sylius\Bundle\ReviewBundle\SyliusReviewBundle::class => ['all' => true],
Sylius\Bundle\CoreBundle\SyliusCoreBundle::class => ['all' => true],
Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true],
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true],
Sonata\CoreBundle\SonataCoreBundle::class => ['all' => true],
Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
Sonata\IntlBundle\SonataIntlBundle::class => ['all' => true],
Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle::class => ['all' => true],
JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true],
FOS\RestBundle\FOSRestBundle::class => ['all' => true],
Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true],
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
Payum\Bundle\PayumBundle\PayumBundle::class => ['all' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['all' => true],
Sylius\Bundle\FixturesBundle\SyliusFixturesBundle::class => ['all' => true],
Sylius\Bundle\PayumBundle\SyliusPayumBundle::class => ['all' => true],
Sylius\Bundle\ThemeBundle\SyliusThemeBundle::class => ['all' => true],
Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['all' => true],
Sylius\Bundle\AdminBundle\SyliusAdminBundle::class => ['all' => true],
Sylius\Bundle\ShopBundle\SyliusShopBundle::class => ['all' => true],
FOS\OAuthServerBundle\FOSOAuthServerBundle::class => ['all' => true],
Sylius\Bundle\AdminApiBundle\SyliusAdminApiBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
FOS\ElasticaBundle\FOSElasticaBundle::class => ['all' => true],
BitBag\SyliusElasticsearchPlugin\BitBagSyliusElasticsearchPlugin::class => ['all' => true],
];

View File

@@ -0,0 +1,14 @@
imports:
- { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" }
- { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" }
- { resource: "@SyliusAdminApiBundle/Resources/config/app/config.yml" }
- { resource: "@SyliusShopBundle/Resources/config/app/config.yml" }
parameters:
sylius_core.public_dir: '%kernel.project_dir%/public'
sylius_shop:
product_grid:
include_all_descendants: true

View File

@@ -0,0 +1,2 @@
imports:
- { resource: "@BitBagSyliusElasticsearchPlugin/Resources/config/config.yml" }

View File

@@ -0,0 +1,2 @@
framework:
profiler: { only_exceptions: false }

View File

@@ -0,0 +1,7 @@
jms_serializer:
visitors:
json:
options:
- JSON_PRETTY_PRINT
- JSON_UNESCAPED_SLASHES
- JSON_PRESERVE_ZERO_FRACTION

View File

@@ -0,0 +1,9 @@
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
firephp:
type: firephp
level: info

View File

@@ -0,0 +1,3 @@
framework:
router:
strict_requirements: true

View File

@@ -0,0 +1,2 @@
swiftmailer:
disable_delivery: true

View File

@@ -0,0 +1,3 @@
web_profiler:
toolbar: true
intercept_redirects: false

View File

@@ -0,0 +1,14 @@
parameters:
# Adds a fallback DATABASE_URL if the env var is not set.
# This allows you to run cache:warmup even if your
# environment variables are not available yet.
# You should not need to change this value.
env(DATABASE_URL): ''
doctrine:
dbal:
driver: 'pdo_mysql'
server_version: '5.7'
charset: UTF8
url: '%env(resolve:DATABASE_URL)%'

View File

@@ -0,0 +1,5 @@
doctrine_migrations:
dir_name: "%kernel.project_dir%/src/Migrations"
# Namespace is arbitrary but should be different from App\Migrations as migrations classes should NOT be autoloaded
namespace: DoctrineMigrations

View File

@@ -0,0 +1,11 @@
fos_rest:
exception: true
view:
formats:
json: true
xml: true
empty_content: 204
format_listener:
rules:
- { path: '^/api/.*', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true }
- { path: '^/', stop: true }

View File

@@ -0,0 +1,7 @@
framework:
secret: '%env(APP_SECRET)%'
form: true
csrf_protection: true
templating: { engines: ["twig"] }
session:
handler_id: ~

View File

@@ -0,0 +1,4 @@
jms_serializer:
visitors:
xml:
format_output: '%kernel.debug%'

View File

@@ -0,0 +1,6 @@
liip_imagine:
resolvers:
default:
web_path:
web_root: "%kernel.project_dir%/public"
cache_prefix: "media/cache"

View File

@@ -0,0 +1,31 @@
doctrine:
orm:
metadata_cache_driver:
type: service
id: doctrine.system_cache_provider
query_cache_driver:
type: service
id: doctrine.system_cache_provider
result_cache_driver:
type: service
id: doctrine.result_cache_provider
services:
doctrine.result_cache_provider:
class: Symfony\Component\Cache\DoctrineProvider
public: false
arguments:
- '@doctrine.result_cache_pool'
doctrine.system_cache_provider:
class: Symfony\Component\Cache\DoctrineProvider
public: false
arguments:
- '@doctrine.system_cache_pool'
framework:
cache:
pools:
doctrine.result_cache_pool:
adapter: cache.app
doctrine.system_cache_pool:
adapter: cache.system

View File

@@ -0,0 +1,6 @@
jms_serializer:
visitors:
json:
options:
- JSON_UNESCAPED_SLASHES
- JSON_PRESERVE_ZERO_FRACTION

View File

@@ -1,6 +1,3 @@
imports:
- { resource: "config.yml" }
monolog:
handlers:
main:

View File

@@ -0,0 +1,3 @@
framework:
router:
strict_requirements: ~

View File

@@ -0,0 +1,102 @@
parameters:
sylius.security.admin_regex: "^/admin"
sylius.security.api_regex: "^/api"
sylius.security.shop_regex: "^/(?!admin|api/.*|api$|media/.*)[^/]++"
security:
providers:
sylius_admin_user_provider:
id: sylius.admin_user_provider.email_or_name_based
sylius_shop_user_provider:
id: sylius.shop_user_provider.email_or_name_based
encoders:
Sylius\Component\User\Model\UserInterface: sha512
firewalls:
admin:
switch_user: true
context: admin
pattern: "%sylius.security.admin_regex%"
provider: sylius_admin_user_provider
form_login:
provider: sylius_admin_user_provider
login_path: sylius_admin_login
check_path: sylius_admin_login_check
failure_path: sylius_admin_login
default_target_path: sylius_admin_dashboard
use_forward: false
use_referer: true
csrf_token_generator: security.csrf.token_manager
csrf_parameter: _csrf_admin_security_token
csrf_token_id: admin_authenticate
remember_me:
secret: "%env(APP_SECRET)%"
path: /admin
name: APP_ADMIN_REMEMBER_ME
lifetime: 31536000
remember_me_parameter: _remember_me
logout:
path: sylius_admin_logout
target: sylius_admin_login
anonymous: true
oauth_token:
pattern: "%sylius.security.api_regex%/oauth/v2/token"
security: false
api:
pattern: "%sylius.security.api_regex%/.*"
provider: sylius_admin_user_provider
fos_oauth: true
stateless: true
anonymous: true
shop:
switch_user: { role: ROLE_ALLOWED_TO_SWITCH }
context: shop
pattern: "%sylius.security.shop_regex%"
provider: sylius_shop_user_provider
form_login:
success_handler: sylius.authentication.success_handler
failure_handler: sylius.authentication.failure_handler
provider: sylius_shop_user_provider
login_path: sylius_shop_login
check_path: sylius_shop_login_check
failure_path: sylius_shop_login
default_target_path: sylius_shop_homepage
use_forward: false
use_referer: true
csrf_token_generator: security.csrf.token_manager
csrf_parameter: _csrf_shop_security_token
csrf_token_id: shop_authenticate
remember_me:
secret: "%env(APP_SECRET)%"
name: APP_SHOP_REMEMBER_ME
lifetime: 31536000
remember_me_parameter: _remember_me
logout:
path: sylius_shop_logout
target: sylius_shop_login
invalidate_session: false
success_handler: sylius.handler.shop_user_logout
anonymous: true
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
access_control:
- { path: "%sylius.security.admin_regex%/_partial", role: IS_AUTHENTICATED_ANONYMOUSLY, ips: [127.0.0.1, ::1] }
- { path: "%sylius.security.admin_regex%/_partial", role: ROLE_NO_ACCESS }
- { path: "%sylius.security.shop_regex%/_partial", role: IS_AUTHENTICATED_ANONYMOUSLY, ips: [127.0.0.1, ::1] }
- { path: "%sylius.security.shop_regex%/_partial", role: ROLE_NO_ACCESS }
- { path: "%sylius.security.admin_regex%/login", role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: "%sylius.security.api_regex%/login", role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: "%sylius.security.shop_regex%/login", role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: "%sylius.security.shop_regex%/register", role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: "%sylius.security.shop_regex%/verify", role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS }
- { path: "%sylius.security.api_regex%/.*", role: ROLE_API_ACCESS }
- { path: "%sylius.security.shop_regex%/account", role: ROLE_USER }

View File

@@ -0,0 +1,9 @@
services:
SensioLabs\Security\SecurityChecker:
public: false
SensioLabs\Security\Command\SecurityCheckerCommand:
arguments: ['@SensioLabs\Security\SecurityChecker']
public: false
tags:
- { name: console.command, command: 'security:check' }

View File

@@ -0,0 +1,4 @@
sonata_core:
form:
mapping:
enabled: false

View File

@@ -0,0 +1,10 @@
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug

View File

@@ -0,0 +1,2 @@
swiftmailer:
disable_delivery: true

View File

@@ -0,0 +1,4 @@
# Read the documentation: https://symfony.com/doc/current/bundles/StofDoctrineExtensionsBundle/index.html
# See the official DoctrineExtensions documentation for more details: https://github.com/Atlantic18/DoctrineExtensions/tree/master/doc/
stof_doctrine_extensions:
default_locale: '%locale%'

View File

@@ -0,0 +1,2 @@
swiftmailer:
url: '%env(MAILER_URL)%'

View File

@@ -0,0 +1,4 @@
framework:
test: ~
session:
storage_id: session.storage.mock_file

View File

@@ -0,0 +1,6 @@
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: error

View File

@@ -0,0 +1,6 @@
swiftmailer:
disable_delivery: true
logging: true
spool:
type: file
path: "%kernel.cache_dir%/spool"

View File

@@ -0,0 +1,3 @@
sylius_theme:
sources:
test: ~

View File

@@ -0,0 +1,6 @@
web_profiler:
toolbar: false
intercept_redirects: false
framework:
profiler: { collect: false }

View File

@@ -0,0 +1,16 @@
doctrine:
orm:
entity_managers:
default:
result_cache_driver:
type: memcached
host: localhost
port: 11211
query_cache_driver:
type: memcached
host: localhost
port: 11211
metadata_cache_driver:
type: memcached
host: localhost
port: 11211

View File

@@ -0,0 +1,3 @@
fos_rest:
exception:
debug: true

View File

@@ -0,0 +1,4 @@
framework:
test: ~
session:
storage_id: session.storage.mock_file

View File

@@ -0,0 +1,6 @@
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: error

View File

@@ -0,0 +1,6 @@
swiftmailer:
disable_delivery: true
logging: true
spool:
type: file
path: "%kernel.cache_dir%/spool"

View File

@@ -0,0 +1,2 @@
sylius_channel:
debug: true

View File

@@ -0,0 +1,3 @@
sylius_theme:
sources:
test: ~

View File

@@ -0,0 +1,2 @@
twig:
strict_variables: true

View File

@@ -0,0 +1,8 @@
framework:
default_locale: '%locale%'
translator:
paths:
- '%kernel.project_dir%/translations'
fallbacks:
- '%locale%'
- 'en'

View File

@@ -0,0 +1,4 @@
twig:
paths: ['%kernel.project_dir%/templates']
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'

View File

@@ -0,0 +1,11 @@
services:
_defaults:
public: false
autowire: true
autoconfigure: true
# Uncomment any lines below to activate that Twig extension
#Twig\Extensions\ArrayExtension: ~
#Twig\Extensions\DateExtension: ~
#Twig\Extensions\IntlExtension: ~
#Twig\Extensions\TextExtension: ~

View File

@@ -0,0 +1,3 @@
framework:
validation:
enable_annotations: true

View File

@@ -1,7 +1,2 @@
sylius:
resource: "../../../../vendor/sylius/sylius/app/config/routing.yml"
# Put your own routes here
bitbag_sylius_elasticsearch_plugin:
resource: "@BitBagSyliusElasticsearchPlugin/Resources/config/routing.yml"

View File

@@ -0,0 +1,3 @@
_errors:
resource: '@TwigBundle/Resources/config/routing/errors.xml'
prefix: /_error

View File

@@ -0,0 +1,7 @@
_wdt:
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
prefix: /_wdt
_profiler:
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
prefix: /_profiler

View File

@@ -0,0 +1,2 @@
_liip_imagine:
resource: "@LiipImagineBundle/Resources/config/routing.yaml"

View File

@@ -0,0 +1,3 @@
sylius_admin:
resource: "@SyliusAdminBundle/Resources/config/routing.yml"
prefix: /admin

View File

@@ -0,0 +1,3 @@
sylius_admin_api:
resource: "@SyliusAdminApiBundle/Resources/config/routing.yml"
prefix: /api

View File

@@ -0,0 +1,14 @@
sylius_shop:
resource: "@SyliusShopBundle/Resources/config/routing.yml"
prefix: /{_locale}
requirements:
_locale: ^[a-z]{2}(?:_[A-Z]{2})?$
sylius_shop_payum:
resource: "@SyliusShopBundle/Resources/config/routing/payum.yml"
sylius_shop_default_locale:
path: /
methods: [GET]
defaults:
_controller: sylius.controller.shop.locale_switch:switchAction

View File

@@ -0,0 +1,4 @@
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
locale: en_US

View File

@@ -0,0 +1,60 @@
import chug from 'gulp-chug';
import gulp from 'gulp';
import yargs from 'yargs';
const { argv } = yargs
.options({
rootPath: {
description: '<path> path to public assets directory',
type: 'string',
requiresArg: true,
required: false,
},
nodeModulesPath: {
description: '<path> path to node_modules directory',
type: 'string',
requiresArg: true,
required: false,
},
});
const config = [
'--rootPath',
argv.rootPath || '../../../../../../../tests/Application/public/assets',
'--nodeModulesPath',
argv.nodeModulesPath || '../../../../../../../tests/Application/node_modules',
];
export const buildAdmin = function buildAdmin() {
return gulp.src('../../vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle/gulpfile.babel.js', { read: false })
.pipe(chug({ args: config, tasks: 'build' }));
};
buildAdmin.description = 'Build admin assets.';
export const watchAdmin = function watchAdmin() {
return gulp.src('../../vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle/gulpfile.babel.js', { read: false })
.pipe(chug({ args: config, tasks: 'watch' }));
};
watchAdmin.description = 'Watch admin asset sources and rebuild on changes.';
export const buildShop = function buildShop() {
return gulp.src('../../vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/gulpfile.babel.js', { read: false })
.pipe(chug({ args: config, tasks: 'build' }));
};
buildShop.description = 'Build shop assets.';
export const watchShop = function watchShop() {
return gulp.src('../../vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/gulpfile.babel.js', { read: false })
.pipe(chug({ args: config, tasks: 'watch' }));
};
watchShop.description = 'Watch shop asset sources and rebuild on changes.';
export const build = gulp.parallel(buildAdmin, buildShop);
build.description = 'Build assets.';
gulp.task('admin', buildAdmin);
gulp.task('admin-watch', watchAdmin);
gulp.task('shop', buildShop);
gulp.task('shop-watch', watchShop);
export default build;

31
tests/Application/package.json Normal file → Executable file
View File

@@ -1,27 +1,48 @@
{
"dependencies": {
"babel-polyfill": "^6.26.0",
"jquery": "^3.2.0",
"lightbox2": "^2.9.0",
"semantic-ui-css": "^2.2.0"
},
"devDependencies": {
"gulp": "^3.9.0",
"babel-core": "^6.26.3",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-module-resolver": "^3.1.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0",
"dedent": "^0.7.0",
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-import-resolver-babel-module": "^4.0.0",
"eslint-plugin-import": "^2.12.0",
"fast-async": "^6.3.7",
"gulp": "^4.0.0",
"gulp-chug": "^0.5",
"gulp-concat": "^2.6.0",
"gulp-debug": "^2.1.2",
"gulp-if": "^2.0.0",
"gulp-livereload": "^3.8.1",
"gulp-order": "^1.1.1",
"gulp-sass": "^2.3.0",
"gulp-sass": "^4.0.1",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.1",
"gulp-uglifycss": "^1.0.5",
"merge-stream": "^1.0.0",
"node-sass": "^4.5.3",
"rollup": "^0.60.7",
"rollup-plugin-babel": "^3.0.4",
"rollup-plugin-commonjs": "^9.1.3",
"rollup-plugin-inject": "^2.0.0",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-uglify": "^4.0.0",
"upath": "^1.1.0",
"yargs": "^6.4.0"
},
"scripts": {
"gulp": "gulp"
"build": "gulp build",
"gulp": "gulp build",
"lint": "yarn lint:js",
"lint:js": "eslint gulpfile.babel.js"
},
"repository": {
"type": "git",

View File

@@ -0,0 +1,25 @@
DirectoryIndex app.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]
RewriteRule .? %{ENV:BASE}/index.php [L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
RedirectMatch 302 ^/$ /index.php/
</IfModule>
</IfModule>

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
use Symfony\Component\Debug\Debug;
use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\HttpFoundation\Request;
use Tests\BitBag\SyliusElasticsearchPlugin\Application\Kernel;
require __DIR__.'/../../../vendor/autoload.php';
// The check is to ensure we don't use .env in production
if (!isset($_SERVER['APP_ENV']) && !isset($_ENV['APP_ENV'])) {
if (!class_exists(Dotenv::class)) {
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
}
$envFile = file_exists(__DIR__.'/../.env') ? __DIR__.'/../.env' : __DIR__.'/../.env.dist';
(new Dotenv())->load($envFile);
}
$env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'dev';
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? ('prod' !== $env));
if ($debug) {
umask(0000);
Debug::enable();
}
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
}
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {
Request::setTrustedHosts(explode(',', $trustedHosts));
}
$kernel = new Kernel($env, $debug);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);

View File

@@ -0,0 +1,4 @@
# www.robotstxt.org/
# www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449
User-agent: *

0
tests/Application/translations/.gitignore vendored Executable file
View File

0
tests/Application/var/.gitignore vendored Executable file
View File

Some files were not shown because too many files have changed in this diff Show More