diff --git a/composer.json b/composer.json index 9d43bee..184d29b 100644 --- a/composer.json +++ b/composer.json @@ -17,18 +17,18 @@ "require": { "php": ">=7.1.0", "doctrine/annotations": "^1.3", - "doctrine/doctrine-bundle": "^1.4", "doctrine/doctrine-migrations-bundle": "^2.0", - "doctrine/orm": "^2.5", "sensio/framework-extra-bundle": "^5.2", "sentry/sentry-symfony": "^2.2", + "symfony/console": "^4.2", + "symfony/finder": "^4.2", "symfony/flex": "^1.1", "symfony/form": "^4.2", - "symfony/monolog-bundle": "^3.3", "symfony/orm-pack": "^1.0", "symfony/security-bundle": "^4.2", "symfony/translation": "^4.2", "symfony/twig-bundle": "^4.2", + "symfony/yaml": "^4.2", "theodordiaconu/geshi": "dev-master", "theodordiaconu/geshi-bundle": "dev-master" },"require-dev": { diff --git a/composer.lock b/composer.lock index a3b5910..ca20d29 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3488c5d4756be564e9c5076a918bd373", + "content-hash": "12a1646d5d2aeff9249a996492e96c85", "packages": [ { "name": "doctrine/annotations", @@ -1291,84 +1291,6 @@ ], "time": "2018-06-13T13:22:40+00:00" }, - { - "name": "monolog/monolog", - "version": "1.24.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", - "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "provide": { - "psr/log-implementation": "1.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "doctrine/couchdb": "~1.0@dev", - "graylog2/gelf-php": "~1.0", - "jakub-onderka/php-parallel-lint": "0.9", - "php-amqplib/php-amqplib": "~2.4", - "php-console/php-console": "^3.1.3", - "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "2.3.0", - "ruflin/elastica": ">=0.90 <3.0", - "sentry/sentry": "^0.13", - "swiftmailer/swiftmailer": "^5.3|^6.0" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", - "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "php-console/php-console": "Allow sending log messages to Google Chrome", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "sentry/sentry": "Allow sending log messages to a Sentry server" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Monolog\\": "src/Monolog" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ], - "time": "2018-11-05T09:00:11+00:00" - }, { "name": "ocramius/package-versions", "version": "1.3.0", @@ -3063,137 +2985,6 @@ ], "time": "2019-01-05T16:37:49+00:00" }, - { - "name": "symfony/monolog-bridge", - "version": "v4.2.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/monolog-bridge.git", - "reference": "8fa559511f1d215ca81e22f222d50eb029f93902" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/8fa559511f1d215ca81e22f222d50eb029f93902", - "reference": "8fa559511f1d215ca81e22f222d50eb029f93902", - "shasum": "" - }, - "require": { - "monolog/monolog": "~1.19", - "php": "^7.1.3", - "symfony/contracts": "^1.0", - "symfony/http-kernel": "~3.4|~4.0" - }, - "conflict": { - "symfony/console": "<3.4", - "symfony/http-foundation": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0", - "symfony/event-dispatcher": "~3.4|~4.0", - "symfony/security-core": "~3.4|~4.0", - "symfony/var-dumper": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For the possibility to show log messages in console commands depending on verbosity settings.", - "symfony/event-dispatcher": "Needed when using log messages in console commands.", - "symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel.", - "symfony/var-dumper": "For using the debugging handlers like the console handler or the log server handler." - }, - "type": "symfony-bridge", - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Bridge\\Monolog\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Monolog Bridge", - "homepage": "https://symfony.com", - "time": "2019-01-03T09:07:35+00:00" - }, - { - "name": "symfony/monolog-bundle", - "version": "v3.3.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/monolog-bundle.git", - "reference": "572e143afc03419a75ab002c80a2fd99299195ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/572e143afc03419a75ab002c80a2fd99299195ff", - "reference": "572e143afc03419a75ab002c80a2fd99299195ff", - "shasum": "" - }, - "require": { - "monolog/monolog": "~1.22", - "php": ">=5.6", - "symfony/config": "~2.7|~3.3|~4.0", - "symfony/dependency-injection": "~2.7|~3.4.10|^4.0.10", - "symfony/http-kernel": "~2.7|~3.3|~4.0", - "symfony/monolog-bridge": "~2.7|~3.3|~4.0" - }, - "require-dev": { - "symfony/console": "~2.7|~3.3|~4.0", - "symfony/phpunit-bridge": "^3.3|^4.0", - "symfony/yaml": "~2.7|~3.3|~4.0" - }, - "type": "symfony-bundle", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Bundle\\MonologBundle\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony MonologBundle", - "homepage": "http://symfony.com", - "keywords": [ - "log", - "logging" - ], - "time": "2018-11-04T09:58:13+00:00" - }, { "name": "symfony/options-resolver", "version": "v4.2.2", @@ -4278,6 +4069,65 @@ ], "time": "2019-01-03T09:09:06+00:00" }, + { + "name": "symfony/yaml", + "version": "v4.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "d0aa6c0ea484087927b49fd513383a7d36190ca6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/d0aa6c0ea484087927b49fd513383a7d36190ca6", + "reference": "d0aa6c0ea484087927b49fd513383a7d36190ca6", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2019-01-03T09:07:35+00:00" + }, { "name": "theodordiaconu/geshi", "version": "dev-master", @@ -4761,6 +4611,84 @@ ], "time": "2016-10-17T18:31:11+00:00" }, + { + "name": "monolog/monolog", + "version": "1.24.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "time": "2018-11-05T09:00:11+00:00" + }, { "name": "paragonie/random_compat", "version": "v9.99.99", @@ -5008,6 +4936,137 @@ ], "time": "2019-01-03T09:07:35+00:00" }, + { + "name": "symfony/monolog-bridge", + "version": "v4.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/monolog-bridge.git", + "reference": "8fa559511f1d215ca81e22f222d50eb029f93902" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/8fa559511f1d215ca81e22f222d50eb029f93902", + "reference": "8fa559511f1d215ca81e22f222d50eb029f93902", + "shasum": "" + }, + "require": { + "monolog/monolog": "~1.19", + "php": "^7.1.3", + "symfony/contracts": "^1.0", + "symfony/http-kernel": "~3.4|~4.0" + }, + "conflict": { + "symfony/console": "<3.4", + "symfony/http-foundation": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/security-core": "~3.4|~4.0", + "symfony/var-dumper": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For the possibility to show log messages in console commands depending on verbosity settings.", + "symfony/event-dispatcher": "Needed when using log messages in console commands.", + "symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel.", + "symfony/var-dumper": "For using the debugging handlers like the console handler or the log server handler." + }, + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bridge\\Monolog\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Monolog Bridge", + "homepage": "https://symfony.com", + "time": "2019-01-03T09:07:35+00:00" + }, + { + "name": "symfony/monolog-bundle", + "version": "v3.3.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/monolog-bundle.git", + "reference": "572e143afc03419a75ab002c80a2fd99299195ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/572e143afc03419a75ab002c80a2fd99299195ff", + "reference": "572e143afc03419a75ab002c80a2fd99299195ff", + "shasum": "" + }, + "require": { + "monolog/monolog": "~1.22", + "php": ">=5.6", + "symfony/config": "~2.7|~3.3|~4.0", + "symfony/dependency-injection": "~2.7|~3.4.10|^4.0.10", + "symfony/http-kernel": "~2.7|~3.3|~4.0", + "symfony/monolog-bridge": "~2.7|~3.3|~4.0" + }, + "require-dev": { + "symfony/console": "~2.7|~3.3|~4.0", + "symfony/phpunit-bridge": "^3.3|^4.0", + "symfony/yaml": "~2.7|~3.3|~4.0" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bundle\\MonologBundle\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony MonologBundle", + "homepage": "http://symfony.com", + "keywords": [ + "log", + "logging" + ], + "time": "2018-11-04T09:58:13+00:00" + }, { "name": "symfony/polyfill-php72", "version": "v1.10.0", @@ -5340,65 +5399,6 @@ "description": "Symfony WebServerBundle", "homepage": "https://symfony.com", "time": "2019-01-03T09:07:35+00:00" - }, - { - "name": "symfony/yaml", - "version": "v4.2.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "d0aa6c0ea484087927b49fd513383a7d36190ca6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/d0aa6c0ea484087927b49fd513383a7d36190ca6", - "reference": "d0aa6c0ea484087927b49fd513383a7d36190ca6", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2019-01-03T09:07:35+00:00" } ], "aliases": [], diff --git a/config/bundles.php b/config/bundles.php index 97c1560..d271724 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -4,14 +4,14 @@ return [ Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], - Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], - Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['all' => true], Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], DT\Bundle\GeshiBundle\DTGeshiBundle::class => ['all' => true], Sentry\SentryBundle\SentryBundle::class => ['all' => true], - Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], - Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true, 'test' => true], -]; \ No newline at end of file + Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], + Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true], + Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true], + Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true], +]; diff --git a/config/packages/dev/monolog.yaml b/config/packages/dev/monolog.yaml index 479f837..b1998da 100644 --- a/config/packages/dev/monolog.yaml +++ b/config/packages/dev/monolog.yaml @@ -1,29 +1,19 @@ monolog: handlers: main: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.log" - level: debug - console: - type: console - bubble: false - verbosity_levels: - VERBOSITY_VERBOSE: INFO - VERBOSITY_VERY_VERBOSE: DEBUG - channels: ["!doctrine"] - console_very_verbose: - type: console - bubble: false - verbosity_levels: - VERBOSITY_VERBOSE: NOTICE - VERBOSITY_VERY_VERBOSE: NOTICE - VERBOSITY_DEBUG: DEBUG - channels: ["doctrine"] + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + channels: ["!event"] # uncomment to get logging in your browser # you may have to allow bigger header sizes in your Web server configuration #firephp: - # type: firephp - # level: info + # type: firephp + # level: info #chromephp: - # type: chromephp - # level: info + # type: chromephp + # level: info + console: + type: console + process_psr_3_messages: false + channels: ["!event", "!doctrine", "!console"] diff --git a/config/packages/dev/orm_fixtures.yaml b/config/packages/dev/orm_fixtures.yaml new file mode 100644 index 0000000..44870a5 --- /dev/null +++ b/config/packages/dev/orm_fixtures.yaml @@ -0,0 +1,10 @@ +# src/AppBundle/Resources/config/dataFixture.yml +services: + _defaults: + tags: ['doctrine.fixture.orm'] + autowire: true # if you need dependency injection, see next bullet point + bind: + $projectDir: '%kernel.project_dir%' + + App\DataFixtures\ORM\: + resource: '%kernel.project_dir%/src/DataFixtures/ORM/*' \ No newline at end of file diff --git a/config/packages/dev/web_profiler.yaml b/config/packages/dev/web_profiler.yaml index 1f1cb2b..e92166a 100644 --- a/config/packages/dev/web_profiler.yaml +++ b/config/packages/dev/web_profiler.yaml @@ -1,3 +1,6 @@ web_profiler: toolbar: true intercept_redirects: false + +framework: + profiler: { only_exceptions: false } diff --git a/config/packages/prod/monolog.yaml b/config/packages/prod/monolog.yaml index 25f2c67..96dbf96 100644 --- a/config/packages/prod/monolog.yaml +++ b/config/packages/prod/monolog.yaml @@ -1,12 +1,25 @@ monolog: handlers: main: - type: fingers_crossed + type: fingers_crossed action_level: error - handler: nested + handler: nested + excluded_404s: + # regex: exclude all 404 errors from the logs + - ^/ nested: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.log" + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" level: debug console: - type: console + type: console + process_psr_3_messages: false + channels: ["!event", "!doctrine"] + deprecation: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log" + deprecation_filter: + type: filter + handler: deprecation + max_level: info + channels: ["php"] diff --git a/config/packages/test/monolog.yaml b/config/packages/test/monolog.yaml new file mode 100644 index 0000000..2762653 --- /dev/null +++ b/config/packages/test/monolog.yaml @@ -0,0 +1,7 @@ +monolog: + handlers: + main: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + channels: ["!event"] diff --git a/config/packages/test/orm_fixtures.yaml b/config/packages/test/orm_fixtures.yaml new file mode 100644 index 0000000..44870a5 --- /dev/null +++ b/config/packages/test/orm_fixtures.yaml @@ -0,0 +1,10 @@ +# src/AppBundle/Resources/config/dataFixture.yml +services: + _defaults: + tags: ['doctrine.fixture.orm'] + autowire: true # if you need dependency injection, see next bullet point + bind: + $projectDir: '%kernel.project_dir%' + + App\DataFixtures\ORM\: + resource: '%kernel.project_dir%/src/DataFixtures/ORM/*' \ No newline at end of file diff --git a/config/packages/test/web_profiler.yaml b/config/packages/test/web_profiler.yaml index 85319b4..03752de 100644 --- a/config/packages/test/web_profiler.yaml +++ b/config/packages/test/web_profiler.yaml @@ -1,3 +1,6 @@ web_profiler: toolbar: false intercept_redirects: false + +framework: + profiler: { collect: false } diff --git a/config/routes/dev/web_profiles.yaml b/config/routes/dev/web_profiles.yaml deleted file mode 100644 index c82beff..0000000 --- a/config/routes/dev/web_profiles.yaml +++ /dev/null @@ -1,7 +0,0 @@ -web_profiler_wdt: - resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml' - prefix: /_wdt - -web_profiler_profiler: - resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml' - prefix: /_profiler diff --git a/src/DataFixtures/ORM/LoadLanguages.php b/src/DataFixtures/ORM/LoadLanguages.php index a23bc3a..03a4e5c 100644 --- a/src/DataFixtures/ORM/LoadLanguages.php +++ b/src/DataFixtures/ORM/LoadLanguages.php @@ -2,48 +2,28 @@ namespace App\DataFixtures\ORM; -use Doctrine\Common\DataFixtures\FixtureInterface; +use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Common\Persistence\ObjectManager; -use Doctrine\ORM\Query; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Finder\Finder; -use Symfony\Component\Finder\SplFileInfo; use App\Entity\Language; -/** - * Description of LoadLanguages - * - * @author Alexey Skobkin - */ -class LoadLanguages implements FixtureInterface, ContainerAwareInterface +class LoadLanguages extends Fixture { - /** - * @var ContainerInterface - */ - private $container; - - /** - * {@inheritDoc} - */ - public function setContainer(ContainerInterface $container = null) + /** @var string */ + private $projectDir; + + public function __construct(string $projectDir) { - $this->container = $container; + $this->projectDir = $projectDir; } - - /** - * {@inheritDoc} - */ + public function load(ObjectManager $manager) { - $output = new ConsoleOutput(); - - $geshiPath = $this->container->get('kernel')->getRootDir() . '/../vendor/theodordiaconu/geshi/src/GeSHi/geshi'; - + $geshiPath = $this->projectDir.'/vendor/theodordiaconu/geshi/src/GeSHi/geshi'; + $finder = new Finder(); $finder->files()->in($geshiPath); - + // Fix constants define('GESHI_CAPS_NO_CHANGE', true); define('GESHI_COMMENTS', true); @@ -73,26 +53,19 @@ class LoadLanguages implements FixtureInterface, ContainerAwareInterface define('GESHI_CLASS', true); define('GESHI_NUMBER_OCT_PREFIX_0O', true); define('GESHI_NUMBER_OCT_PREFIX_AT', true); - - /* @var $file SplFileInfo */ + + /* @var $file \SplFileInfo */ foreach ($finder as $file) { - $output->writeln($file->getRelativePathname() . ' found. Parsing...'); - include $geshiPath.DIRECTORY_SEPARATOR.$file->getRelativePathname(); - - $language = new Language(); - $language - ->setName($language_data['LANG_NAME']) - ->setCode(basename($file->getRelativePathname(), '.php')) - ->setIsEnabled(true) - ; - - $output->write('---> "' . $language->getName() . '"'); + + $language = new Language( + $language_data['LANG_NAME'], + basename($file->getRelativePathname(), '.php') + ); + $manager->persist($language); - $manager->flush(); - $output->writeln(' [ PERSISTED ]'); } - - $output->writeln('Import finished!'); + + $manager->flush(); } } diff --git a/src/Entity/Language.php b/src/Entity/Language.php index 41597a9..2a96541 100644 --- a/src/Entity/Language.php +++ b/src/Entity/Language.php @@ -51,6 +51,13 @@ class Language */ private $isEnabled; + public function __construct(string $name, string $code, bool $enabled = true) + { + $this->name = $name; + $this->code = $code; + $this->isEnabled = $enabled; + } + public function getId(): int { return $this->id; diff --git a/symfony.lock b/symfony.lock index 8249f62..e5cd7a9 100644 --- a/symfony.lock +++ b/symfony.lock @@ -1,4 +1,16 @@ { + "doctrine/data-fixtures": { + "version": "v1.3.1" + }, + "doctrine/doctrine-fixtures-bundle": { + "version": "3.0", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "3.0", + "ref": "fc52d86631a6dfd9fdf3381d0b7e3df2069e51b3" + } + }, "easycorp/easy-log-handler": { "version": "1.0", "recipe": { @@ -8,6 +20,9 @@ "ref": "70062abc2cd58794d2a90274502f81b55cd9951b" } }, + "monolog/monolog": { + "version": "1.24.0" + }, "symfony/cache": { "version": "v4.2.2" }, @@ -92,12 +107,24 @@ "symfony/monolog-bridge": { "version": "v4.2.2" }, + "symfony/monolog-bundle": { + "version": "3.1", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "3.1", + "ref": "18ebf5a940573a20de06f9c4060101eeb438cf3d" + } + }, "symfony/options-resolver": { "version": "v4.2.2" }, "symfony/orm-pack": { "version": "v1.0.6" }, + "symfony/polyfill-php72": { + "version": "v1.10.0" + }, "symfony/process": { "version": "v4.2.2" },