aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2018-10-24 21:02:35 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2018-10-24 21:47:51 +0200
commitb502d6ad0964267b49f91eafb3bed8a4693aba0f (patch)
treed362c7b4d064c93846664297a8b316090c89e079
parenta02924ea2618549bacf948188c06092afcd6a8d1 (diff)
downloadwallabag-b502d6ad0964267b49f91eafb3bed8a4693aba0f.tar.gz
wallabag-b502d6ad0964267b49f91eafb3bed8a4693aba0f.tar.zst
wallabag-b502d6ad0964267b49f91eafb3bed8a4693aba0f.zip
Cleanup
-rw-r--r--.travis.yml21
-rw-r--r--.zappr.yaml26
-rw-r--r--COPYING.md2
-rw-r--r--README.md6
-rw-r--r--app/AppKernel.php22
-rw-r--r--app/autoload.php13
-rwxr-xr-xbin/console12
-rw-r--r--composer.json29
-rw-r--r--phpunit.xml.dist4
-rw-r--r--src/Wallabag/CoreBundle/Doctrine/WallabagMigration.php2
-rw-r--r--web/app.php7
-rw-r--r--web/app_dev.php12
12 files changed, 67 insertions, 89 deletions
diff --git a/.travis.yml b/.travis.yml
index eb409533..5b5b1808 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,17 +1,17 @@
1language: php 1language: php
2 2
3services: 3services:
4 - rabbitmq 4 - rabbitmq
5 - redis 5 - redis
6 6
7# faster builds on docker-container setup 7# faster builds on docker-container setup
8sudo: false 8sudo: false
9 9
10# used for HHVM 10# used for HHVM
11addons: 11addons:
12 apt: 12 apt:
13 packages: 13 packages:
14 - tidy 14 - tidy
15 15
16# cache vendor dirs 16# cache vendor dirs
17cache: 17cache:
@@ -24,8 +24,6 @@ cache:
24 - $HOME/.yarn-cache 24 - $HOME/.yarn-cache
25 25
26php: 26php:
27 - 5.6
28 - 7.0
29 - 7.1 27 - 7.1
30 - 7.2 28 - 7.2
31 - nightly 29 - nightly
@@ -41,7 +39,7 @@ env:
41matrix: 39matrix:
42 fast_finish: true 40 fast_finish: true
43 include: 41 include:
44 - php: 7.0 42 - php: 7.2
45 env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run ASSETS=build DB=sqlite 43 env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run ASSETS=build DB=sqlite
46 allow_failures: 44 allow_failures:
47 - php: nightly 45 - php: nightly
@@ -68,14 +66,13 @@ before_install:
68 - if [[ $TRAVIS_REPO_SLUG = wallabag/wallabag ]]; then cp .composer-auth.json ~/.composer/auth.json; fi; 66 - if [[ $TRAVIS_REPO_SLUG = wallabag/wallabag ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;
69 67
70script: 68script:
71 - travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist 69 - travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist
70
72 - echo "travis_fold:start:prepare" 71 - echo "travis_fold:start:prepare"
73 - make prepare DB=$DB 72 - make prepare DB=$DB
74 - echo "travis_fold:end:prepare" 73 - echo "travis_fold:end:prepare"
75 74
76 - echo "travis_fold:start:fixtures" 75 - make fixtures
77 - php bin/console doctrine:fixtures:load --no-interaction --env=test
78 - echo "travis_fold:end:fixtures"
79 76
80 - if [[ $VALIDATE_TRANSLATION_FILE = '' ]]; then ./bin/simple-phpunit -v ; fi; 77 - if [[ $VALIDATE_TRANSLATION_FILE = '' ]]; then ./bin/simple-phpunit -v ; fi;
81 - if [[ $CS_FIXER = run ]]; then php bin/php-cs-fixer fix --verbose --dry-run ; fi; 78 - 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 @@
1# see https://zappr.opensource.zalan.do/
2autobranch: false
3commit: false
4approvals:
5 minimum: 1
6 ignore: pr_opener
7 pattern: "^(:\\+1:|👍)$"
8 veto:
9 pattern: "^(:\\-1:|👎)$"
10 from:
11 orgs:
12 - wallabag
13 collaborators: true
14specification:
15 title:
16 minimum-length:
17 enabled: true
18 length: 8
19 body:
20 minimum-length:
21 enabled: true
22 length: 8
23 contains-url: false
24 contains-issue-number: false
25 template:
26 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 @@
1Copyright (c) 2013-2017 Nicolas Lœuillet 1Copyright (c) 2013-current Nicolas Lœuillet
2 2
3Permission is hereby granted, free of charge, to any person obtaining a copy 3Permission is hereby granted, free of charge, to any person obtaining a copy
4of this software and associated documentation files (the "Software"), to deal 4of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 15c4ecb2..1e0efada 100644
--- a/README.md
+++ b/README.md
@@ -19,10 +19,10 @@ Then you can install wallabag by executing the following commands:
19 19
20``` 20```
21git clone https://github.com/wallabag/wallabag.git 21git clone https://github.com/wallabag/wallabag.git
22cd wallabag && make install 22cd wallabag && make install
23``` 23```
24 24
25Now, [configure a virtual host](https://doc.wallabag.org/en/admin/installation/virtualhosts.html) to use your wallabag. 25Now, [configure a virtual host](https://doc.wallabag.org/en/admin/installation/virtualhosts.html) to use your wallabag.
26 26
27# Run on YunoHost 27# Run on YunoHost
28[![Install Wallabag with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=wallabag2) 28[![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
30Wallabag app for [YunoHost](https://yunohost.org). See [here](https://github.com/YunoHost-Apps/wallabag2_ynh) 30Wallabag app for [YunoHost](https://yunohost.org). See [here](https://github.com/YunoHost-Apps/wallabag2_ynh)
31 31
32# License 32# License
33Copyright © 2013-2018 Nicolas Lœuillet <nicolas@loeuillet.org> 33Copyright © 2013-current Nicolas Lœuillet <nicolas@loeuillet.org>
34This work is free. You can redistribute it and/or modify it under the 34This work is free. You can redistribute it and/or modify it under the
35terms of the MIT License. See the COPYING file for more details. 35terms 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 @@
1<?php 1<?php
2 2
3use Symfony\Component\Config\Loader\LoaderInterface; 3use Symfony\Component\Config\Loader\LoaderInterface;
4use Symfony\Component\DependencyInjection\ContainerBuilder;
4use Symfony\Component\HttpKernel\Kernel; 5use Symfony\Component\HttpKernel\Kernel;
5 6
6class AppKernel extends Kernel 7class AppKernel extends Kernel
@@ -46,18 +47,26 @@ class AppKernel extends Kernel
46 $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); 47 $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
47 $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); 48 $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
48 $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); 49 $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
49 $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
50 $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(); 50 $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
51 $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
52 51
53 if ('test' === $this->getEnvironment()) { 52 if ('test' === $this->getEnvironment()) {
54 $bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle(); 53 $bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle();
55 } 54 }
55
56 if ('dev' === $this->getEnvironment()) {
57 $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
58 $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
59 }
56 } 60 }
57 61
58 return $bundles; 62 return $bundles;
59 } 63 }
60 64
65 public function getRootDir()
66 {
67 return __DIR__;
68 }
69
61 public function getCacheDir() 70 public function getCacheDir()
62 { 71 {
63 return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment(); 72 return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
@@ -70,7 +79,8 @@ class AppKernel extends Kernel
70 79
71 public function registerContainerConfiguration(LoaderInterface $loader) 80 public function registerContainerConfiguration(LoaderInterface $loader)
72 { 81 {
73 $loader->load($this->getProjectDir() . '/app/config/config_' . $this->getEnvironment() . '.yml'); 82 $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
83
74 $loader->load(function ($container) { 84 $loader->load(function ($container) {
75 if ($container->getParameter('use_webpack_dev_server')) { 85 if ($container->getParameter('use_webpack_dev_server')) {
76 $container->loadFromExtension('framework', [ 86 $container->loadFromExtension('framework', [
@@ -86,5 +96,11 @@ class AppKernel extends Kernel
86 ]); 96 ]);
87 } 97 }
88 }); 98 });
99
100 $loader->load(function (ContainerBuilder $container) {
101 // $container->setParameter('container.autowiring.strict_mode', true);
102 // $container->setParameter('container.dumper.inline_class_loader', true);
103 $container->addObjectResource($this);
104 });
89 } 105 }
90} 106}
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 @@
1<?php
2
3use Composer\Autoload\ClassLoader;
4use Doctrine\Common\Annotations\AnnotationRegistry;
5
6/**
7 * @var ClassLoader
8 */
9$loader = require __DIR__ . '/../vendor/autoload.php';
10
11AnnotationRegistry::registerLoader([$loader, 'loadClass']);
12
13return $loader;
diff --git a/bin/console b/bin/console
index 49247c94..8cef40b2 100755
--- a/bin/console
+++ b/bin/console
@@ -6,19 +6,17 @@ use Symfony\Component\Console\Input\ArgvInput;
6use Symfony\Component\Debug\Debug; 6use Symfony\Component\Debug\Debug;
7 7
8// if you don't want to setup permissions the proper way, just uncomment the following PHP line 8// if you don't want to setup permissions the proper way, just uncomment the following PHP line
9// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information 9// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
10// for more information
10//umask(0000); 11//umask(0000);
11 12
12set_time_limit(0); 13set_time_limit(0);
13 14
14/** 15require __DIR__.'/../vendor/autoload.php';
15 * @var Composer\Autoload\ClassLoader $loader
16 */
17$loader = require __DIR__.'/../app/autoload.php';
18 16
19$input = new ArgvInput(); 17$input = new ArgvInput();
20$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev'); 18$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev', true);
21$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod'; 19$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption('--no-debug', true) && $env !== 'prod';
22 20
23if ($debug) { 21if ($debug) {
24 Debug::enable(); 22 Debug::enable();
diff --git a/composer.json b/composer.json
index d8a4a478..4e838403 100644
--- a/composer.json
+++ b/composer.json
@@ -58,7 +58,7 @@
58 "jms/serializer-bundle": "~2.2", 58 "jms/serializer-bundle": "~2.2",
59 "nelmio/api-doc-bundle": "^2.13.2", 59 "nelmio/api-doc-bundle": "^2.13.2",
60 "mgargano/simplehtmldom": "~1.5", 60 "mgargano/simplehtmldom": "~1.5",
61 "wallabag/tcpdf": "^6.2.15", 61 "tecnickcom/tcpdf": "^6.2.26",
62 "simplepie/simplepie": "~1.5", 62 "simplepie/simplepie": "~1.5",
63 "willdurand/hateoas-bundle": "~1.3", 63 "willdurand/hateoas-bundle": "~1.3",
64 "liip/theme-bundle": "^1.4.6", 64 "liip/theme-bundle": "^1.4.6",
@@ -68,7 +68,7 @@
68 "friendsofsymfony/oauth-server-bundle": "^1.5.2", 68 "friendsofsymfony/oauth-server-bundle": "^1.5.2",
69 "stof/doctrine-extensions-bundle": "^1.2", 69 "stof/doctrine-extensions-bundle": "^1.2",
70 "scheb/two-factor-bundle": "^2.14.0", 70 "scheb/two-factor-bundle": "^2.14.0",
71 "grandt/phpepub": "^4.0.7", 71 "grandt/phpepub": "dev-master",
72 "wallabag/php-mobi": "~1.0.0", 72 "wallabag/php-mobi": "~1.0.0",
73 "kphoen/rulerz-bundle": "~0.13", 73 "kphoen/rulerz-bundle": "~0.13",
74 "guzzlehttp/guzzle": "^5.3.1", 74 "guzzlehttp/guzzle": "^5.3.1",
@@ -122,18 +122,33 @@
122 } 122 }
123 }, 123 },
124 "autoload": { 124 "autoload": {
125 "psr-4": { "Wallabag\\": "src/Wallabag/" }, 125 "psr-4": {
126 "classmap": [ "app/AppKernel.php", "app/AppCache.php" ] 126 "Wallabag\\": "src/Wallabag/"
127 },
128 "classmap": [
129 "app/AppKernel.php",
130 "app/AppCache.php"
131 ]
127 }, 132 },
128 "autoload-dev": { 133 "autoload-dev": {
129 "psr-4": { "Tests\\": "tests/" } 134 "psr-4": {
135 "Tests\\": "tests/"
136 },
137 "files": [ "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php" ]
130 }, 138 },
131 "config": { 139 "config": {
132 "bin-dir": "bin", 140 "bin-dir": "bin",
133 "platform": { 141 "platform": {
134 "php": "7.1.0" 142 "php": "7.1"
135 } 143 }
136 }, 144 },
137 "minimum-stability": "dev", 145 "minimum-stability": "dev",
138 "prefer-stable": true 146 "prefer-stable": true,
147 "repositories": [
148 {
149 "type": "vcs",
150 "url": "https://github.com/Daniel-KM/PHPePub",
151 "comment": "The most up-to-date PHPePub as of now"
152 }
153 ]
139} 154}
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 @@
4 xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd" 4 xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
5 backupGlobals="false" 5 backupGlobals="false"
6 colors="true" 6 colors="true"
7 bootstrap="app/autoload.php" 7 bootstrap="vendor/autoload.php"
8> 8>
9 9
10 <testsuites> 10 <testsuites>
@@ -15,7 +15,7 @@
15 15
16 <php> 16 <php>
17 <ini name="error_reporting" value="-1" /> 17 <ini name="error_reporting" value="-1" />
18 <server name="KERNEL_DIR" value="app/" /> 18 <server name="KERNEL_CLASS" value="AppKernel" />
19 <env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" /> 19 <env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
20 </php> 20 </php>
21 21
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 @@
2 2
3namespace Wallabag\CoreBundle\Doctrine; 3namespace Wallabag\CoreBundle\Doctrine;
4 4
5use Doctrine\DBAL\Migrations\AbstractMigration;
6use Doctrine\DBAL\Schema\Schema; 5use Doctrine\DBAL\Schema\Schema;
6use Doctrine\Migrations\AbstractMigration;
7use Symfony\Component\DependencyInjection\ContainerAwareInterface; 7use Symfony\Component\DependencyInjection\ContainerAwareInterface;
8use Symfony\Component\DependencyInjection\ContainerInterface; 8use Symfony\Component\DependencyInjection\ContainerInterface;
9 9
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 @@
2 2
3use Symfony\Component\HttpFoundation\Request; 3use Symfony\Component\HttpFoundation\Request;
4 4
5/** 5require __DIR__.'/../vendor/autoload.php';
6 * @var Composer\Autoload\ClassLoader
7 */
8$loader = require __DIR__.'/../app/autoload.php';
9include_once __DIR__.'/../var/bootstrap.php.cache';
10 6
11$kernel = new AppKernel('prod', false); 7$kernel = new AppKernel('prod', false);
12$kernel->loadClassCache();
13//$kernel = new AppCache($kernel); 8//$kernel = new AppCache($kernel);
14 9
15// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter 10// 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 @@
1<?php 1<?php
2 2
3use Symfony\Component\HttpFoundation\Request;
4use Symfony\Component\Debug\Debug; 3use Symfony\Component\Debug\Debug;
4use Symfony\Component\HttpFoundation\Request;
5 5
6// If you don't want to setup permissions the proper way, just uncomment the following PHP line 6// If you don't want to setup permissions the proper way, just uncomment the following PHP line
7// read http://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup 7// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
8// for more information 8// for more information
9//umask(0000); 9//umask(0000);
10 10
@@ -12,20 +12,16 @@ use Symfony\Component\Debug\Debug;
12// Feel free to remove this, extend it, or make something more sophisticated. 12// Feel free to remove this, extend it, or make something more sophisticated.
13if (isset($_SERVER['HTTP_CLIENT_IP']) 13if (isset($_SERVER['HTTP_CLIENT_IP'])
14 || isset($_SERVER['HTTP_X_FORWARDED_FOR']) 14 || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
15 || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server') 15 || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'], true) || PHP_SAPI === 'cli-server')
16) { 16) {
17 header('HTTP/1.0 403 Forbidden'); 17 header('HTTP/1.0 403 Forbidden');
18 exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); 18 exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
19} 19}
20 20
21/** 21require __DIR__.'/../vendor/autoload.php';
22 * @var Composer\Autoload\ClassLoader $loader
23 */
24$loader = require __DIR__.'/../app/autoload.php';
25Debug::enable(); 22Debug::enable();
26 23
27$kernel = new AppKernel('dev', true); 24$kernel = new AppKernel('dev', true);
28$kernel->loadClassCache();
29$request = Request::createFromGlobals(); 25$request = Request::createFromGlobals();
30$response = $kernel->handle($request); 26$response = $kernel->handle($request);
31$response->send(); 27$response->send();