From 6fc95673df5349d682eb6ca6185f894eb711d13a Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 24 Oct 2018 21:02:35 +0200 Subject: [PATCH] Cleanup --- .travis.yml | 16 ++-------- .zappr.yaml | 26 ----------------- COPYING.md | 2 +- README.md | 6 ++-- app/AppKernel.php | 22 ++++++++++++-- app/autoload.php | 13 --------- bin/console | 12 ++++---- composer.json | 29 ++++++++++++++----- phpunit.xml.dist | 4 +-- .../CoreBundle/Doctrine/WallabagMigration.php | 2 +- web/app.php | 7 +---- web/app_dev.php | 12 +++----- 12 files changed, 60 insertions(+), 91 deletions(-) delete mode 100644 .zappr.yaml delete mode 100644 app/autoload.php diff --git a/.travis.yml b/.travis.yml index 39306343..60721f61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,8 +21,6 @@ cache: - $HOME/.yarn-cache php: - - 5.6 - - 7.0 - 7.1 - 7.2 - nightly @@ -38,7 +36,7 @@ env: matrix: fast_finish: true include: - - php: 7.0 + - php: 7.2 env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run ASSETS=build DB=sqlite allow_failures: - php: nightly @@ -63,14 +61,6 @@ before_script: - if [[ ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi - composer self-update --no-progress - if [[ $DB = pgsql ]]; then psql -c 'create database wallabag_test;' -U postgres; fi; - # increase swap to avoid "proc_open(): fork failed - Cannot allocate memory" - # this should be removed when no more PHP 5 build will be defined - - sudo swapon -s - - sudo fallocate -l 4G /swapfile - - sudo chmod 600 /swapfile - - sudo mkswap /swapfile - - sudo swapon /swapfile - - sudo swapon -s script: - travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist @@ -78,9 +68,7 @@ script: - make prepare DB=$DB - echo "travis_fold:end:prepare" - - echo "travis_fold:start:fixtures" - - php bin/console doctrine:fixtures:load --no-interaction --env=test - - echo "travis_fold:end:fixtures" + - make fixtures - if [[ $VALIDATE_TRANSLATION_FILE = '' ]]; then ./bin/simple-phpunit -v ; fi; - if [[ $CS_FIXER = run ]]; then php bin/php-cs-fixer fix --verbose --dry-run ; fi; diff --git a/.zappr.yaml b/.zappr.yaml deleted file mode 100644 index f90cd809..00000000 --- a/.zappr.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# see https://zappr.opensource.zalan.do/ -autobranch: false -commit: false -approvals: - minimum: 1 - ignore: pr_opener - pattern: "^(:\\+1:|👍)$" - veto: - pattern: "^(:\\-1:|👎)$" - from: - orgs: - - wallabag - collaborators: true -specification: - title: - minimum-length: - enabled: true - length: 8 - body: - minimum-length: - enabled: true - length: 8 - contains-url: false - contains-issue-number: false - template: - differs-from-body: true diff --git a/COPYING.md b/COPYING.md index 6be863d3..72b9d5d0 100644 --- a/COPYING.md +++ b/COPYING.md @@ -1,4 +1,4 @@ -Copyright (c) 2013-2017 Nicolas Lœuillet +Copyright (c) 2013-current Nicolas Lœuillet Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 57392da2..e00c7ea0 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,10 @@ Then you can install wallabag by executing the following commands: ``` git clone https://github.com/wallabag/wallabag.git -cd wallabag && make install +cd wallabag && make install ``` -Now, [configure a virtual host](https://doc.wallabag.org/en/admin/installation/virtualhosts.html) to use your wallabag. +Now, [configure a virtual host](https://doc.wallabag.org/en/admin/installation/virtualhosts.html) to use your wallabag. # Run on YunoHost [![Install Wallabag with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=wallabag2) @@ -30,6 +30,6 @@ Now, [configure a virtual host](https://doc.wallabag.org/en/admin/installation/v Wallabag app for [YunoHost](https://yunohost.org). See [here](https://github.com/YunoHost-Apps/wallabag2_ynh) # License -Copyright © 2013-2018 Nicolas Lœuillet +Copyright © 2013-current Nicolas Lœuillet This work is free. You can redistribute it and/or modify it under the terms of the MIT License. See the COPYING file for more details. diff --git a/app/AppKernel.php b/app/AppKernel.php index 546794de..7d19e9ab 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -1,6 +1,7 @@ getEnvironment()) { $bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle(); } + + if ('dev' === $this->getEnvironment()) { + $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); + $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle(); + } } return $bundles; } + public function getRootDir() + { + return __DIR__; + } + public function getCacheDir() { return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment(); @@ -70,7 +79,8 @@ class AppKernel extends Kernel public function registerContainerConfiguration(LoaderInterface $loader) { - $loader->load($this->getProjectDir() . '/app/config/config_' . $this->getEnvironment() . '.yml'); + $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml'); + $loader->load(function ($container) { if ($container->getParameter('use_webpack_dev_server')) { $container->loadFromExtension('framework', [ @@ -86,5 +96,11 @@ class AppKernel extends Kernel ]); } }); + + $loader->load(function (ContainerBuilder $container) { + // $container->setParameter('container.autowiring.strict_mode', true); + // $container->setParameter('container.dumper.inline_class_loader', true); + $container->addObjectResource($this); + }); } } diff --git a/app/autoload.php b/app/autoload.php deleted file mode 100644 index c5f664dc..00000000 --- a/app/autoload.php +++ /dev/null @@ -1,13 +0,0 @@ -getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev'); -$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod'; +$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev', true); +$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption('--no-debug', true) && $env !== 'prod'; if ($debug) { Debug::enable(); diff --git a/composer.json b/composer.json index 4f234861..da2bd3b9 100644 --- a/composer.json +++ b/composer.json @@ -58,7 +58,7 @@ "jms/serializer-bundle": "~2.2", "nelmio/api-doc-bundle": "^2.13.2", "mgargano/simplehtmldom": "~1.5", - "wallabag/tcpdf": "^6.2.15", + "wallabag/tcpdf": "^6.2.26", "simplepie/simplepie": "~1.5", "willdurand/hateoas-bundle": "~1.3", "liip/theme-bundle": "^1.4.6", @@ -68,7 +68,7 @@ "friendsofsymfony/oauth-server-bundle": "^1.5.2", "stof/doctrine-extensions-bundle": "^1.2", "scheb/two-factor-bundle": "^2.14.0", - "grandt/phpepub": "^4.0.7", + "grandt/phpepub": "dev-master", "wallabag/php-mobi": "~1.0.0", "kphoen/rulerz-bundle": "~0.13", "guzzlehttp/guzzle": "^5.3.1", @@ -122,18 +122,33 @@ } }, "autoload": { - "psr-4": { "Wallabag\\": "src/Wallabag/" }, - "classmap": [ "app/AppKernel.php", "app/AppCache.php" ] + "psr-4": { + "Wallabag\\": "src/Wallabag/" + }, + "classmap": [ + "app/AppKernel.php", + "app/AppCache.php" + ] }, "autoload-dev": { - "psr-4": { "Tests\\": "tests/" } + "psr-4": { + "Tests\\": "tests/" + }, + "files": [ "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php" ] }, "config": { "bin-dir": "bin", "platform": { - "php": "7.1.0" + "php": "7.1" } }, "minimum-stability": "dev", - "prefer-stable": true + "prefer-stable": true, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/Daniel-KM/PHPePub", + "comment": "The most up-to-date PHPePub as of now" + } + ] } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 951b5a14..426a5e72 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -4,7 +4,7 @@ xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd" backupGlobals="false" colors="true" - bootstrap="app/autoload.php" + bootstrap="vendor/autoload.php" > @@ -15,7 +15,7 @@ - + diff --git a/src/Wallabag/CoreBundle/Doctrine/WallabagMigration.php b/src/Wallabag/CoreBundle/Doctrine/WallabagMigration.php index 7aa2409a..4a3fef3b 100644 --- a/src/Wallabag/CoreBundle/Doctrine/WallabagMigration.php +++ b/src/Wallabag/CoreBundle/Doctrine/WallabagMigration.php @@ -2,8 +2,8 @@ namespace Wallabag\CoreBundle\Doctrine; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/web/app.php b/web/app.php index 4c2c4650..3427e133 100644 --- a/web/app.php +++ b/web/app.php @@ -2,14 +2,9 @@ use Symfony\Component\HttpFoundation\Request; -/** - * @var Composer\Autoload\ClassLoader - */ -$loader = require __DIR__.'/../app/autoload.php'; -include_once __DIR__.'/../var/bootstrap.php.cache'; +require __DIR__.'/../vendor/autoload.php'; $kernel = new AppKernel('prod', false); -$kernel->loadClassCache(); //$kernel = new AppCache($kernel); // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter diff --git a/web/app_dev.php b/web/app_dev.php index 8456754d..57e1a433 100644 --- a/web/app_dev.php +++ b/web/app_dev.php @@ -1,10 +1,10 @@ loadClassCache(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); -- 2.41.0