diff --git a/README.md b/README.md new file mode 100644 index 0000000..610021c --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +## Selami Example App Skeleton + +### Installation + +```bash +composer create-project selami\skeleton-app myApp +cd myApp +cp config/autoload/local.php.dist config/autoload/local.php +``` + +### Testing locally + +```bash +php -S 127.0.0.1:8080 -t public/ +``` + +### Available routes with the default installation: + +* http://127.0.0.1:8080/ +* http://127.0.0.1:8080/category/test-category-slug +* http://127.0.0.1:8080/2017/05/test-json-slug + + diff --git a/bin/console b/bin/console new file mode 100755 index 0000000..8f73875 --- /dev/null +++ b/bin/console @@ -0,0 +1,14 @@ +#!/usr/bin/env php +run(); diff --git a/cache/.gittrack b/cache/.gittrack new file mode 100644 index 0000000..e69de29 diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..4b89155 --- /dev/null +++ b/composer.json @@ -0,0 +1,24 @@ +{ + "name": "selami/skeleton-app", + "description": "Skeleton app that is built on selami/foundation", + "type": "project", + "require": { + "selami/foundation": "^0.3.0", + "symfony/http-foundation": "^3.3", + "selami/console": "^0.2.1" + }, + "license": "MIT", + "authors": [ + { + "name": "Mehmet Korkmaz", + "email": "mehmet@mkorkmaz.com" + } + ], + "minimum-stability": "stable", + "autoload": { + "psr-4": { + "SelamiApp\\": "src/apps/www/controllers", + "SelamiApp\\Command\\": "src/commands" + } + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..f59fc53 --- /dev/null +++ b/composer.lock @@ -0,0 +1,1075 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "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": "d5d8685fcc603af114fdba414918639a", + "packages": [ + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" + }, + { + "name": "mattketmo/camel", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/MattKetmo/camel.git", + "reference": "2d7753c62787933f6761108acc76f95d8bfee191" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MattKetmo/camel/zipball/2d7753c62787933f6761108acc76f95d8bfee191", + "reference": "2d7753c62787933f6761108acc76f95d8bfee191", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "4.6.*" + }, + "type": "library", + "autoload": { + "psr-0": { + "Camel": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthieu Moquet", + "email": "matthieu@moquet.net" + } + ], + "description": "Tiny library to handle words case transformation", + "keywords": [ + "camelcase", + "case", + "lowercase", + "snakecase", + "transform" + ], + "time": "2015-05-13T13:51:08+00:00" + }, + { + "name": "nikic/fast-route", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/FastRoute.git", + "reference": "b5f95749071c82a8e0f58586987627054400cdf6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/FastRoute/zipball/b5f95749071c82a8e0f58586987627054400cdf6", + "reference": "b5f95749071c82a8e0f58586987627054400cdf6", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "FastRoute\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov", + "email": "nikic@php.net" + } + ], + "description": "Fast request router for PHP", + "keywords": [ + "router", + "routing" + ], + "time": "2017-01-19T11:35:12+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "selami/console", + "version": "0.2.1", + "source": { + "type": "git", + "url": "https://github.com/selamiphp/console.git", + "reference": "14c76ec7f642cded12200c04d9d5c86c0291beef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/selamiphp/console/zipball/14c76ec7f642cded12200c04d9d5c86c0291beef", + "reference": "14c76ec7f642cded12200c04d9d5c86c0291beef", + "shasum": "" + }, + "require": { + "php": "^7.1", + "psr/container": "^1.0", + "symfony/console": "^3.2" + }, + "require-dev": { + "phpunit/phpcov": "^4.0", + "phpunit/phpunit": "^6.1", + "satooshi/php-coveralls": "~1.0", + "zendframework/zend-servicemanager": "^3.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Selami\\": "src" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mehmet Korkmaz", + "email": "mehmet@mkorkmaz.com" + } + ], + "description": "Creating Console Application library on top of Symfony Console", + "time": "2017-05-30T11:05:26+00:00" + }, + { + "name": "selami/foundation", + "version": "0.3", + "source": { + "type": "git", + "url": "https://github.com/selamiphp/foundation.git", + "reference": "5ca5e8bde12f8202ad1f1ab17916e2c85bfbea52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/selamiphp/foundation/zipball/5ca5e8bde12f8202ad1f1ab17916e2c85bfbea52", + "reference": "5ca5e8bde12f8202ad1f1ab17916e2c85bfbea52", + "shasum": "" + }, + "require": { + "php": "^7.1", + "psr/container": "^1.0", + "selami/router": "^0.2", + "selami/views": "^0.1", + "zendframework/zend-config": "^3.1", + "zendframework/zend-diactoros": "^1.3", + "zendframework/zend-servicemanager": "^3.0" + }, + "require-dev": { + "phpunit/phpcov": "^4.0", + "phpunit/phpunit": "^6.0", + "satooshi/php-coveralls": "~1.0", + "squizlabs/php_codesniffer": "^2.0", + "symfony/http-foundation": "^3.2" + }, + "type": "framework", + "autoload": { + "psr-4": { + "Selami\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mehmet Korkmaz", + "email": "mehmet@mkorkmaz.com", + "homepage": "https://mkorkmaz.com" + } + ], + "description": "A PHP Framework for Selamis", + "homepage": "https://github.com/selamiphp/core", + "keywords": [ + "diactoros", + "framework", + "micro framework", + "twig" + ], + "time": "2017-06-15T11:38:19+00:00" + }, + { + "name": "selami/router", + "version": "0.2.1", + "source": { + "type": "git", + "url": "https://github.com/selamiphp/router.git", + "reference": "65472e4d7fe802297afe2a27bfd2892c7bcf9848" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/selamiphp/router/zipball/65472e4d7fe802297afe2a27bfd2892c7bcf9848", + "reference": "65472e4d7fe802297afe2a27bfd2892c7bcf9848", + "shasum": "" + }, + "require": { + "nikic/fast-route": "~1.1", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpcov": "^3.1.0", + "phpunit/phpunit": "^5.4.0", + "satooshi/php-coveralls": "~1.0", + "zendframework/zend-diactoros": "^1.3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Selami\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mehmet Korkmaz", + "email": "mehmet@mkorkmaz.com", + "homepage": "https://mkorkmaz.com" + } + ], + "description": "Router and Dispatcher built on top nikic/FastRoute that returns controller class name to be instantiated.", + "homepage": "https://github.com/selamiphp/router", + "keywords": [ + "FastRoute", + "Selami", + "router" + ], + "time": "2017-03-23T11:01:21+00:00" + }, + { + "name": "selami/views", + "version": "0.1.1", + "source": { + "type": "git", + "url": "https://github.com/selamiphp/views.git", + "reference": "63e320765964328d6794e96ec44c0a7c0e56b783" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/selamiphp/views/zipball/63e320765964328d6794e96ec44c0a7c0e56b783", + "reference": "63e320765964328d6794e96ec44c0a7c0e56b783", + "shasum": "" + }, + "require": { + "mattketmo/camel": "~1.1", + "php": "^7.0", + "twig/extensions": "^1.4", + "twig/twig": "^2.0" + }, + "require-dev": { + "phpunit/phpcov": "^3.1.0", + "phpunit/phpunit": "^5.4.0", + "satooshi/php-coveralls": "~1.0" + }, + "suggest": { + "latte/latte": "~2.4.2 for Latte Templating Engine", + "league/plates": "3.* for Plates Templating Engine", + "mustache/mustache": "2.11.1 for Mustache Templating Engine", + "smarty/smarty": "~3.1 for Smarty Templating Engine" + }, + "type": "library", + "autoload": { + "psr-4": { + "Selami\\View\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mehmet Korkmaz", + "email": "mehmet@mkorkmaz.com", + "homepage": "https://mkorkmaz.com" + } + ], + "description": "Templating engines collection.", + "homepage": "https://github.com/selamiphp/router", + "keywords": [ + "Selami", + "latte", + "mustache", + "plates", + "smarty", + "twig", + "view" + ], + "time": "2017-01-05T21:13:59+00:00" + }, + { + "name": "symfony/console", + "version": "v3.3.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "70d2a29b2911cbdc91a7e268046c395278238b2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/70d2a29b2911cbdc91a7e268046c395278238b2e", + "reference": "70d2a29b2911cbdc91a7e268046c395278238b2e", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/debug": "~2.8|~3.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.3", + "symfony/dependency-injection": "~3.3", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/filesystem": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/filesystem": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2017-06-02T19:24:58+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.3.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "e9c50482841ef696e8fa1470d950a79c8921f45d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/e9c50482841ef696e8fa1470d950a79c8921f45d", + "reference": "e9c50482841ef696e8fa1470d950a79c8921f45d", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2017-06-01T21:01:25+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v3.3.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "80eb5a1f968448b77da9e8b2c0827f6e8d767846" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/80eb5a1f968448b77da9e8b2c0827f6e8d767846", + "reference": "80eb5a1f968448b77da9e8b2c0827f6e8d767846", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.1" + }, + "require-dev": { + "symfony/expression-language": "~2.8|~3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "https://symfony.com", + "time": "2017-06-05T13:06:51+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "f29dca382a6485c3cbe6379f0c61230167681937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937", + "reference": "f29dca382a6485c3cbe6379f0c61230167681937", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2017-06-09T14:24:12+00:00" + }, + { + "name": "twig/extensions", + "version": "v1.5.1", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig-extensions.git", + "reference": "d188c76168b853481cc75879ea045bf93d718e9c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/d188c76168b853481cc75879ea045bf93d718e9c", + "reference": "d188c76168b853481cc75879ea045bf93d718e9c", + "shasum": "" + }, + "require": { + "twig/twig": "~1.27|~2.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "~3.3@dev", + "symfony/translation": "~2.3|~3.0" + }, + "suggest": { + "symfony/translation": "Allow the time_diff output to be translated" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_Extensions_": "lib/" + }, + "psr-4": { + "Twig\\Extensions\\": "src/" + } + }, + "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": "2017-06-08T18:19:53+00:00" + }, + { + "name": "twig/twig", + "version": "v2.4.3", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "eab7c3288ae6603d7d6f92b531626af2b162d1f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/eab7c3288ae6603d7d6f92b531626af2b162d1f2", + "reference": "eab7c3288ae6603d7d6f92b531626af2b162d1f2", + "shasum": "" + }, + "require": { + "php": "^7.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/debug": "~2.7", + "symfony/phpunit-bridge": "~3.3@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + }, + { + "name": "Twig Team", + "homepage": "http://twig.sensiolabs.org/contributors", + "role": "Contributors" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", + "keywords": [ + "templating" + ], + "time": "2017-06-07T18:47:58+00:00" + }, + { + "name": "zendframework/zend-config", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-config.git", + "reference": "a12e4a592bf66d9629b84960e268f3752e53abe4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-config/zipball/a12e4a592bf66d9629b84960e268f3752e53abe4", + "reference": "a12e4a592bf66d9629b84960e268f3752e53abe4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^5.6 || ^7.0", + "psr/container": "^1.0", + "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + }, + "conflict": { + "container-interop/container-interop": "<1.2.0" + }, + "require-dev": { + "malukenho/docheader": "^0.1.5", + "phpunit/phpunit": "^5.7 || ^6.0", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-filter": "^2.7.1", + "zendframework/zend-i18n": "^2.7.3", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.2.1" + }, + "suggest": { + "zendframework/zend-filter": "^2.7.1; install if you want to use the Filter processor", + "zendframework/zend-i18n": "^2.7.3; install if you want to use the Translator processor", + "zendframework/zend-servicemanager": "^2.7.8 || ^3.2.1; if you need an extensible plugin manager for use with the Config Factory" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev", + "dev-develop": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Config\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a nested object property based user interface for accessing this configuration data within application code", + "homepage": "https://github.com/zendframework/zend-config", + "keywords": [ + "config", + "zf2" + ], + "time": "2017-02-22T14:31:10+00:00" + }, + { + "name": "zendframework/zend-diactoros", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-diactoros.git", + "reference": "b03f285a333f51e58c95cce54109a4a9ed691436" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/b03f285a333f51e58c95cce54109a4a9ed691436", + "reference": "b03f285a333f51e58c95cce54109a4a9ed691436", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-dom": "*", + "ext-libxml": "*", + "phpunit/phpunit": "^4.6 || ^5.5", + "zendframework/zend-coding-standard": "~1.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev", + "dev-develop": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Diactoros\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "description": "PSR HTTP Message implementations", + "homepage": "https://github.com/zendframework/zend-diactoros", + "keywords": [ + "http", + "psr", + "psr-7" + ], + "time": "2017-04-06T16:18:34+00:00" + }, + { + "name": "zendframework/zend-servicemanager", + "version": "3.3.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-servicemanager.git", + "reference": "c3036efb81f71bfa36cc9962ee5d4474f36581d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-servicemanager/zipball/c3036efb81f71bfa36cc9962ee5d4474f36581d0", + "reference": "c3036efb81f71bfa36cc9962ee5d4474f36581d0", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "php": "^5.6 || ^7.0", + "psr/container": "^1.0", + "zendframework/zend-stdlib": "^3.1" + }, + "provide": { + "container-interop/container-interop-implementation": "^1.2", + "psr/container-implementation": "^1.0" + }, + "require-dev": { + "mikey179/vfsstream": "^1.6", + "ocramius/proxy-manager": "^1.0 || ^2.0", + "phpbench/phpbench": "^0.10.0", + "phpunit/phpunit": "^5.7 || ^6.0.6", + "zendframework/zend-coding-standard": "~1.0.0" + }, + "suggest": { + "ocramius/proxy-manager": "ProxyManager 1.* to handle lazy initialization of services", + "zendframework/zend-stdlib": "zend-stdlib ^2.5 if you wish to use the MergeReplaceKey or MergeRemoveKey features in Config instances" + }, + "bin": [ + "bin/generate-deps-for-config-factory", + "bin/generate-factory-for-class" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev", + "dev-develop": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\ServiceManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-servicemanager", + "keywords": [ + "service-manager", + "servicemanager", + "zf" + ], + "time": "2017-03-01T22:08:02+00:00" + }, + { + "name": "zendframework/zend-stdlib", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-stdlib.git", + "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/debedcfc373a293f9250cc9aa03cf121428c8e78", + "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "~0.1", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "^2.6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev", + "dev-develop": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Stdlib\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-stdlib", + "keywords": [ + "stdlib", + "zf2" + ], + "time": "2016-09-13T14:38:50+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/config/autoload/app.global.php b/config/autoload/app.global.php new file mode 100644 index 0000000..62d6efe --- /dev/null +++ b/config/autoload/app.global.php @@ -0,0 +1,13 @@ + [ + 'app_namespace' => 'MyApp', + 'template_engine' => 'Twig', + 'templates_dir' => APP_DIR .'/templates', + 'cache_dir' => '/tmp', + 'debug' => 1, + 'auto_reload' => 1 + ] +]; \ No newline at end of file diff --git a/config/autoload/commands.global.php b/config/autoload/commands.global.php new file mode 100644 index 0000000..5c5594b --- /dev/null +++ b/config/autoload/commands.global.php @@ -0,0 +1,9 @@ + [ + SelamiApp\Command\Info::class, + SelamiApp\Command\Cache\ClearConfig::class + ] +]; \ No newline at end of file diff --git a/config/autoload/dependencies.global.php b/config/autoload/dependencies.global.php new file mode 100644 index 0000000..03d77ee --- /dev/null +++ b/config/autoload/dependencies.global.php @@ -0,0 +1,7 @@ + [ + ] +]; \ No newline at end of file diff --git a/config/autoload/local.php.dist b/config/autoload/local.php.dist new file mode 100644 index 0000000..7a1ee48 --- /dev/null +++ b/config/autoload/local.php.dist @@ -0,0 +1,6 @@ + false +]; \ No newline at end of file diff --git a/config/config.php b/config/config.php new file mode 100644 index 0000000..f866d31 --- /dev/null +++ b/config/config.php @@ -0,0 +1,27 @@ +setService('commands', $config['commands']); +$container->setService(ZendConfig::class, new ZendConfig($config)); + +$container->setFactory(Memcached::class, function(){ + $memcachedInstance = new Memcached(); + $memcachedInstance->addServer('127.0.0.1', 11211,100); + return $memcachedInstance;}); +$container->setService(ServerRequestInterface::class, $request); +$container->setFactory( + SymfonySession::class, function () use ($container) { + ini_set('session.handler', 'memcached'); + ini_set('session.save_path', 'localhost:11211'); + ini_set('session.use_cookies', '1'); + ini_set('session.use_only_cookies', '1'); + ini_set('session.cookie_httponly', '1'); + ini_set('session.name', 'SELAMISESSID'); + $storage = new NativeSessionStorage(array(), new MemcachedSessionHandler($container->get(Memcached::class))); + return new SymfonySession($storage); + } +); +if (isset($routes)) { + $router = new Router( + $config['default_return_type'] ?? 'html', + $request->getMethod(), + $request->getUri()->getPath() + ); + foreach ($routes as $route) { + $router->add($route[0], $route[1], $route[2], $route[3], $route[4]??''); + } + $container->setService(Router::class, $router); +} + +$container->setFactory( + ViewInterface::class, function () use ($config, $request) { + return new Selami\View\Twig\Twig($config['app'], $request->getParams()); + } +); +return $container; diff --git a/config/routes.php b/config/routes.php new file mode 100644 index 0000000..82d386a --- /dev/null +++ b/config/routes.php @@ -0,0 +1,18 @@ +get(Config::class)->get('default_return_type', 'html'), + $request->getMethod(), + $request->getUri()->getPath() +); + + +foreach ($routes as $route) { + $router->add($route[0], $route[1], $route[2], $route[3], $route[4]??''); +} + + +return $router; \ No newline at end of file diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..535afbd --- /dev/null +++ b/public/index.php @@ -0,0 +1,5 @@ +sendResponse(); \ No newline at end of file diff --git a/src/apps/www/controllers/Application.php b/src/apps/www/controllers/Application.php new file mode 100644 index 0000000..2b6d896 --- /dev/null +++ b/src/apps/www/controllers/Application.php @@ -0,0 +1,31 @@ + 200, 'data' => ['t' => 'Category:'. $this->args['category']]]; + } + +} \ No newline at end of file diff --git a/src/apps/www/controllers/Contents/ContentsController.php b/src/apps/www/controllers/Contents/ContentsController.php new file mode 100644 index 0000000..a232759 --- /dev/null +++ b/src/apps/www/controllers/Contents/ContentsController.php @@ -0,0 +1,31 @@ +session = $session; + $this->request = $request; + $this->args = $args; + } + + public static function factory(ContainerInterface $container, ?array $args) : App + { + $session = $container->get(Session::class); + $request = $container->get(ServerRequestInterface::class); + return new static($request, $session, $args); + } + +} \ No newline at end of file diff --git a/src/apps/www/controllers/Contents/Main.php b/src/apps/www/controllers/Contents/Main.php new file mode 100644 index 0000000..b8dfb9c --- /dev/null +++ b/src/apps/www/controllers/Contents/Main.php @@ -0,0 +1,15 @@ + 200, 'data' => ['t' => 'Main']]; + } +} \ No newline at end of file diff --git a/src/apps/www/controllers/Contents/Post.php b/src/apps/www/controllers/Contents/Post.php new file mode 100644 index 0000000..f64cf5c --- /dev/null +++ b/src/apps/www/controllers/Contents/Post.php @@ -0,0 +1,28 @@ +session->get('count', 0); + $count++; + $this->session->set('count', $count); + return [ + 'status' => 200, + 'data' => [ + 't' => 'Post:'.$this->args['year'].'-'.$this->args['month'].'-'.$this->args['slug'], + 'c' => $count + ] + ]; + } + + + + +} \ No newline at end of file diff --git a/src/apps/www/routes.php b/src/apps/www/routes.php new file mode 100644 index 0000000..c97fab6 --- /dev/null +++ b/src/apps/www/routes.php @@ -0,0 +1,10 @@ + + + + + Title + + +{{app_content|raw}} + + \ No newline at end of file diff --git a/src/apps/www/templates/contents/category.twig b/src/apps/www/templates/contents/category.twig new file mode 100644 index 0000000..d3d2ac7 --- /dev/null +++ b/src/apps/www/templates/contents/category.twig @@ -0,0 +1 @@ +{{ t }} \ No newline at end of file diff --git a/src/apps/www/templates/contents/main.twig b/src/apps/www/templates/contents/main.twig new file mode 100644 index 0000000..d3d2ac7 --- /dev/null +++ b/src/apps/www/templates/contents/main.twig @@ -0,0 +1 @@ +{{ t }} \ No newline at end of file diff --git a/src/apps/www/templates/contents/post.twig b/src/apps/www/templates/contents/post.twig new file mode 100644 index 0000000..d3d2ac7 --- /dev/null +++ b/src/apps/www/templates/contents/post.twig @@ -0,0 +1 @@ +{{ t }} \ No newline at end of file diff --git a/src/commands/Cache/ClearConfig.php b/src/commands/Cache/ClearConfig.php new file mode 100644 index 0000000..0419aa6 --- /dev/null +++ b/src/commands/Cache/ClearConfig.php @@ -0,0 +1,34 @@ +setName('cache:clear-config') + ->setDescription('Clears generated config file.'); + } + + /** + * @inheritdoc + */ + protected function execute(InputInterface $input, OutputInterface $output) : void + { + $cachedConfigFile = SELAMI_CONSOLE_PATH . '/cache/app_config.php'; + $unlinkResult = (unlink($cachedConfigFile) === True) ? 'deleted.':'could\'t deleted'; + $output->writeln($cachedConfigFile . ' ' . $unlinkResult ); + } +} diff --git a/src/commands/Info.php b/src/commands/Info.php new file mode 100644 index 0000000..6a6393d --- /dev/null +++ b/src/commands/Info.php @@ -0,0 +1,33 @@ +setName('info') + ->setDescription('Displays configuration.'); + } + + /** + * @inheritdoc + */ + protected function execute(InputInterface $input, OutputInterface $output) : void + { + $config = $this->container->get(Config::class); + $output->writeln(json_encode($config->toArray(), JSON_PRETTY_PRINT)); + } +} diff --git a/vendor/.gittrack b/vendor/.gittrack new file mode 100644 index 0000000..e69de29