Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Go into SF 4 #403

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
34d200a
Prepare next version with all SF 4 changes
ElectricMaxxx Feb 23, 2018
b9bff0e
Apply fixes from StyleCI
dbu Aug 28, 2018
661f85e
Merge pull request #407 from symfony-cmf/analysis-qx3wJ0
dbu Aug 28, 2018
ad35cbb
current state
ElectricMaxxx Oct 1, 2018
80dc15b
get it working again
ElectricMaxxx Jan 21, 2019
c0696b7
get ckEditor running with dev branch of our sonata admin
ElectricMaxxx Jan 21, 2019
bfb3dd3
push with new version
ElectricMaxxx Mar 3, 2019
c6b41af
fix most dependencies on patch changes only. So cmf is mostly on 2.1.…
ElectricMaxxx Mar 4, 2019
f3db638
move translation config to dev config
ElectricMaxxx Mar 4, 2019
0e12546
fix env setting
ElectricMaxxx Mar 4, 2019
ffad034
fix env setting
ElectricMaxxx Mar 4, 2019
e617766
avoid using dev version
ElectricMaxxx Mar 4, 2019
e83f4b6
fix fixture loader test
ElectricMaxxx Mar 4, 2019
2d83432
add makefile and travis scripts
ElectricMaxxx Mar 4, 2019
675f09c
remove forreign repository
ElectricMaxxx Mar 4, 2019
5e5e3b4
explicit phpunit version
ElectricMaxxx Mar 4, 2019
1aae94d
apply cs fixes
ElectricMaxxx Mar 4, 2019
38002fc
use 2.0 version of functional test bundle only
ElectricMaxxx Mar 4, 2019
44f04d2
use latest stable functional-test-bundle version
ElectricMaxxx Mar 4, 2019
f89c9c1
first try without liip/functional-test-bundle
ElectricMaxxx Mar 5, 2019
57133a6
add test-pack
ElectricMaxxx Mar 5, 2019
3288fc4
cs fixes
ElectricMaxxx Mar 5, 2019
602d603
try to use it with testing component`s bootstrap
ElectricMaxxx Mar 5, 2019
33388be
move to non dev
ElectricMaxxx Mar 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file is a "template" of which env vars need to be defined for your application
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this file be committed? i think only the .env.dist should be, and .env should be in .gitignore

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are completely right

# Copy this file to .env file for development, create environment variables when deploying to production
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=9d27ae2fee5cdce7eb45d7aba490cfcb
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
#TRUSTED_HOSTS=localhost,example.com
###< symfony/framework-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 ###

###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Configure your db driver and server_version in config/packages/doctrine.yaml
DATABASE_URL=mysql://db_user:[email protected]:3306/db_name
###< doctrine/doctrine-bundle ###
24 changes: 24 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file is a "template" of which env vars need to be defined for your application
# Copy this file to .env file for development, create environment variables when deploying to production
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=9d27ae2fee5cdce7eb45d7aba490cfcb
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
#TRUSTED_HOSTS=localhost,example.com
###< symfony/framework-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 ###

###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Configure your db driver and server_version in config/packages/doctrine.yaml
DATABASE_URL=mysql://db_user:[email protected]:3306/db_name
###< doctrine/doctrine-bundle ###
35 changes: 16 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
/app/config/parameters.yml
/build/
/phpunit.xml
/var/*
!/var/cache
/var/cache/*
!var/cache/.gitkeep
!/var/logs
/var/logs/*
!var/logs/.gitkeep
!/var/sessions
/var/sessions/*
!var/sessions/.gitkeep
!var/SymfonyRequirements.php

###> symfony/framework-bundle ###
.env
/public/bundles/
/var/
/vendor/
/web/bundles/
###< symfony/framework-bundle ###

###> symfony/phpunit-bridge ###
.phpunit
/phpunit.xml
###< symfony/phpunit-bridge ###

vagrant/.vagrant
/config/phpcr.yaml

/app/config/phpcr.yml
/jackrabbit/
/jackrabbit-standalone-*.jar
/vagrant/.vagrant
build/
.php_cs.cache
64 changes: 64 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

/**
* DO NOT EDIT THIS FILE!
*
* It's auto-generated by sonata-project/dev-kit package.
*/

$header = <<<'HEADER'
This file is part of the Symfony CMF package.

(c) Symfony CMF

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
HEADER;

$rules = [
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => [
'syntax' => 'short',
],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'header_comment' => [
'header' => $header,
],
'no_extra_blank_lines' => true,
'no_php4_constructor' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
'@PHP56Migration' => true,
'@PHP56Migration:risky' => true,
'@PHPUnit57Migration:risky' => true,
'@PHP70Migration' => true,
'@PHP70Migration:risky' => true,
'@PHPUnit60Migration:risky' => true,
'@PHP71Migration' => true,
'@PHP71Migration:risky' => true,
'compact_nullable_typehint' => true,
'void_return' => null,
'strict_comparison' => true,
'strict_param' => true,
];


$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('Tests/Fixtures')
->exclude('tests/Fixtures')
->exclude('Resources/skeleton')
->exclude('Resources/public/vendor')
;

return PhpCsFixer\Config::create()
->setFinder($finder)
->setRiskyAllowed(true)
->setRules($rules)
->setUsingCache(true)
;
7 changes: 3 additions & 4 deletions .platform.app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ build:
# The configuration of app when it is exposed to the web.
web:
# The public directory of the app, relative to its root.
document_root: "/web"
document_root: "/public"
# The front-controller script to send non-static requests to.
passthru: "/app.php"
passthru: "/index.php"
whitelist:
# slides
- ^/slides/.*\.html$
Expand Down Expand Up @@ -58,9 +58,8 @@ mounts:
# The hooks that will be performed when the package is deployed.
hooks:
build: |
rm web/app_dev.php
# place sqlite file into /tmp so that we can write to it during deploy
sed -i 's@%kernel.root_dir%/../var/app.sqlite@/tmp/app.sqlite@' app/config/parameters.yml
sed -i 's@%kernel.project_dir%/var/app.sqlite@/tmp/app.sqlite@' app/config/parameters.yml
bin/console --env=prod assets:install -n --no-debug
bin/console --env=prod assetic:dump -n --no-debug
deploy: ./bin/reloadFixtures.sh $PWD true
Expand Down
12 changes: 4 additions & 8 deletions .sensiolabs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@

global_exclude_dirs:
- vendor
- web
- app/tests
- public
- tests
- vagrant
- bin

pre_composer_script: |
#!/bin/bash

cp app/config/parameters.yml.dist app/config/parameters.yml
cp app/config/phpcr_doctrine_dbal.yml.dist app/config/phpcr.yml
cp config/fixtures/parameters.yml.dist config/packages/parameters.yml
cp config/fixtures/phpcr_doctrine_dbal.yml.dist config/packages/phpcr.yml

exclude_patterns:
- app/autoload.php
- app/check.php
- app/SymfonyRequirements.php

rules:
symfony.web_config_should_not_be_present:
Expand Down
23 changes: 11 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ matrix:
env: TRANSPORT=jackrabbit COMPOSER_INSTALL=1
- php: 7.1
env: TRANSPORT=doctrine_dbal COMPOSER_INSTALL=1
- env: TARGET=lint

env:
global:
- SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml" SYMFONY_PHPUNIT_VERSION=5.7
- SYMFONY_DEPRECATIONS_HELPER=weak
- SYMFONY_DEPRECATIONS_HELPER="/.*each.*/"
- SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml"
- TARGET=test
- SYMFONY_PHPUNIT_VERSION=5.7
- PHPUNIT_VERSION=5.7.26
matrix:
- TRANSPORT=jackrabbit
- TRANSPORT=doctrine_dbal
Expand All @@ -32,19 +36,14 @@ before_install:
- composer self-update

install:
- phpenv config-add travis.php.ini
- php -ini | grep memory_limit
- if [ "$COMPOSER_INSTALL" != "1" ]; then composer update --no-scripts --prefer-dist; else composer install --no-scripts --prefer-dist; fi
- if [ -x .travis/install_${TARGET}.sh ]; then .travis/install_${TARGET}.sh; fi;

before_script:
- cp app/config/phpcr_${TRANSPORT}.yml.dist app/config/phpcr.yml
- composer run-script post-update-cmd
- ./tests/travis_${TRANSPORT}.sh
- bin/console doctrine:phpcr:workspace:create sandbox_test -e=test
- bin/console doctrine:phpcr:repository:init -e=test
- if [ -x .travis/before_${TARGET}.sh ]; then .travis/before_${TARGET}.sh; fi;

script: php vendor/bin/simple-phpunit --debug
script: make $TARGET

after_success:
- if [ -x .travis/after_${TARGET}.sh ]; then .travis/after_${TARGET}.sh; fi;
notifications:
irc: "irc.freenode.org#symfony-cmf"
email: "[email protected]"
5 changes: 5 additions & 0 deletions .travis/after_success_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

#!/usr/bin/env sh
set -ev

coveralls -v
9 changes: 9 additions & 0 deletions .travis/before_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

phpenv config-add travis.php.ini
php -ini | grep memory_limit
cp config/fixtures/phpcr_${TRANSPORT}.yaml.dist config/phpcr.yaml
composer run-script post-update-cmd
./tests/travis_${TRANSPORT}.sh
bin/console doctrine:phpcr:workspace:create sandbox_test -e test
bin/console doctrine:phpcr:repository:init -e test
11 changes: 11 additions & 0 deletions .travis/install_lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh
set -ev

mkdir --parents "${HOME}/bin"

wget "http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar" --output-document="${HOME}/bin/php-cs-fixer"
chmod u+x "${HOME}/bin/php-cs-fixer"

composer global require sllh/composer-lint:@stable --prefer-dist --no-interaction

gem install yaml-lint
24 changes: 24 additions & 0 deletions .travis/install_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env sh
set -ev

mkdir --parents "${HOME}/bin"

wget "https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar" --output-document="${HOME}/bin/phpunit"
chmod u+x "${HOME}/bin/phpunit"

# Coveralls client install
wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar --output-document="${HOME}/bin/coveralls"
chmod u+x "${HOME}/bin/coveralls"

# To be removed when these issues are resolved:
# https://github.com/composer/composer/issues/5355
if [ "${COMPOSER_FLAGS}" = '--prefer-lowest' ]; then
composer update --prefer-dist --no-interaction --prefer-stable --quiet
fi

if [ "$COMPOSER_INSTALL" != "1" ]; then
composer update --no-scripts --prefer-dist;
else
composer install --no-scripts --prefer-dist;
fi

56 changes: 56 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#######################################################
# DO NOT EDIT THIS FILE! #
# #
# It's auto-generated by symfony-cmf/dev-kit package. #
#######################################################

############################################################################
# This file is part of the Symfony CMF package. #
# #
# (c) Symfony CMF #
# #
# For the full copyright and license information, please view the LICENSE #
# file that was distributed with this source code. #
############################################################################

TESTING_SCRIPTS_DIR=vendor/symfony-cmf/testing/bin
CONSOLE=${TESTING_SCRIPTS_DIR}/console
VERSION=dev-master
ifdef BRANCH
VERSION=dev-${BRANCH}
endif
PACKAGE=symfony-cmf/seo-bundle
HAS_XDEBUG=$(shell php --modules|grep --quiet xdebug;echo $$?)

list:
@echo 'test: will run all tests'
@echo 'lint: will run linting for composer and php'

.PHONY: test
test: build/xdebug-filter.php$
@php vendor/bin/simple-phpunit --debug
lint-php:
php-cs-fixer fix --ansi --verbose --diff --dry-run
.PHONY: lint-php

lint: lint-composer lint-php
.PHONY: lint

lint-composer:
composer validate
.PHONY: lint-composer

cs-fix: cs-fix-php
.PHONY: cs-fix

cs-fix-php:
php-cs-fixer fix --verbose
.PHONY: cs-fix-php

build:
mkdir $@

build/xdebug-filter.php: phpunit.xml.dist build
ifeq ($(HAS_XDEBUG), 0)
phpunit --dump-xdebug-filter $@
endif
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You can run the sandbox on your system, or in a virtualbox VM using Vagrant. For

### You will need:

* PHP 5.3.9+ (with intl extension)
* PHP 7.1+ (with intl extension)
* PHPUnit 3.6+ (optional)
* Composer

Expand All @@ -43,11 +43,11 @@ implementation.
Once you have that, copy the default jackalope-jackrabbit configuration file,
adjust it as needed and install the dependencies with composer:

cp app/config/phpcr_jackrabbit.yml.dist app/config/phpcr.yml
cp config/fixtures/phpcr_jackrabbit.yml.dist config/packages/phpcr.yml

The last command will fetch the main project and all its dependencies (CMF
Bundles, Symfony, Doctrine\PHPCR, Jackalope ... ). You might want to have a look
at the ``app/config/parameters.yml`` and adjust as needed.
at the ``config/packages/phpcr.yml`` and adjust as needed.

### Install the Doctrine DBAL provider (optional)

Expand All @@ -56,7 +56,7 @@ files and create the database accordingly. If you have the PHP sqlite extension
available, this is the simplest to quickly try out the CMF. Copy the file
and then install the dependencies:

cp app/config/phpcr_doctrine_dbal.yml.dist app/config/phpcr.yml
cp config/fixtures/phpcr_doctrine_dbal.yml.dist config/packages/phpcr.yml

The Doctrine DBAL implementation is installed by default already along side the Jackrabbit implementation.

Expand Down Expand Up @@ -110,7 +110,7 @@ Create an apache virtual host entry along the lines of:

<Virtualhost *:80>
Servername cmf.lo
DocumentRoot /path/to/symfony-cmf/cmf-sandbox/web
DocumentRoot /path/to/symfony-cmf/cmf-sandbox/public
<Directory /path/to/symfony-cmf/cmf-sandbox>
AllowOverride All
</Directory>
Expand Down
1 change: 0 additions & 1 deletion app/.htaccess

This file was deleted.

Loading