diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 3e56e9c..609aaa5 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -13,4 +13,7 @@ mail: github: api_key: 'changeme' - api_secret: 'changeme' \ No newline at end of file + api_secret: 'changeme' + +app: + blog_directory: 'data/posts/' \ No newline at end of file diff --git a/composer.json b/composer.json index d991283..6e55362 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,10 @@ "symfony/config": "^3.1", "symfony/security-csrf": "^3.1", "mockery/mockery": "^0.9.5", - "rpodwika/yaml-config-service-provider": "^1.0" + "rpodwika/yaml-config-service-provider": "^1.0", + "knplabs/console-service-provider": "^2.0", + "mnapoli/front-yaml": "^1.5", + "twig/extensions": "^1.4" }, "require-dev": { "phpunit/phpunit": "4.6.*", diff --git a/composer.lock b/composer.lock index 67d03b7..5a075d3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "ef16f15fb468a4ad7683a7b6a0f623f0", - "content-hash": "120bd4a7c5cadb7fb41540fa1a35f135", + "hash": "52cd15a30123d30ecfe9ace664d45661", + "content-hash": "a5ecefc2dcf499a18de1acbd3d2316fe", "packages": [ { "name": "doctrine/annotations", @@ -478,18 +478,21 @@ }, { "name": "erusev/parsedown", - "version": "1.6.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/erusev/parsedown.git", - "reference": "3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7" + "reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/erusev/parsedown/zipball/3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7", - "reference": "3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7", + "url": "https://api.github.com/repos/erusev/parsedown/zipball/20ff8bbb57205368b4b42d094642a3e52dac85fb", + "reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb", "shasum": "" }, + "require": { + "php": ">=5.3.0" + }, "type": "library", "autoload": { "psr-0": { @@ -513,7 +516,7 @@ "markdown", "parser" ], - "time": "2015-10-04 16:44:32" + "time": "2016-11-02 15:56:58" }, { "name": "ezyang/htmlpurifier", @@ -623,16 +626,16 @@ }, { "name": "guzzlehttp/promises", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579" + "reference": "2693c101803ca78b27972d84081d027fca790a1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/c10d860e2a9595f8883527fa0021c7da9e65f579", - "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579", + "url": "https://api.github.com/repos/guzzle/promises/zipball/2693c101803ca78b27972d84081d027fca790a1e", + "reference": "2693c101803ca78b27972d84081d027fca790a1e", "shasum": "" }, "require": { @@ -670,7 +673,7 @@ "keywords": [ "promise" ], - "time": "2016-05-18 16:56:05" + "time": "2016-11-18 17:47:58" }, { "name": "guzzlehttp/psr7", @@ -876,6 +879,48 @@ "homepage": "https://github.com/ircmaxell/SecurityLib", "time": "2015-03-20 14:31:23" }, + { + "name": "knplabs/console-service-provider", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/ConsoleServiceProvider.git", + "reference": "ac3498030bb54ec1d7e79043fe984fc3aeb48bfb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/ConsoleServiceProvider/zipball/ac3498030bb54ec1d7e79043fe984fc3aeb48bfb", + "reference": "ac3498030bb54ec1d7e79043fe984fc3aeb48bfb", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "symfony/console": "~2.3|~3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Knp\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Knplabs", + "homepage": "http://knplabs.com" + } + ], + "description": "console service provider for Silex", + "homepage": "http://knplabs.com", + "keywords": [ + "console", + "silex" + ], + "time": "2016-06-01 05:51:46" + }, { "name": "league/oauth2-client", "version": "1.4.2", @@ -941,20 +986,20 @@ }, { "name": "league/oauth2-github", - "version": "0.2.1", + "version": "0.2.2", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-github.git", - "reference": "0c8b940e63f04167e60c7c61b67a4c925803afb0" + "reference": "3d734abe82839fbffdf60ff1c2d019dc170b0c38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-github/zipball/0c8b940e63f04167e60c7c61b67a4c925803afb0", - "reference": "0c8b940e63f04167e60c7c61b67a4c925803afb0", + "url": "https://api.github.com/repos/thephpleague/oauth2-github/zipball/3d734abe82839fbffdf60ff1c2d019dc170b0c38", + "reference": "3d734abe82839fbffdf60ff1c2d019dc170b0c38", "shasum": "" }, "require": { - "league/oauth2-client": "~1.0", + "league/oauth2-client": "~1.4", "php": ">=5.5.0" }, "require-dev": { @@ -993,20 +1038,54 @@ "oauth", "oauth2" ], - "time": "2016-04-14 01:57:14" + "time": "2016-11-22 05:14:51" + }, + { + "name": "mnapoli/front-yaml", + "version": "1.5.2", + "source": { + "type": "git", + "url": "https://github.com/mnapoli/FrontYAML.git", + "reference": "f10c1dfee1604d15c2b0ab6826eecc1111d65543" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mnapoli/FrontYAML/zipball/f10c1dfee1604d15c2b0ab6826eecc1111d65543", + "reference": "f10c1dfee1604d15c2b0ab6826eecc1111d65543", + "shasum": "" + }, + "require": { + "erusev/parsedown": "~1.0", + "symfony/yaml": "~2.1|^3.0" + }, + "require-dev": { + "league/commonmark": "~0.7", + "phpunit/phpunit": "~4.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Mni\\FrontYAML\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "time": "2016-10-01 11:06:51" }, { "name": "mockery/mockery", - "version": "0.9.5", + "version": "0.9.6", "source": { "type": "git", "url": "https://github.com/padraic/mockery.git", - "reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2" + "reference": "65d4ca18e15cb02eeb1e5336f884e46b9b905be0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/mockery/zipball/4db079511a283e5aba1b3c2fb19037c645e70fc2", - "reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2", + "url": "https://api.github.com/repos/padraic/mockery/zipball/65d4ca18e15cb02eeb1e5336f884e46b9b905be0", + "reference": "65d4ca18e15cb02eeb1e5336f884e46b9b905be0", "shasum": "" }, "require": { @@ -1058,7 +1137,7 @@ "test double", "testing" ], - "time": "2016-05-22 21:52:33" + "time": "2016-09-30 12:09:40" }, { "name": "monolog/monolog", @@ -1140,16 +1219,16 @@ }, { "name": "paragonie/random_compat", - "version": "v2.0.3", + "version": "v2.0.4", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "c0125896dbb151380ab47e96c621741e79623beb" + "reference": "a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/c0125896dbb151380ab47e96c621741e79623beb", - "reference": "c0125896dbb151380ab47e96c621741e79623beb", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e", + "reference": "a9b97968bcde1c4de2a5ec6cbd06a0f6c919b46e", "shasum": "" }, "require": { @@ -1184,7 +1263,7 @@ "pseudorandom", "random" ], - "time": "2016-10-17 15:23:22" + "time": "2016-11-07 23:38:38" }, { "name": "pimple/pimple", @@ -1436,16 +1515,16 @@ }, { "name": "silex/silex", - "version": "v2.0.3", + "version": "v2.0.4", "source": { "type": "git", "url": "https://github.com/silexphp/Silex.git", - "reference": "fd0852ebfa0a4cf1e17d746bb81962ec69bbb6d1" + "reference": "49ca08d853731d1635374e5019c8696cfd53c161" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silexphp/Silex/zipball/fd0852ebfa0a4cf1e17d746bb81962ec69bbb6d1", - "reference": "fd0852ebfa0a4cf1e17d746bb81962ec69bbb6d1", + "url": "https://api.github.com/repos/silexphp/Silex/zipball/49ca08d853731d1635374e5019c8696cfd53c161", + "reference": "49ca08d853731d1635374e5019c8696cfd53c161", "shasum": "" }, "require": { @@ -1485,7 +1564,7 @@ "symfony/twig-bridge": "~2.8|^3.0", "symfony/validator": "~2.8|^3.0", "symfony/var-dumper": "~2.8|^3.0", - "twig/twig": "~1.8|~2.0" + "twig/twig": "~1.27|~2.0" }, "type": "library", "extra": { @@ -1517,7 +1596,7 @@ "keywords": [ "microframework" ], - "time": "2016-08-22 17:50:21" + "time": "2016-11-06 18:09:06" }, { "name": "swiftmailer/swiftmailer", @@ -1574,16 +1653,16 @@ }, { "name": "symfony/config", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "949e7e846743a7f9e46dc50eb639d5fde1f53341" + "reference": "ab4fa32ffe6e625f9b7444e5e8d4702a0bc3ad7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/949e7e846743a7f9e46dc50eb639d5fde1f53341", - "reference": "949e7e846743a7f9e46dc50eb639d5fde1f53341", + "url": "https://api.github.com/repos/symfony/config/zipball/ab4fa32ffe6e625f9b7444e5e8d4702a0bc3ad7a", + "reference": "ab4fa32ffe6e625f9b7444e5e8d4702a0bc3ad7a", "shasum": "" }, "require": { @@ -1623,20 +1702,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2016-09-25 08:27:07" + "time": "2016-11-03 08:04:31" }, { "name": "symfony/console", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c99da1119ae61e15de0e4829196b9fba6f73d065" + "reference": "5be36e1f3ac7ecbe7e34fb641480ad8497b83aa6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c99da1119ae61e15de0e4829196b9fba6f73d065", - "reference": "c99da1119ae61e15de0e4829196b9fba6f73d065", + "url": "https://api.github.com/repos/symfony/console/zipball/5be36e1f3ac7ecbe7e34fb641480ad8497b83aa6", + "reference": "5be36e1f3ac7ecbe7e34fb641480ad8497b83aa6", "shasum": "" }, "require": { @@ -1684,20 +1763,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-10-06 01:44:51" + "time": "2016-11-16 22:17:09" }, { "name": "symfony/debug", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "e2b3f74a67fc928adc3c1b9027f73e1bc01190a8" + "reference": "c058661c32f5b462722e36d120905940089cbd9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/e2b3f74a67fc928adc3c1b9027f73e1bc01190a8", - "reference": "e2b3f74a67fc928adc3c1b9027f73e1bc01190a8", + "url": "https://api.github.com/repos/symfony/debug/zipball/c058661c32f5b462722e36d120905940089cbd9a", + "reference": "c058661c32f5b462722e36d120905940089cbd9a", "shasum": "" }, "require": { @@ -1741,11 +1820,11 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-09-06 11:02:40" + "time": "2016-11-15 12:55:20" }, { "name": "symfony/event-dispatcher", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -1805,7 +1884,7 @@ }, { "name": "symfony/filesystem", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -1854,16 +1933,16 @@ }, { "name": "symfony/form", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/form.git", - "reference": "9b7667d56425badaf1fd83402deb1ebe2008f4fe" + "reference": "97601f6da429e525e74a9f84f0240024d57f1209" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/form/zipball/9b7667d56425badaf1fd83402deb1ebe2008f4fe", - "reference": "9b7667d56425badaf1fd83402deb1ebe2008f4fe", + "url": "https://api.github.com/repos/symfony/form/zipball/97601f6da429e525e74a9f84f0240024d57f1209", + "reference": "97601f6da429e525e74a9f84f0240024d57f1209", "shasum": "" }, "require": { @@ -1924,20 +2003,20 @@ ], "description": "Symfony Form Component", "homepage": "https://symfony.com", - "time": "2016-10-18 04:30:12" + "time": "2016-11-18 21:15:08" }, { "name": "symfony/http-foundation", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "f21e5a8b88274b7720779aa88f9c02c6d6ec08d7" + "reference": "5a4c8099a1547fe451256e056180ad4624177017" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/f21e5a8b88274b7720779aa88f9c02c6d6ec08d7", - "reference": "f21e5a8b88274b7720779aa88f9c02c6d6ec08d7", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5a4c8099a1547fe451256e056180ad4624177017", + "reference": "5a4c8099a1547fe451256e056180ad4624177017", "shasum": "" }, "require": { @@ -1977,20 +2056,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2016-10-24 15:52:44" + "time": "2016-11-16 22:17:09" }, { "name": "symfony/http-kernel", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "c235f1b13ba67012e283996a5427f22e2e04be14" + "reference": "674ac403c7b3742c2a988a86e3baf9aca2c696a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/c235f1b13ba67012e283996a5427f22e2e04be14", - "reference": "c235f1b13ba67012e283996a5427f22e2e04be14", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/674ac403c7b3742c2a988a86e3baf9aca2c696a0", + "reference": "674ac403c7b3742c2a988a86e3baf9aca2c696a0", "shasum": "" }, "require": { @@ -2059,11 +2138,11 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2016-10-27 02:38:31" + "time": "2016-11-21 02:44:20" }, { "name": "symfony/inflector", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/inflector.git", @@ -2120,16 +2199,16 @@ }, { "name": "symfony/intl", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/intl.git", - "reference": "1dc47c14187c0e7b7dfe8ae3b8dbde9b60b6d96b" + "reference": "f12cef07ebe496b991875632ce421b7883a56c73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/intl/zipball/1dc47c14187c0e7b7dfe8ae3b8dbde9b60b6d96b", - "reference": "1dc47c14187c0e7b7dfe8ae3b8dbde9b60b6d96b", + "url": "https://api.github.com/repos/symfony/intl/zipball/f12cef07ebe496b991875632ce421b7883a56c73", + "reference": "f12cef07ebe496b991875632ce421b7883a56c73", "shasum": "" }, "require": { @@ -2191,11 +2270,11 @@ "l10n", "localization" ], - "time": "2016-09-06 11:02:40" + "time": "2016-11-18 21:15:08" }, { "name": "symfony/options-resolver", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", @@ -2249,16 +2328,16 @@ }, { "name": "symfony/polyfill-intl-icu", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-icu.git", - "reference": "0f8dc2c45f69f8672379e9210bca4a115cd5146f" + "reference": "2d6e2b20d457603eefb6e614286c22efca30fdb4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/0f8dc2c45f69f8672379e9210bca4a115cd5146f", - "reference": "0f8dc2c45f69f8672379e9210bca4a115cd5146f", + "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/2d6e2b20d457603eefb6e614286c22efca30fdb4", + "reference": "2d6e2b20d457603eefb6e614286c22efca30fdb4", "shasum": "" }, "require": { @@ -2271,7 +2350,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -2303,20 +2382,20 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-11-14 01:06:16" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "dff51f72b0706335131b00a7f49606168c582594" + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", - "reference": "dff51f72b0706335131b00a7f49606168c582594", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", "shasum": "" }, "require": { @@ -2328,7 +2407,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -2362,20 +2441,20 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-11-14 01:06:16" }, { "name": "symfony/polyfill-php56", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "3edf57a8fbf9a927533344cef65ad7e1cf31030a" + "reference": "1dd42b9b89556f18092f3d1ada22cb05ac85383c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/3edf57a8fbf9a927533344cef65ad7e1cf31030a", - "reference": "3edf57a8fbf9a927533344cef65ad7e1cf31030a", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/1dd42b9b89556f18092f3d1ada22cb05ac85383c", + "reference": "1dd42b9b89556f18092f3d1ada22cb05ac85383c", "shasum": "" }, "require": { @@ -2385,7 +2464,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -2418,20 +2497,20 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-11-14 01:06:16" }, { "name": "symfony/polyfill-php70", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "a42f4b6b05ed458910f8af4c4e1121b0101b2d85" + "reference": "13ce343935f0f91ca89605a2f6ca6f5c2f3faac2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/a42f4b6b05ed458910f8af4c4e1121b0101b2d85", - "reference": "a42f4b6b05ed458910f8af4c4e1121b0101b2d85", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/13ce343935f0f91ca89605a2f6ca6f5c2f3faac2", + "reference": "13ce343935f0f91ca89605a2f6ca6f5c2f3faac2", "shasum": "" }, "require": { @@ -2441,7 +2520,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -2477,20 +2556,20 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-11-14 01:06:16" }, { "name": "symfony/polyfill-util", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-util.git", - "reference": "ef830ce3d218e622b221d6bfad42c751d974bf99" + "reference": "746bce0fca664ac0a575e465f65c6643faddf7fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/ef830ce3d218e622b221d6bfad42c751d974bf99", - "reference": "ef830ce3d218e622b221d6bfad42c751d974bf99", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/746bce0fca664ac0a575e465f65c6643faddf7fb", + "reference": "746bce0fca664ac0a575e465f65c6643faddf7fb", "shasum": "" }, "require": { @@ -2499,7 +2578,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -2529,11 +2608,11 @@ "polyfill", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-11-14 01:06:16" }, { "name": "symfony/property-access", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/property-access.git", @@ -2595,7 +2674,7 @@ }, { "name": "symfony/routing", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", @@ -2670,16 +2749,16 @@ }, { "name": "symfony/security-core", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/security-core.git", - "reference": "665259f6d2f826a21e75ee2e8e3ef24bd9a46e13" + "reference": "056e3f3687e5e32ebc76e2100aaf57b60f1d671f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-core/zipball/665259f6d2f826a21e75ee2e8e3ef24bd9a46e13", - "reference": "665259f6d2f826a21e75ee2e8e3ef24bd9a46e13", + "url": "https://api.github.com/repos/symfony/security-core/zipball/056e3f3687e5e32ebc76e2100aaf57b60f1d671f", + "reference": "056e3f3687e5e32ebc76e2100aaf57b60f1d671f", "shasum": "" }, "require": { @@ -2732,11 +2811,11 @@ ], "description": "Symfony Security Component - Core Library", "homepage": "https://symfony.com", - "time": "2016-10-06 01:44:51" + "time": "2016-11-16 22:17:09" }, { "name": "symfony/security-csrf", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/security-csrf.git", @@ -2794,16 +2873,16 @@ }, { "name": "symfony/translation", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "ff1285087397d2f64041b35e591f3025881c90cd" + "reference": "2f4b6114b75c506dd1ee7eb485b35facbcb2d873" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/ff1285087397d2f64041b35e591f3025881c90cd", - "reference": "ff1285087397d2f64041b35e591f3025881c90cd", + "url": "https://api.github.com/repos/symfony/translation/zipball/2f4b6114b75c506dd1ee7eb485b35facbcb2d873", + "reference": "2f4b6114b75c506dd1ee7eb485b35facbcb2d873", "shasum": "" }, "require": { @@ -2854,25 +2933,25 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2016-10-18 04:30:12" + "time": "2016-11-18 21:15:08" }, { "name": "symfony/twig-bridge", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", - "reference": "a75dfd56d7cf8df1843dcf44a0d6d4ef8b72440c" + "reference": "b66a3f12320fd4c04bc4d168ad7ecf79b341c835" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/a75dfd56d7cf8df1843dcf44a0d6d4ef8b72440c", - "reference": "a75dfd56d7cf8df1843dcf44a0d6d4ef8b72440c", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/b66a3f12320fd4c04bc4d168ad7ecf79b341c835", + "reference": "b66a3f12320fd4c04bc4d168ad7ecf79b341c835", "shasum": "" }, "require": { "php": ">=5.5.9", - "twig/twig": "~1.27|~2.0" + "twig/twig": "~1.28|~2.0" }, "require-dev": { "symfony/asset": "~2.8|~3.0", @@ -2935,20 +3014,20 @@ ], "description": "Symfony Twig Bridge", "homepage": "https://symfony.com", - "time": "2016-10-24 15:52:44" + "time": "2016-11-14 16:20:02" }, { "name": "symfony/validator", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "709dffa9193ee2b88e1fb1760cc0ba5780f1a8b2" + "reference": "5ba95c69918d98c5691c913ffab3ab1200e1441d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/709dffa9193ee2b88e1fb1760cc0ba5780f1a8b2", - "reference": "709dffa9193ee2b88e1fb1760cc0ba5780f1a8b2", + "url": "https://api.github.com/repos/symfony/validator/zipball/5ba95c69918d98c5691c913ffab3ab1200e1441d", + "reference": "5ba95c69918d98c5691c913ffab3ab1200e1441d", "shasum": "" }, "require": { @@ -3009,20 +3088,20 @@ ], "description": "Symfony Validator Component", "homepage": "https://symfony.com", - "time": "2016-10-19 22:38:53" + "time": "2016-11-18 21:15:08" }, { "name": "symfony/yaml", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "7ff51b06c6c3d5cc6686df69004a42c69df09e27" + "reference": "9da375317228e54f4ea1b013b30fa47417e84943" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/7ff51b06c6c3d5cc6686df69004a42c69df09e27", - "reference": "7ff51b06c6c3d5cc6686df69004a42c69df09e27", + "url": "https://api.github.com/repos/symfony/yaml/zipball/9da375317228e54f4ea1b013b30fa47417e84943", + "reference": "9da375317228e54f4ea1b013b30fa47417e84943", "shasum": "" }, "require": { @@ -3058,20 +3137,72 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-10-24 18:41:13" + "time": "2016-11-18 21:05:29" + }, + { + "name": "twig/extensions", + "version": "v1.4.1", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig-extensions.git", + "reference": "f0bb8431c8691f5a39f1017d9a5967a082bf01ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/f0bb8431c8691f5a39f1017d9a5967a082bf01ff", + "reference": "f0bb8431c8691f5a39f1017d9a5967a082bf01ff", + "shasum": "" + }, + "require": { + "twig/twig": "~1.20|~2.0" + }, + "require-dev": { + "symfony/translation": "~2.3" + }, + "suggest": { + "symfony/translation": "Allow the time_diff output to be translated" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_Extensions_": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Common additional features for Twig that do not directly belong in core", + "homepage": "http://twig.sensiolabs.org/doc/extensions/index.html", + "keywords": [ + "i18n", + "text" + ], + "time": "2016-10-25 17:34:14" }, { "name": "twig/twig", - "version": "v1.27.0", + "version": "v1.28.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "3c6c0033fd3b5679c6e1cb60f4f9766c2b424d97" + "reference": "b22ce0eb070e41f7cba65d78fe216de29726459c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/3c6c0033fd3b5679c6e1cb60f4f9766c2b424d97", - "reference": "3c6c0033fd3b5679c6e1cb60f4f9766c2b424d97", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/b22ce0eb070e41f7cba65d78fe216de29726459c", + "reference": "b22ce0eb070e41f7cba65d78fe216de29726459c", "shasum": "" }, "require": { @@ -3079,12 +3210,12 @@ }, "require-dev": { "symfony/debug": "~2.7", - "symfony/phpunit-bridge": "~2.7" + "symfony/phpunit-bridge": "~3.2@dev" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.27-dev" + "dev-master": "1.28-dev" } }, "autoload": { @@ -3119,7 +3250,7 @@ "keywords": [ "templating" ], - "time": "2016-10-25 19:17:17" + "time": "2016-11-23 18:41:40" }, { "name": "vlucas/phpdotenv", @@ -3175,16 +3306,16 @@ "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.0.4", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119" + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119", - "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { @@ -3195,7 +3326,7 @@ "ext-pdo": "*", "ext-phar": "*", "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "2.0.*@ALPHA" + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { @@ -3204,8 +3335,8 @@ } }, "autoload": { - "psr-0": { - "Doctrine\\Instantiator\\": "src" + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3225,38 +3356,39 @@ "constructor", "instantiate" ], - "time": "2014-10-13 12:58:55" + "time": "2015-06-14 21:17:01" }, { "name": "pdepend/pdepend", - "version": "2.0.6", + "version": "2.3.2", "source": { "type": "git", "url": "https://github.com/pdepend/pdepend.git", - "reference": "a15ffcbfbcc4570d4a733ca7b76e9cac0a56c3f4" + "reference": "8d7ab8fe8c1f9de5056bb7ea2c0852f4ddd44f90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pdepend/pdepend/zipball/a15ffcbfbcc4570d4a733ca7b76e9cac0a56c3f4", - "reference": "a15ffcbfbcc4570d4a733ca7b76e9cac0a56c3f4", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/8d7ab8fe8c1f9de5056bb7ea2c0852f4ddd44f90", + "reference": "8d7ab8fe8c1f9de5056bb7ea2c0852f4ddd44f90", "shasum": "" }, "require": { - "symfony/config": ">=2.4", - "symfony/dependency-injection": ">=2.4", - "symfony/filesystem": ">=2.4" + "php": ">=5.3.7", + "symfony/config": "^2.3.0|^3", + "symfony/dependency-injection": "^2.3.0|^3", + "symfony/filesystem": "^2.3.0|^3" }, "require-dev": { - "phpunit/phpunit": "4.*@stable", - "squizlabs/php_codesniffer": "@stable" + "phpunit/phpunit": "^4.4.0,<4.8", + "squizlabs/php_codesniffer": "^2.0.0" }, "bin": [ "src/bin/pdepend" ], "type": "library", "autoload": { - "psr-0": { - "PDepend\\": "src/main/php/" + "psr-4": { + "PDepend\\": "src/main/php/PDepend" } }, "notification-url": "https://packagist.org/downloads/", @@ -3264,41 +3396,138 @@ "BSD-3-Clause" ], "description": "Official version of pdepend to be handled with Composer", - "time": "2015-03-02 08:06:43" + "time": "2016-11-23 20:25:02" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27 11:43:31" }, { "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2016-09-30 07:12:33" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "psr-0": { - "phpDocumentor": [ + "psr-4": { + "phpDocumentor\\Reflection\\": [ "src/" ] } @@ -3310,35 +3539,32 @@ "authors": [ { "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" + "email": "me@mikevanriel.com" } ], - "time": "2015-02-03 12:10:50" + "time": "2016-06-10 07:14:17" }, { "name": "phpmd/phpmd", - "version": "2.2.2", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/phpmd/phpmd.git", - "reference": "7dc4a6b5c07b119ab5da7960b56303fa6855eb84" + "reference": "9298602a922cd8c46666df8d540a60bc5925ce55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/7dc4a6b5c07b119ab5da7960b56303fa6855eb84", - "reference": "7dc4a6b5c07b119ab5da7960b56303fa6855eb84", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/9298602a922cd8c46666df8d540a60bc5925ce55", + "reference": "9298602a922cd8c46666df8d540a60bc5925ce55", "shasum": "" }, "require": { - "pdepend/pdepend": "2.0.*", - "php": ">=5.3.0", - "symfony/config": ">=2.4", - "symfony/dependency-injection": ">=2.4", - "symfony/filesystem": ">=2.4" + "pdepend/pdepend": "^2.0.4", + "php": ">=5.3.9" }, "require-dev": { - "phpunit/phpunit": "*", - "squizlabs/php_codesniffer": "*" + "phpunit/phpunit": "^4.0", + "squizlabs/php_codesniffer": "^2.0" }, "bin": [ "src/bin/phpmd" @@ -3358,12 +3584,18 @@ "name": "Manuel Pichler", "email": "github@manuel-pichler.de", "homepage": "https://github.com/manuelpichler", - "role": "Project founder" + "role": "Project Founder" }, { "name": "Other contributors", "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", "role": "Contributors" + }, + { + "name": "Marc Würth", + "email": "ravage@bluewin.ch", + "homepage": "https://github.com/ravage84", + "role": "Project Maintainer" } ], "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", @@ -3375,34 +3607,37 @@ "phpmd", "pmd" ], - "time": "2015-03-26 07:47:05" + "time": "2016-11-23 20:33:32" }, { "name": "phpspec/prophecy", - "version": "v1.4.1", + "version": "v1.6.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373" + "reference": "6c52c2722f8460122f96f86346600e1077ce22cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", - "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb", + "reference": "6c52c2722f8460122f96f86346600e1077ce22cb", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", + "sebastian/recursion-context": "^1.0|^2.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "phpspec/phpspec": "^2.0", + "phpunit/phpunit": "^4.8 || ^5.6.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -3435,20 +3670,20 @@ "spy", "stub" ], - "time": "2015-04-27 22:15:08" + "time": "2016-11-21 14:58:47" }, { "name": "phpunit/php-code-coverage", - "version": "2.0.16", + "version": "2.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "934fd03eb6840508231a7f73eb8940cf32c3b66c" + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/934fd03eb6840508231a7f73eb8940cf32c3b66c", - "reference": "934fd03eb6840508231a7f73eb8940cf32c3b66c", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", "shasum": "" }, "require": { @@ -3456,7 +3691,7 @@ "phpunit/php-file-iterator": "~1.3", "phpunit/php-text-template": "~1.2", "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "~1.0", + "sebastian/environment": "^1.3.2", "sebastian/version": "~1.0" }, "require-dev": { @@ -3471,7 +3706,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.2.x-dev" } }, "autoload": { @@ -3497,20 +3732,20 @@ "testing", "xunit" ], - "time": "2015-04-11 04:35:00" + "time": "2015-10-06 15:47:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb" + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a923bb15680d0089e2316f7a4af8f437046e96bb", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", "shasum": "" }, "require": { @@ -3544,20 +3779,20 @@ "filesystem", "iterator" ], - "time": "2015-04-02 05:19:05" + "time": "2015-06-21 13:08:43" }, { "name": "phpunit/php-text-template", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "shasum": "" }, "require": { @@ -3566,20 +3801,17 @@ "type": "library", "autoload": { "classmap": [ - "Text/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -3588,35 +3820,35 @@ "keywords": [ "template" ], - "time": "2014-01-30 17:20:04" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", - "version": "1.0.5", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, "type": "library", "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -3632,20 +3864,20 @@ "keywords": [ "timer" ], - "time": "2013-08-02 07:42:54" + "time": "2016-05-12 18:03:57" }, { "name": "phpunit/php-token-stream", - "version": "1.4.1", + "version": "1.4.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "eab81d02569310739373308137284e0158424330" + "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/eab81d02569310739373308137284e0158424330", - "reference": "eab81d02569310739373308137284e0158424330", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b", + "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b", "shasum": "" }, "require": { @@ -3681,20 +3913,20 @@ "keywords": [ "tokenizer" ], - "time": "2015-04-08 04:46:07" + "time": "2016-11-15 14:06:22" }, { "name": "phpunit/phpunit", - "version": "4.6.4", + "version": "4.6.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "163232991e652e6efed2f8470326fffa61e848e2" + "reference": "7b5fe98b28302a8b25693b2298bca74463336975" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/163232991e652e6efed2f8470326fffa61e848e2", - "reference": "163232991e652e6efed2f8470326fffa61e848e2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7b5fe98b28302a8b25693b2298bca74463336975", + "reference": "7b5fe98b28302a8b25693b2298bca74463336975", "shasum": "" }, "require": { @@ -3753,26 +3985,27 @@ "testing", "xunit" ], - "time": "2015-04-11 05:23:21" + "time": "2015-06-03 05:03:30" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.1", + "version": "2.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "74ffb87f527f24616f72460e54b595f508dccb5c" + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/74ffb87f527f24616f72460e54b595f508dccb5c", - "reference": "74ffb87f527f24616f72460e54b595f508dccb5c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", "shasum": "" }, "require": { - "doctrine/instantiator": "~1.0,>=1.0.2", + "doctrine/instantiator": "^1.0.2", "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2" + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" }, "require-dev": { "phpunit/phpunit": "~4.4" @@ -3808,26 +4041,26 @@ "mock", "xunit" ], - "time": "2015-04-02 05:36:41" + "time": "2015-10-02 06:51:40" }, { "name": "sebastian/comparator", - "version": "1.1.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e" + "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1ed12e8b2409076ab22e3897126211ff8b1f7f", + "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f", "shasum": "" }, "require": { "php": ">=5.3.3", "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" + "sebastian/exporter": "~1.2 || ~2.0" }, "require-dev": { "phpunit/phpunit": "~4.4" @@ -3835,7 +4068,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -3872,32 +4105,32 @@ "compare", "equality" ], - "time": "2015-01-29 16:28:08" + "time": "2016-11-19 09:18:40" }, { "name": "sebastian/diff", - "version": "1.3.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "~4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -3920,31 +4153,31 @@ } ], "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ "diff" ], - "time": "2015-02-22 15:13:53" + "time": "2015-12-08 07:14:41" }, { "name": "sebastian/environment", - "version": "1.2.2", + "version": "1.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e" + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5a8c7d31914337b69923db26c4221b81ff5a196e", - "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^4.8 || ^5.0" }, "type": "library", "extra": { @@ -3974,20 +4207,20 @@ "environment", "hhvm" ], - "time": "2015-01-01 10:01:08" + "time": "2016-08-18 05:49:44" }, { "name": "sebastian/exporter", - "version": "1.2.0", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "84839970d05254c73cde183a721c7af13aede943" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", - "reference": "84839970d05254c73cde183a721c7af13aede943", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { @@ -3995,12 +4228,13 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { + "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -4040,20 +4274,20 @@ "export", "exporter" ], - "time": "2015-01-27 07:23:06" + "time": "2016-06-17 09:04:28" }, { "name": "sebastian/global-state", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", "shasum": "" }, "require": { @@ -4091,20 +4325,20 @@ "keywords": [ "global state" ], - "time": "2014-10-06 09:23:50" + "time": "2015-10-12 03:26:01" }, { "name": "sebastian/recursion-context", - "version": "1.0.0", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252" + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", "shasum": "" }, "require": { @@ -4144,20 +4378,20 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-01-24 09:48:32" + "time": "2015-11-11 19:50:13" }, { "name": "sebastian/version", - "version": "1.0.5", + "version": "1.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4" + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", - "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", "shasum": "" }, "type": "library", @@ -4179,27 +4413,31 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-02-24 06:35:25" + "time": "2015-06-21 13:59:46" }, { "name": "squizlabs/php_codesniffer", - "version": "2.3.1", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "f3100143e94bbeeaa4f1cd7c6389c3733d3d1ce1" + "reference": "571e27b6348e5b3a637b2abc82ac0d01e6d7bbed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f3100143e94bbeeaa4f1cd7c6389c3733d3d1ce1", - "reference": "f3100143e94bbeeaa4f1cd7c6389c3733d3d1ce1", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/571e27b6348e5b3a637b2abc82ac0d01e6d7bbed", + "reference": "571e27b6348e5b3a637b2abc82ac0d01e6d7bbed", "shasum": "" }, "require": { + "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", "php": ">=5.1.2" }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, "bin": [ "scripts/phpcs", "scripts/phpcbf" @@ -4207,7 +4445,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { @@ -4253,68 +4491,117 @@ "phpcs", "standards" ], - "time": "2015-04-23 03:40:59" + "time": "2016-09-01 23:53:02" }, { "name": "symfony/dependency-injection", - "version": "v2.6.6", - "target-dir": "Symfony/Component/DependencyInjection", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "8e9007012226b4bd41f8afed855c452cf5edc3a6" + "reference": "87598e21bb9020bd9ccd6df6936b9c369c72775d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/8e9007012226b4bd41f8afed855c452cf5edc3a6", - "reference": "8e9007012226b4bd41f8afed855c452cf5edc3a6", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/87598e21bb9020bd9ccd6df6936b9c369c72775d", + "reference": "87598e21bb9020bd9ccd6df6936b9c369c72775d", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "conflict": { - "symfony/expression-language": "<2.6" + "php": ">=5.5.9" }, "require-dev": { - "symfony/config": "~2.2", - "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", - "symfony/yaml": "~2.1" + "symfony/config": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/yaml": "~2.8.7|~3.0.7|~3.1.1|~3.2" }, "suggest": { "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", "symfony/yaml": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "3.1-dev" } }, "autoload": { - "psr-0": { + "psr-4": { "Symfony\\Component\\DependencyInjection\\": "" - } + }, + "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" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony DependencyInjection Component", - "homepage": "http://symfony.com", - "time": "2015-03-30 15:54:10" + "homepage": "https://symfony.com", + "time": "2016-11-18 21:15:08" + }, + { + "name": "webmozart/assert", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-11-23 20:04:58" } ], "aliases": [], diff --git a/data/migrations/20161102023508_add_blog_table.php b/data/migrations/20161102023508_add_blog_table.php new file mode 100644 index 0000000..38277be --- /dev/null +++ b/data/migrations/20161102023508_add_blog_table.php @@ -0,0 +1,46 @@ +table('blog_entries'); + $blog + ->addColumn('filename', 'string') + ->addColumn('author', 'string') + ->addColumn('email', 'string', ['null' => true]) + ->addColumn('post_date', 'date') + ->addColumn('published', 'boolean') + ->addColumn('slug', 'string') + ->addColumn('title', 'text') + ->addColumn('body', 'text') + ->create() + ; + } + + /** + * Migrate Down. + */ + public function down() + { + $this->dropTable('blog_entries'); + } +} \ No newline at end of file diff --git a/data/posts/.gitkeep b/data/posts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/public/index.php b/public/index.php index d392013..f1c91d1 100644 --- a/public/index.php +++ b/public/index.php @@ -1,8 +1,10 @@ register(new \Rpodwika\Silex\YamlConfigServiceProvider(__DIR__ . '/../app/config/parameters.yml')); @@ -41,6 +44,11 @@ 'twig.path' => __DIR__ . '/../views', 'twig.form.templates' => ['form/fields.twig'] ]); +$app->extend('twig', function($twig, $app) { + $twig->addExtension(new Twig_Extensions_Extension_Text()); + + return $twig; +}); $app->register(new Silex\Provider\MonologServiceProvider(), [ 'monolog.logfile' => __DIR__ . '/../data/logs/development.log', @@ -50,6 +58,12 @@ 'db.options' => $app['config']['database'], ]); +$app->register(new \Knp\Provider\ConsoleServiceProvider(), [ + 'console.name' => 'PHPMentoring Admin Console', + 'console.version' => '0.0.1', + 'console.project_directory' => __DIR__, +]); + $taxonomyServiceProvider = new \Mentoring\Taxonomy\ServiceProvider\TaxonomyServiceProvider(); $app->register($taxonomyServiceProvider); @@ -66,11 +80,17 @@ $app->mount('/api/v0', $apiServiceProvider); $indexServiceProvider = new \Mentoring\PublicSite\ServiceProvider\IndexServiceProvider(); -$app->register($indexServiceProvider); +$app->register($indexServiceProvider, [ + 'publicsite.blog_directory' => getenv('BLOG_DIRECTORY'), +]); $app->mount('/', $indexServiceProvider); $conversationServiceProvider = new \Mentoring\Conversation\ServiceProvider\ConversationServiceProvider(); $app->register($conversationServiceProvider); $app->mount('/conversations', $conversationServiceProvider); -$app->run(); \ No newline at end of file +if (php_sapi_name() === 'cli') { + $app['console']->run(); +} else { + $app->run(); +} \ No newline at end of file diff --git a/src/Mentoring/Command/AddMissingGithubUsernamesCommand.php b/src/Mentoring/Account/Command/AddMissingGithubUsernamesCommand.php similarity index 98% rename from src/Mentoring/Command/AddMissingGithubUsernamesCommand.php rename to src/Mentoring/Account/Command/AddMissingGithubUsernamesCommand.php index 8259651..a13414f 100644 --- a/src/Mentoring/Command/AddMissingGithubUsernamesCommand.php +++ b/src/Mentoring/Account/Command/AddMissingGithubUsernamesCommand.php @@ -7,7 +7,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License */ -namespace Mentoring\Command; +namespace Mentoring\Account\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; diff --git a/src/Mentoring/Account/ServiceProvider/AccountServiceProvider.php b/src/Mentoring/Account/ServiceProvider/AccountServiceProvider.php index 0a55bbd..b99a787 100644 --- a/src/Mentoring/Account/ServiceProvider/AccountServiceProvider.php +++ b/src/Mentoring/Account/ServiceProvider/AccountServiceProvider.php @@ -4,6 +4,7 @@ use Mentoring\Account\Controller\AccountController; use Mentoring\Account\Form\ProfileForm; +use Mentoring\Account\Command\AddMissingGithubUsernamesCommand; use Pimple\Container; use Pimple\ServiceProviderInterface; use Silex\Api\ControllerProviderInterface; @@ -31,6 +32,8 @@ public function connect(Application $app) public function register(Container $app) { + $app['console']->add(new AddMissingGithubUsernamesCommand()); + $app['controller.account'] = function ($app) { return new AccountController(); }; diff --git a/src/Mentoring/PublicSite/Blog/BlogEntry.php b/src/Mentoring/PublicSite/Blog/BlogEntry.php new file mode 100644 index 0000000..0df58ff --- /dev/null +++ b/src/Mentoring/PublicSite/Blog/BlogEntry.php @@ -0,0 +1,77 @@ +id; + } + + /** + * Converts an array into a Blog Entry + * + * @param array $data + */ + public function fromArray(array $data) + { + $this->id = isset($data['id']) ? $this->setId($data['id']) : null; + $this->filename = isset($data['filename']) ? $data['filename'] : ''; + $this->author = isset($data['author']) ? $data['author'] : ''; + $this->email = isset($data['email']) ? $data['email'] : ''; + $this->post_date = isset($data['post_date']) ? $data['post_date'] : ''; + $this->published = isset($data['published']) ? $data['published'] : ''; + $this->slug = isset($data['slug']) ? $data['slug'] : ''; + $this->title = isset($data['title']) ? $data['title'] : ''; + $this->body = isset($data['body']) ? $data['body'] : ''; + } + + /** + * Sets the ID of the blog entry + * + * @param int $id + * @return $this + */ + public function setId($id) + { + $this->id = $id; + return $this; + } + + /** + * Turns the blog entry into an array + * + * @return array + */ + public function toArray() + { + return [ + 'id' => $this->getId(), + 'filename' => $this->filename, + 'author' => $this->author, + 'email' => $this->email, + 'post_date' => $this->post_date, + 'published' => $this->published, + 'slug' => $this->slug, + 'title' => $this->title, + 'body' => $this->body, + ]; + } +} \ No newline at end of file diff --git a/src/Mentoring/PublicSite/Blog/BlogEntryHydrator.php b/src/Mentoring/PublicSite/Blog/BlogEntryHydrator.php new file mode 100644 index 0000000..cbe5ff9 --- /dev/null +++ b/src/Mentoring/PublicSite/Blog/BlogEntryHydrator.php @@ -0,0 +1,32 @@ +toArray(); + } + + /** + * Hydrates a blog entry object with the data + * + * @param array $data + * @param BlogEntry $object + * + * @return BlogEntry + */ + public function hydrate(array $data, BlogEntry $object) + { + $object->fromArray($data); + + return $object; + } +} diff --git a/src/Mentoring/PublicSite/Blog/BlogEntryNotFoundException.php b/src/Mentoring/PublicSite/Blog/BlogEntryNotFoundException.php new file mode 100644 index 0000000..4f37ad2 --- /dev/null +++ b/src/Mentoring/PublicSite/Blog/BlogEntryNotFoundException.php @@ -0,0 +1,8 @@ +dbal = $dbal; + $this->hydrator = $hydrator; + } + + /** + * Returns the most recent entries + * + * @param int $limit + * @return array + */ + public function fetchRecentEntries($limit = 5) + { + $qb = $this->dbal->createQueryBuilder(); + $qb + ->select('*') + ->from('blog_entries') + ->where('published = 1') + ->orderBy('post_date') + ->setMaxResults($limit) + ; + $data = $qb->execute(); + + $entries = []; + foreach ($data as $row) { + $entries[] = $this->hydrator->hydrate($row, new BlogEntry()); + } + + return $entries; + } + + /** + * Returns a single post from the database based on the criteria supplied + * + * @param array $where + * + * @return BlogEntry + */ + public function findEntry(array $where = []) + { + $qb = $this->dbal->createQueryBuilder(); + $qb + ->select('*') + ->from('blog_entries') + ->setMaxResults(1) + ; + + if (count($where)) { + foreach ($where as $column => $value) { + $qb->expr()->andX($qb->expr()->eq($column, $value)); + } + } + $data = $qb->execute(); + + return $this->hydrator->hydrate($data->fetch(), new BlogEntry()); + } + + /** + * Returns a blog entry based on a specific filename + * + * @param string $filename + * @return BlogEntry + * @throws BlogEntryNotFoundException + */ + public function findEntryByFilename($filename) + { + $data = $this->dbal->fetchAssoc('SELECT * FROM blog_entries WHERE filename = :filename', ['filename' => $filename]); + if (!$data) { + throw new BlogEntryNotFoundException('Could not find blog with filename ' . $filename); + } + + $entry = $this->hydrator->hydrate($data, new BlogEntry()); + + return $entry; + } + + /** + * Removes all blog entries that are not in the supplied list of filenames + * + * @param $filenamesToKeep + */ + public function massRemoveByFilename($filenamesToKeep) + { + $filenames = implode("', '", $filenamesToKeep); + $this->dbal->executeQuery('DELETE FROM blog_entries WHERE filename NOT IN (:filenames)', ['filenames' => $filenames]); + } + + /** + * Saves a blog entry off to the database + * + * @param BlogEntry $entry + * @return BlogEntry + */ + public function saveEntry(BlogEntry $entry) + { + $data = $this->hydrator->extract($entry); + + if (empty($data['id'])) { + try { + $this->findEntryByFilename($data['filename']); + $this->updateEntry($data); + } catch (BlogEntryNotFoundException $e) { + $this->dbal->insert('blog_entries', $data); + $entry->setId($this->dbal->lastInsertId()); + } + } else { + $this->updateEntry($data); + } + + return $entry; + } + + /** + * Updates an existing blog entry + * + * @param $data + * @return int + */ + protected function updateEntry($data) + { + return $this->dbal->update('blog_entries', $data, ['filename' => $data['filename']]); + } +} \ No newline at end of file diff --git a/src/Mentoring/PublicSite/Command/ImportBlogEntries.php b/src/Mentoring/PublicSite/Command/ImportBlogEntries.php new file mode 100644 index 0000000..0ddbd83 --- /dev/null +++ b/src/Mentoring/PublicSite/Command/ImportBlogEntries.php @@ -0,0 +1,106 @@ +blogService = $blogService; + $this->blogDirectory = $blogDirectory; + + parent::__construct(); + } + + /** + * Usage information for the command + */ + protected function configure() + { + $this->setName("mentoring:importBlogEntries") + ->setDescription("Imports blog entries into the database and runs any needed cleanups") + ->setHelp(<<writeln('Starting import...'); + $defaultData = [ + 'author' => 'A PHP Developer', + 'email' => 'phpmentoring@gmail.com', + 'published' => 0, + ]; + $pattern = $this->blogDirectory . '*.md'; + $files = glob($pattern); + $parser = new Parser(); + $hydrator = new BlogEntryHydrator(); + $filenames = []; + foreach ($files as $filePath) { + $filename = basename($filePath); + preg_match('/^([0-9]{4}-[0-9]{1,2}-[0-9]{1,2})\-([a-zA-Z-_]+)\.md$/', $filename, $matches); + $document = $parser->parse(file_get_contents($filePath)); + $yaml = array_merge($defaultData, $document->getYAML()); + $postDate = new \DateTime($matches[1]); + + $data = [ + 'filename' => $filename, + 'author' => $yaml['author'], + 'email' => $yaml['email'], + 'post_date' => $postDate->format('Y-m-d'), + 'published' => $yaml['published'], + 'slug' => $matches[2], + 'title' => $yaml['title'], + 'body' => $document->getContent(), + ]; + $blogEntry = new BlogEntry(); + $blogEntry = $hydrator->hydrate($data, $blogEntry); + $output->writeln('Saving ' . $filename . '...'); + $this->blogService->saveEntry($blogEntry); + $filenames[] = $filename; + } + + $output->writeln('Removing blog entries that no longer exist...'); + $this->blogService->massRemoveByFilename($filenames); + + $output->writeln('Finished'); + } +} diff --git a/src/Mentoring/PublicSite/Controller/IndexController.php b/src/Mentoring/PublicSite/Controller/IndexController.php index f2b5b11..05d04c6 100644 --- a/src/Mentoring/PublicSite/Controller/IndexController.php +++ b/src/Mentoring/PublicSite/Controller/IndexController.php @@ -4,12 +4,30 @@ use Mentoring\Conversation\Message; use Mentoring\Form\ConversationStartForm; +use Mentoring\PublicSite\Blog\BlogService; use Mentoring\User\UserNotFoundException; use Silex\Application; use Symfony\Component\HttpFoundation\Request; class IndexController { + public function blogAction(Application $app) + { + $blogService = $app['service.blog']; + $recentEntries = $blogService->fetchRecentEntries(); + + return $app['twig']->render('index/blog/index.twig', ['entries' => $recentEntries]); + } + + public function blogViewAction(Application $app, $slug) + { + /** @var BlogService $blogService */ + $blogService = $app['service.blog']; + $post = $blogService->findEntry(['slug' => $slug, 'published' => 1]); + + return $app['twig']->render('index/blog/view.twig', ['post' => $post]); + } + public function guidelinesAction(Application $app) { return $app['twig']->render('index/guidelines.twig'); diff --git a/src/Mentoring/PublicSite/ServiceProvider/IndexServiceProvider.php b/src/Mentoring/PublicSite/ServiceProvider/IndexServiceProvider.php index 1ec3e01..cbdefef 100644 --- a/src/Mentoring/PublicSite/ServiceProvider/IndexServiceProvider.php +++ b/src/Mentoring/PublicSite/ServiceProvider/IndexServiceProvider.php @@ -2,6 +2,9 @@ namespace Mentoring\PublicSite\ServiceProvider; +use Mentoring\PublicSite\Blog\BlogEntryHydrator; +use Mentoring\PublicSite\Blog\BlogService; +use Mentoring\PublicSite\Command\ImportBlogEntries; use Mentoring\PublicSite\Controller\IndexController; use Pimple\Container; use Pimple\ServiceProviderInterface; @@ -43,11 +46,30 @@ public function connect(Application $app) ->get('/why', 'controller.index:whyAction') ->bind('why'); + $controllers + ->get('/blog', 'controller.index:blogAction') + ->bind('blog_home'); + + $controllers + ->get('/blog/{slug}', 'controller.index:blogViewAction') + ->bind('blog_view'); + return $controllers; } public function register(Container $app) { + $app['publicsite.blog_entry.hydrator'] = function() { + return new BlogEntryHydrator(); + }; + + $app['service.blog'] = function($app) { + return new BlogService($app['db'], $app['publicsite.blog_entry.hydrator']); + }; + + $blogPath = realpath($app['basedir'] . '/' . $app['config']['app']['blog_directory']) . '/'; + $app['console']->add(new ImportBlogEntries($app['service.blog'], $blogPath)); + $app['controller.index'] = function ($app) { return new IndexController(); }; diff --git a/views/index/blog/index.twig b/views/index/blog/index.twig new file mode 100644 index 0000000..93cd54c --- /dev/null +++ b/views/index/blog/index.twig @@ -0,0 +1,9 @@ +{% extends 'layouts/default.twig' %} +{% block content %} +

Our Blog

+ {% for post in entries %} +

{{ post.title }}

+
Posted on {{ post.post_date }} by {{ post.author }}
+ {{ post.body|striptags|truncate(300) }} + {% endfor %} +{% endblock %} \ No newline at end of file diff --git a/views/index/blog/view.twig b/views/index/blog/view.twig new file mode 100644 index 0000000..3b47f4d --- /dev/null +++ b/views/index/blog/view.twig @@ -0,0 +1,6 @@ +{% extends 'layouts/default.twig' %} +{% block content %} +

{{ post.title }}

+
Posted on {{ post.post_date }} by {{ post.author }}
+ {{ post.body|raw }} +{% endblock %} \ No newline at end of file diff --git a/views/layouts/default.twig b/views/layouts/default.twig index 0519367..2e560d5 100644 --- a/views/layouts/default.twig +++ b/views/layouts/default.twig @@ -48,6 +48,7 @@
  • Guidelines
  • Why Mentoring
  • Search Mentors
  • +
  • Blog
  • Join us on IRC