diff --git a/.gitignore b/.gitignore index 69ce9ae8168c14834d892a42f4398e74337665a1..ccf67fef80929ef1a96139c0e8910fa70c33f873 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ /vendor/ /web/bundles/ /.idea +/var/data/* +!var/data/.gitkeep diff --git a/app/AppKernel.php b/app/AppKernel.php index ef068e03006e5ff4f8ccc8912ee1fb610613b5ec..0a01f95f0027b50796a648a986b9955c43231e60 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -12,10 +12,10 @@ class AppKernel extends Kernel new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Symfony\Bundle\TwigBundle\TwigBundle(), new Symfony\Bundle\MonologBundle\MonologBundle(), - new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), new AppBundle\AppBundle(), + new AKK\ModelBundle\AKKModelBundle(), ]; if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { diff --git a/app/Resources/views/default/index.html.twig b/app/Resources/views/default/index.html.twig index c720409a8e194684d123b9f1b224c38d188d5fa1..1e6b98ac0f1647d920663432c2c4180d32ee39da 100644 --- a/app/Resources/views/default/index.html.twig +++ b/app/Resources/views/default/index.html.twig @@ -14,6 +14,9 @@ Your application is now ready. You can start working on it at: <code>{{ base_dir }}</code> </p> + <p> + thing: {{ dump(thing) }} + </p> </div> <div id="next"> diff --git a/app/config/config.yml b/app/config/config.yml index 1a5c14761e87f9f442dfa70402468a0bd7d3b9c0..90ca16fae5740762d148ff915346baa81e359144 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -41,7 +41,7 @@ twig: # Doctrine Configuration doctrine: dbal: - driver: pdo_mysql + driver: pdo_sqlite host: '%database_host%' port: '%database_port%' dbname: '%database_name%' @@ -53,17 +53,4 @@ doctrine: # e.g. database_path: '%kernel.project_dir%/var/data/data.sqlite' # 2. Uncomment database_path in parameters.yml.dist # 3. Uncomment next line: - #path: '%database_path%' - - orm: - auto_generate_proxy_classes: '%kernel.debug%' - naming_strategy: doctrine.orm.naming_strategy.underscore - auto_mapping: true - -# Swiftmailer Configuration -swiftmailer: - transport: '%mailer_transport%' - host: '%mailer_host%' - username: '%mailer_user%' - password: '%mailer_password%' - spool: { type: memory } + path: '%database_path%' diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 2c20ddc8a481510bb8797e376e4b0357f21c0e30..4c2f98059a88f52cbf1d92ec6dbbeb39a59e607f 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -8,12 +8,7 @@ parameters: database_user: root database_password: ~ # You should uncomment this if you want to use pdo_sqlite - #database_path: '%kernel.project_dir%/var/data/data.sqlite' - - mailer_transport: smtp - mailer_host: 127.0.0.1 - mailer_user: ~ - mailer_password: ~ + database_path: '%kernel.project_dir%/var/data/db.sqlite' # A secret key that's used to generate certain security-related tokens secret: ThisTokenIsNotSoSecretChangeIt diff --git a/bin/symfony_requirements b/bin/symfony_requirements index a7bf65a1b8fa98dcd3fdb706f61bac472effd677..eeead32678879fb1eeef5b505f82d454cce8f3cc 100755 --- a/bin/symfony_requirements +++ b/bin/symfony_requirements @@ -1,7 +1,7 @@ #!/usr/bin/env php <?php -require_once dirname(__FILE__).'/../var/SymfonyRequirements.php'; +require_once dirname(__FILE__).'/./SymfonyRequirements.php'; $lineSize = 70; $symfonyRequirements = new SymfonyRequirements(); diff --git a/composer.json b/composer.json index 16161d290145bc38d711c08a3abe55afc53e6ead..76f36136191fb04a61a810585482d7022f3e8646 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,8 @@ "type": "project", "autoload": { "psr-4": { - "AppBundle\\": "src/AppBundle" + "AppBundle\\": "src/AppBundle", + "AKK\\ModelBundle\\": "src/AKK/ModelBundle" }, "classmap": [ "app/AppKernel.php", @@ -22,13 +23,11 @@ "require": { "php": ">=5.5.9", "doctrine/doctrine-bundle": "^1.6", - "doctrine/orm": "^2.5", "incenteev/composer-parameter-handler": "^2.0", "sensio/distribution-bundle": "^5.0.19", "sensio/framework-extra-bundle": "^3.0.2", "symfony/monolog-bundle": "^3.1.0", "symfony/polyfill-apcu": "^1.0", - "symfony/swiftmailer-bundle": "^2.3.10", "symfony/symfony": "3.3.*", "twig/twig": "^1.0||^2.0" }, diff --git a/composer.lock b/composer.lock index bc18eb93eec84fda6fe29bfaab5535c9c2320700..567d7899832f411f1b101be820d580a1fda675fe 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "4d0539605be045dcd3719c4d2c712586", + "content-hash": "76ca89796319818995a18bae99a962c9", "packages": [ { "name": "composer/ca-bundle", @@ -67,35 +67,35 @@ }, { "name": "doctrine/annotations", - "version": "v1.2.7", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" + "reference": "5beebb01b025c94e93686b7a0ed3edae81fe3e7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", - "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/5beebb01b025c94e93686b7a0ed3edae81fe3e7f", + "reference": "5beebb01b025c94e93686b7a0ed3edae81fe3e7f", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": ">=5.3.2" + "php": "^7.1" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "4.*" + "phpunit/phpunit": "^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.5.x-dev" } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Annotations\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" } }, "notification-url": "https://packagist.org/downloads/", @@ -131,37 +131,41 @@ "docblock", "parser" ], - "time": "2015-08-31T12:32:49+00:00" + "time": "2017-07-22T10:58:02+00:00" }, { "name": "doctrine/cache", - "version": "v1.6.2", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b" + "reference": "53d9518ffeb019c51d542ff60cb578f076d3ff16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/eb152c5100571c7a45470ff2a35095ab3f3b900b", - "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b", + "url": "https://api.github.com/repos/doctrine/cache/zipball/53d9518ffeb019c51d542ff60cb578f076d3ff16", + "reference": "53d9518ffeb019c51d542ff60cb578f076d3ff16", "shasum": "" }, "require": { - "php": "~5.5|~7.0" + "php": "~7.1" }, "conflict": { "doctrine/common": ">2.2,<2.4" }, "require-dev": { - "phpunit/phpunit": "~4.8|~5.0", - "predis/predis": "~1.0", - "satooshi/php-coveralls": "~0.6" + "alcaeus/mongo-php-adapter": "^1.1", + "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^5.7", + "predis/predis": "~1.0" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -201,32 +205,33 @@ "cache", "caching" ], - "time": "2017-07-22T12:49:21+00:00" + "time": "2017-07-22T13:00:15+00:00" }, { "name": "doctrine/collections", - "version": "v1.3.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", - "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf", + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "doctrine/coding-standard": "~0.1@dev", + "phpunit/phpunit": "^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -267,20 +272,20 @@ "collections", "iterator" ], - "time": "2015-04-14T22:21:58+00:00" + "time": "2017-07-22T10:37:32+00:00" }, { "name": "doctrine/common", - "version": "v2.6.2", + "version": "v2.8.0", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3" + "reference": "ed349f953d443963c590b008b37b864b8a3c4b21" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/7bce00698899aa2c06fe7365c76e4d78ddb15fa3", - "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3", + "url": "https://api.github.com/repos/doctrine/common/zipball/ed349f953d443963c590b008b37b864b8a3c4b21", + "reference": "ed349f953d443963c590b008b37b864b8a3c4b21", "shasum": "" }, "require": { @@ -289,15 +294,15 @@ "doctrine/collections": "1.*", "doctrine/inflector": "1.*", "doctrine/lexer": "1.*", - "php": "~5.5|~7.0" + "php": "~7.1" }, "require-dev": { - "phpunit/phpunit": "~4.8|~5.0" + "phpunit/phpunit": "^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7.x-dev" + "dev-master": "2.8.x-dev" } }, "autoload": { @@ -340,28 +345,30 @@ "persistence", "spl" ], - "time": "2016-11-30T16:50:46+00:00" + "time": "2017-07-22T09:01:43+00:00" }, { "name": "doctrine/dbal", - "version": "v2.5.13", + "version": "v2.6.1", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "729340d8d1eec8f01bff708e12e449a3415af873" + "reference": "1a086f853425b1f5349775ce57e45a772d2d2ba5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/729340d8d1eec8f01bff708e12e449a3415af873", - "reference": "729340d8d1eec8f01bff708e12e449a3415af873", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/1a086f853425b1f5349775ce57e45a772d2d2ba5", + "reference": "1a086f853425b1f5349775ce57e45a772d2d2ba5", "shasum": "" }, "require": { - "doctrine/common": ">=2.4,<2.8-dev", - "php": ">=5.3.2" + "doctrine/common": "^2.7.1", + "ext-pdo": "*", + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "4.*", + "phpunit/phpunit": "^5.4.6", + "phpunit/phpunit-mock-objects": "!=3.2.4,!=3.2.5", "symfony/console": "2.*||^3.0" }, "suggest": { @@ -373,7 +380,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5.x-dev" + "dev-master": "2.6.x-dev" } }, "autoload": { @@ -411,7 +418,7 @@ "persistence", "queryobject" ], - "time": "2017-07-22T20:44:48+00:00" + "time": "2017-07-28T10:40:18+00:00" }, { "name": "doctrine/doctrine-bundle", @@ -584,33 +591,33 @@ }, { "name": "doctrine/inflector", - "version": "v1.1.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" + "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/e11d84c6e018beedd929cff5220969a3c6d1d462", + "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "4.*" + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Inflector\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" } }, "notification-url": "https://packagist.org/downloads/", @@ -647,61 +654,7 @@ "singularize", "string" ], - "time": "2015-11-06T14:35:42+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2017-07-22T12:18:28+00:00" }, { "name": "doctrine/lexer", @@ -757,82 +710,6 @@ ], "time": "2014-09-09T13:34:57+00:00" }, - { - "name": "doctrine/orm", - "version": "v2.5.6", - "source": { - "type": "git", - "url": "https://github.com/doctrine/doctrine2.git", - "reference": "e6c434196c8ef058239aaa0724b4aadb0107940b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/e6c434196c8ef058239aaa0724b4aadb0107940b", - "reference": "e6c434196c8ef058239aaa0724b4aadb0107940b", - "shasum": "" - }, - "require": { - "doctrine/cache": "~1.4", - "doctrine/collections": "~1.2", - "doctrine/common": ">=2.5-dev,<2.8-dev", - "doctrine/dbal": ">=2.5-dev,<2.6-dev", - "doctrine/instantiator": "~1.0.1", - "ext-pdo": "*", - "php": ">=5.4", - "symfony/console": "~2.5|~3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0", - "symfony/yaml": "~2.3|~3.0" - }, - "suggest": { - "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" - }, - "bin": [ - "bin/doctrine", - "bin/doctrine.php" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\ORM\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - } - ], - "description": "Object-Relational-Mapper for PHP", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "database", - "orm" - ], - "time": "2016-12-18T15:42:34+00:00" - }, { "name": "fig/link-util", "version": "1.0.0", @@ -1477,16 +1354,16 @@ }, { "name": "sensiolabs/security-checker", - "version": "v4.1.1", + "version": "v4.1.3", "source": { "type": "git", "url": "https://github.com/sensiolabs/security-checker.git", - "reference": "cf61ce9d9706ba35e60a894fe6f3584c6d0e5c9f" + "reference": "7d60f01b9a56dfd152796877d009b1a0578d6ef4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/cf61ce9d9706ba35e60a894fe6f3584c6d0e5c9f", - "reference": "cf61ce9d9706ba35e60a894fe6f3584c6d0e5c9f", + "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/7d60f01b9a56dfd152796877d009b1a0578d6ef4", + "reference": "7d60f01b9a56dfd152796877d009b1a0578d6ef4", "shasum": "" }, "require": { @@ -1518,61 +1395,7 @@ } ], "description": "A security checker for your composer.lock", - "time": "2017-07-28T18:31:05+00:00" - }, - { - "name": "swiftmailer/swiftmailer", - "version": "v5.4.8", - "source": { - "type": "git", - "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "9a06dc570a0367850280eefd3f1dc2da45aef517" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/9a06dc570a0367850280eefd3f1dc2da45aef517", - "reference": "9a06dc570a0367850280eefd3f1dc2da45aef517", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "mockery/mockery": "~0.9.1", - "symfony/phpunit-bridge": "~3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - }, - "autoload": { - "files": [ - "lib/swift_required.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Chris Corbyn" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Swiftmailer, free feature-rich PHP mailer", - "homepage": "http://swiftmailer.org", - "keywords": [ - "email", - "mail", - "mailer" - ], - "time": "2017-05-01T15:54:03+00:00" + "time": "2017-08-03T12:24:05+00:00" }, { "name": "symfony/monolog-bundle", @@ -1971,65 +1794,6 @@ ], "time": "2017-06-09T08:25:21+00:00" }, - { - "name": "symfony/swiftmailer-bundle", - "version": "v2.6.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/swiftmailer-bundle.git", - "reference": "11555c338f3c367b0a1bd2f024a53aa813f4ce00" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/11555c338f3c367b0a1bd2f024a53aa813f4ce00", - "reference": "11555c338f3c367b0a1bd2f024a53aa813f4ce00", - "shasum": "" - }, - "require": { - "php": ">=5.3.2", - "swiftmailer/swiftmailer": "~4.2|~5.0", - "symfony/config": "~2.7|~3.0", - "symfony/dependency-injection": "~2.7|~3.0", - "symfony/http-kernel": "~2.7|~3.0" - }, - "require-dev": { - "symfony/console": "~2.7|~3.0", - "symfony/framework-bundle": "~2.7|~3.0", - "symfony/phpunit-bridge": "~3.3@dev", - "symfony/yaml": "~2.7|~3.0" - }, - "suggest": { - "psr/log": "Allows logging" - }, - "type": "symfony-bundle", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Bundle\\SwiftmailerBundle\\": "" - } - }, - "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 SwiftmailerBundle", - "homepage": "http://symfony.com", - "time": "2017-07-22T07:18:13+00:00" - }, { "name": "symfony/symfony", "version": "v3.3.6", @@ -2185,20 +1949,21 @@ }, { "name": "twig/twig", - "version": "v1.34.4", + "version": "v2.4.3", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "f878bab48edb66ad9c6ed626bf817f60c6c096ee" + "reference": "eab7c3288ae6603d7d6f92b531626af2b162d1f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/f878bab48edb66ad9c6ed626bf817f60c6c096ee", - "reference": "f878bab48edb66ad9c6ed626bf817f60c6c096ee", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/eab7c3288ae6603d7d6f92b531626af2b162d1f2", + "reference": "eab7c3288ae6603d7d6f92b531626af2b162d1f2", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0", + "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { "psr/container": "^1.0", @@ -2208,7 +1973,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.34-dev" + "dev-master": "2.4-dev" } }, "autoload": { @@ -2246,7 +2011,7 @@ "keywords": [ "templating" ], - "time": "2017-07-04T13:19:31+00:00" + "time": "2017-06-07T18:47:58+00:00" } ], "packages-dev": [ @@ -2375,8 +2140,5 @@ "platform": { "php": ">=5.5.9" }, - "platform-dev": [], - "platform-overrides": { - "php": "5.5.9" - } + "platform-dev": [] } diff --git a/src/AKK/ModelBundle/AKKModelBundle.php b/src/AKK/ModelBundle/AKKModelBundle.php new file mode 100644 index 0000000000000000000000000000000000000000..041ff9fb13b889d4b4142c7405d6d71975086d35 --- /dev/null +++ b/src/AKK/ModelBundle/AKKModelBundle.php @@ -0,0 +1,9 @@ +<?php + +namespace AKK\ModelBundle; + +use Symfony\Component\HttpKernel\Bundle\Bundle; + +class AKKModelBundle extends Bundle +{ +} diff --git a/src/AKK/ModelBundle/Data/Pass.php b/src/AKK/ModelBundle/Data/Pass.php new file mode 100644 index 0000000000000000000000000000000000000000..64eef553a07d0cd67b6c097b290fb62fbcc766d3 --- /dev/null +++ b/src/AKK/ModelBundle/Data/Pass.php @@ -0,0 +1,28 @@ +<?php +/** + * Created by PhpStorm. + * User: marci + * Date: 8/11/17 + * Time: 7:06 PM + */ + +namespace AKK\ModelBundle\Data; + + +class Pass +{ + /** @var int */ + public $id; + + /** @var PassType|null */ + public $type; + + /** @var User|null */ + public $user; + + /** @var \DateTime|null */ + public $obtainDate; + + /** @var \DateTime|null */ + public $validityStartDate; +} \ No newline at end of file diff --git a/src/AKK/ModelBundle/Data/PassType.php b/src/AKK/ModelBundle/Data/PassType.php new file mode 100644 index 0000000000000000000000000000000000000000..08f91edfea3f7c2f4985092d347f83f50c9ee76f --- /dev/null +++ b/src/AKK/ModelBundle/Data/PassType.php @@ -0,0 +1,28 @@ +<?php +/** + * Created by PhpStorm. + * User: marci + * Date: 8/11/17 + * Time: 7:04 PM + */ + +namespace AKK\ModelBundle\Data; + + +class PassType +{ + /** @var int */ + public $id; + + /** @var string|null */ + public $name; + + /** @var string|null */ + public $displayName; + + /** @var int|null */ + public $priceHuf; + + /** @var \DateInterval|null */ + public $validity; +} \ No newline at end of file diff --git a/src/AKK/ModelBundle/Data/User.php b/src/AKK/ModelBundle/Data/User.php new file mode 100644 index 0000000000000000000000000000000000000000..8065c906359db0999236f922656ba528aca23923 --- /dev/null +++ b/src/AKK/ModelBundle/Data/User.php @@ -0,0 +1,31 @@ +<?php +/** + * Created by PhpStorm. + * User: marci + * Date: 8/8/17 + * Time: 11:38 PM + */ + +namespace AKK\ModelBundle\Data; + + +class User +{ + /** @var int */ + public $id; + + /** @var string|null */ + public $username; + + /** @var string|null */ + public $password; + + /** @var string|null */ + public $email; + + /** @var string|null */ + public $firstName; + + /** @var string|null */ + public $lastName; +} \ No newline at end of file diff --git a/src/AKK/ModelBundle/DependencyInjection/AKKModelExtension.php b/src/AKK/ModelBundle/DependencyInjection/AKKModelExtension.php new file mode 100644 index 0000000000000000000000000000000000000000..106f8f41c6d9fa0edcf6294a8ab1f7fdcb5dd426 --- /dev/null +++ b/src/AKK/ModelBundle/DependencyInjection/AKKModelExtension.php @@ -0,0 +1,28 @@ +<?php + +namespace AKK\ModelBundle\DependencyInjection; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\Config\FileLocator; +use Symfony\Component\HttpKernel\DependencyInjection\Extension; +use Symfony\Component\DependencyInjection\Loader; + +/** + * This is the class that loads and manages your bundle configuration. + * + * @link http://symfony.com/doc/current/cookbook/bundles/extension.html + */ +class AKKModelExtension extends Extension +{ + /** + * {@inheritdoc} + */ + public function load(array $configs, ContainerBuilder $container) + { + $configuration = new Configuration(); + $config = $this->processConfiguration($configuration, $configs); + + $loader = new Loader\PhpFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('services.php'); + } +} diff --git a/src/AKK/ModelBundle/DependencyInjection/Configuration.php b/src/AKK/ModelBundle/DependencyInjection/Configuration.php new file mode 100644 index 0000000000000000000000000000000000000000..661d41519434edb32e2d61628d244268002bfc4a --- /dev/null +++ b/src/AKK/ModelBundle/DependencyInjection/Configuration.php @@ -0,0 +1,29 @@ +<?php + +namespace AKK\ModelBundle\DependencyInjection; + +use Symfony\Component\Config\Definition\Builder\TreeBuilder; +use Symfony\Component\Config\Definition\ConfigurationInterface; + +/** + * This is the class that validates and merges configuration from your app/config files. + * + * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html} + */ +class Configuration implements ConfigurationInterface +{ + /** + * {@inheritdoc} + */ + public function getConfigTreeBuilder() + { + $treeBuilder = new TreeBuilder(); + $rootNode = $treeBuilder->root('akk_model'); + + // Here you should define the parameters that are allowed to + // configure your bundle. See the documentation linked above for + // more information on that topic. + + return $treeBuilder; + } +} diff --git a/src/AKK/ModelBundle/Repository/Detail/RepositoryImpl.php b/src/AKK/ModelBundle/Repository/Detail/RepositoryImpl.php new file mode 100644 index 0000000000000000000000000000000000000000..d9d1340fdced7596fe7abf0dad1d6e42400be4bf --- /dev/null +++ b/src/AKK/ModelBundle/Repository/Detail/RepositoryImpl.php @@ -0,0 +1,84 @@ +<?php +/** + * Created by PhpStorm. + * User: marci + * Date: 8/11/17 + * Time: 7:16 PM + */ + +namespace AKK\ModelBundle\Repository\Detail; + + +use Doctrine\DBAL\Connection; + +class RepositoryImpl +{ + private $conn; + + public function __construct(Connection $connection) + { + $this->conn = $connection; + } + + /** + * @param string $fromArg + * @param array $constraints + * @return array + */ + public function select(string $fromArg, array $constraints = []): array + { + $sql = 'SELECT * FROM '.$fromArg; + $whereargs = []; + foreach ($constraints as $key => $value) { + if(is_numeric($key)) { + $whereargs[] = $value; + } else { + $whereargs[] = "`$key` = '$value'"; + } + } + if(count($constraints)) { + $sql .= ' WHERE ' . implode(' AND ', $whereargs); + } + + $queryResult = $this->conn->query($sql); + + $all = $queryResult->fetchAll(); + return $all; + } + + /** + * @param string $from + * @param int $id + * @return array + */ + public function findById(string $from, int $id): array + { + return $this->select($from, ['id' => $id]); + } + + /** + * @param string $target + * @param array $row + */ + public function insert(string $target, array $row): void + { + $sql = 'INSERT INTO '.$target + .' ('.implode(',', array_keys($row)).') VALUES (' + .implode(',', array_values($row)).')'; + + $this->conn->exec($sql); + } + + public function updateById(string $target, array $row): void + { + $sql = 'UPDATE '.$target.' SET '; + $updateargs = []; + foreach ($row as $key => $item) { + $updateargs[] = "`$key`='$item'"; + } + + $sql .= implode(',', $updateargs); + + $this->conn->exec($sql); + } +} \ No newline at end of file diff --git a/src/AKK/ModelBundle/Repository/PassRepository.php b/src/AKK/ModelBundle/Repository/PassRepository.php new file mode 100644 index 0000000000000000000000000000000000000000..a82dfb402f1973bebce0667d567d020bafbe91a6 --- /dev/null +++ b/src/AKK/ModelBundle/Repository/PassRepository.php @@ -0,0 +1,48 @@ +<?php +/** + * Created by PhpStorm. + * User: marci + * Date: 8/11/17 + * Time: 7:15 PM + */ + +namespace AKK\ModelBundle\Repository; + + +use AKK\ModelBundle\Data\Pass; +use AKK\ModelBundle\Data\PassType; +use AKK\ModelBundle\Repository\Detail\RepositoryImpl; + +class PassRepository +{ + /** @var RepositoryImpl */ + private $repoImpl; + + public function __construct(RepositoryImpl $repositoryImpl) + { + $this->repoImpl = $repositoryImpl; + } + + public function objectToArray(Pass $pass) + { + $result = [ + 'id' => $pass->id + ]; + if($pass->type !== null) $result['pass_type_id'] = $pass->type->id; + if($pass->user !== null) $result['user_id'] = $pass->user->id; + if($pass->obtainDate !== null) $result['obtain_date'] = date('Y-m-d H:i:s', $pass->obtainDate); + if($pass->validityStartDate !== null) $result['validity_start_date'] = date('Y-m-d H:i:s', $pass->validityStartDate); + + return $result; + } + + public function arrayToObject(array $row): Pass + { + $result = new Pass(); + $result->id = $row['id']; + if(array_key_exists('pass_type_id', $row)) { + $result->type = new PassType(); + $result->type->id = $row['pass_type_id']; + } + } +} \ No newline at end of file diff --git a/src/AKK/ModelBundle/Repository/PassTypeRepository.php b/src/AKK/ModelBundle/Repository/PassTypeRepository.php new file mode 100644 index 0000000000000000000000000000000000000000..7a948ab35ce965edbb2413f410e402726c3f5f9e --- /dev/null +++ b/src/AKK/ModelBundle/Repository/PassTypeRepository.php @@ -0,0 +1,23 @@ +<?php +/** + * Created by PhpStorm. + * User: marci + * Date: 8/11/17 + * Time: 7:15 PM + */ + +namespace AKK\ModelBundle\Repository; + + +use AKK\ModelBundle\Repository\Detail\RepositoryImpl; + +class PassTypeRepository +{ + /** @var RepositoryImpl */ + private $repoImpl; + + public function __construct(RepositoryImpl $repositoryImpl) + { + $this->repoImpl = $repositoryImpl; + } +} \ No newline at end of file diff --git a/src/AKK/ModelBundle/Repository/UserRepository.php b/src/AKK/ModelBundle/Repository/UserRepository.php new file mode 100644 index 0000000000000000000000000000000000000000..71d75c604fa12a6b7f4c21d95eddb0df72bab0f5 --- /dev/null +++ b/src/AKK/ModelBundle/Repository/UserRepository.php @@ -0,0 +1,23 @@ +<?php +/** + * Created by PhpStorm. + * User: marci + * Date: 8/11/17 + * Time: 7:15 PM + */ + +namespace AKK\ModelBundle\Repository; + + +use AKK\ModelBundle\Repository\Detail\RepositoryImpl; + +class UserRepository +{ + /** @var RepositoryImpl */ + private $repoImpl; + + public function __construct(RepositoryImpl $repositoryImpl) + { + $this->repoImpl = $repositoryImpl; + } +} \ No newline at end of file diff --git a/src/AKK/ModelBundle/Resources/config/services.php b/src/AKK/ModelBundle/Resources/config/services.php new file mode 100644 index 0000000000000000000000000000000000000000..19170cf253232dcc82b3e7318bb0fbe4efd109d1 --- /dev/null +++ b/src/AKK/ModelBundle/Resources/config/services.php @@ -0,0 +1,21 @@ +<?php + +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Parameter; + +/* + +$container->setDefinition( + 'akk_model.example', + new Definition( + 'AKK\ModelBundle\Example', + array( + new Reference('service_id'), + "plain_value", + new Parameter('parameter_name'), + ) + ) +); + +*/ diff --git a/src/AppBundle/Controller/DefaultController.php b/src/AppBundle/Controller/DefaultController.php index cecd334e13e9f78ff8228d2cf22dbfeef4fb3d9d..a3b262c4c8bb5da40905a1dea3dcfe7146c56f64 100644 --- a/src/AppBundle/Controller/DefaultController.php +++ b/src/AppBundle/Controller/DefaultController.php @@ -2,6 +2,8 @@ namespace AppBundle\Controller; +use AKK\ModelBundle\Repository\Detail\RepositoryImpl; +use Doctrine\DBAL\Connection; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; @@ -11,11 +13,14 @@ class DefaultController extends Controller /** * @Route("/", name="homepage") */ - public function indexAction(Request $request) + public function indexAction(Request $request, Connection $connection) { // replace this example code with whatever you need + $repo = new RepositoryImpl($connection); + $repo->select('sqlite_master'); return $this->render('default/index.html.twig', [ 'base_dir' => realpath($this->getParameter('kernel.project_dir')).DIRECTORY_SEPARATOR, + 'thing' => $connection->fetchAll('SELECT name FROM sqlite_master') ]); } } diff --git a/web/config.php b/web/config.php index fd7e17e6b66e7801d44f9df976e50b11ea4c0aa8..5ac1985dbc81ce327decb8768c70c114a7d892a8 100644 --- a/web/config.php +++ b/web/config.php @@ -22,7 +22,7 @@ if (!in_array(@$_SERVER['REMOTE_ADDR'], array( exit('This script is only accessible from localhost.'); } -require_once dirname(__FILE__).'/../var/SymfonyRequirements.php'; +require_once dirname(__FILE__).'/./SymfonyRequirements.php'; $symfonyRequirements = new SymfonyRequirements();