From 22a71fd7e994a2676381118e5e56dd80445f6bfb Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Fri, 19 Feb 2016 08:53:27 -0800 Subject: [PATCH] empty project template --- .gitignore | 3 + CONTRIBUTING.md | 1 + LICENSE.txt | 7 + README.md | 2 + app.yaml | 7 + composer.json | 11 + composer.lock | 440 ++++++++++++++++++++++++++++++++++++ config.template.php | 4 + controllers/controllers.php | 10 + lib/helpers.php | 6 + public/assets/script.js | 0 public/assets/style.css | 0 public/index.php | 16 ++ tests/bootstrap.php | 4 + views/index.php | 5 + views/layout.php | 20 ++ 16 files changed, 536 insertions(+) create mode 100644 .gitignore create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 app.yaml create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 config.template.php create mode 100644 controllers/controllers.php create mode 100644 lib/helpers.php create mode 100644 public/assets/script.js create mode 100644 public/assets/style.css create mode 100644 public/index.php create mode 100644 tests/bootstrap.php create mode 100644 views/index.php create mode 100644 views/layout.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..96f6358 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +config.php +vendor/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3866598 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1 @@ +By submitting code to this project, you agree to irrevocably release it under the same license as this project. See README.md for more details. diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..21ebae4 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,7 @@ +Copyright 2016 by Aaron Parecki + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a6a06d7 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +Percolator +========== diff --git a/app.yaml b/app.yaml new file mode 100644 index 0000000..d1f8683 --- /dev/null +++ b/app.yaml @@ -0,0 +1,7 @@ +runtime: php55 +api_version: 1 +handlers: +- url: /assets + static_dir: public/assets +- url: /.* + script: public/index.php diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..e0ad10d --- /dev/null +++ b/composer.json @@ -0,0 +1,11 @@ +{ + "require": { + "league/plates": "3.*", + "league/route": "~1.2" + }, + "autoload": { + "files": [ + "lib/helpers.php" + ] + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..ac29001 --- /dev/null +++ b/composer.lock @@ -0,0 +1,440 @@ +{ + "_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" + ], + "hash": "3924a49472678c285aa91232b1137536", + "content-hash": "4498762edbdd47db9c5dabf888687ed0", + "packages": [ + { + "name": "ircmaxell/password-compat", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/ircmaxell/password_compat.git", + "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", + "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "autoload": { + "files": [ + "lib/password.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anthony Ferrara", + "email": "ircmaxell@php.net", + "homepage": "http://blog.ircmaxell.com" + } + ], + "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", + "homepage": "https://github.com/ircmaxell/password_compat", + "keywords": [ + "hashing", + "password" + ], + "time": "2014-11-20 16:49:30" + }, + { + "name": "league/container", + "version": "1.3.2", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/container.git", + "reference": "7e6c17fe48f76f3b97aeca70dc29c3f3c7c88d15" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/container/zipball/7e6c17fe48f76f3b97aeca70dc29c3f3c7c88d15", + "reference": "7e6c17fe48f76f3b97aeca70dc29c3f3c7c88d15", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "replace": { + "orno/di": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev", + "dev-1.x": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Container\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://philipobenito.github.io", + "role": "Developer" + } + ], + "description": "A fast and intuitive dependency injection container.", + "homepage": "https://github.com/thephpleague/container", + "keywords": [ + "container", + "dependency", + "di", + "injection", + "league" + ], + "time": "2015-04-05 17:14:48" + }, + { + "name": "league/plates", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/plates.git", + "reference": "2d8569e9f140a70d6a05db38006926f7547cb802" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/plates/zipball/2d8569e9f140a70d6a05db38006926f7547cb802", + "reference": "2d8569e9f140a70d6a05db38006926f7547cb802", + "shasum": "" + }, + "require-dev": { + "mikey179/vfsstream": "~1.4.0", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~1.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Plates\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan Reinink", + "email": "jonathan@reinink.ca", + "role": "Developer" + } + ], + "description": "Plates, the native PHP template system that's fast, easy to use and easy to extend.", + "homepage": "http://platesphp.com", + "keywords": [ + "league", + "package", + "templates", + "templating", + "views" + ], + "time": "2015-07-09 02:14:40" + }, + { + "name": "league/route", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/route.git", + "reference": "079e87a4653b43e2cba47b9e0563179c1c49fcf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/route/zipball/079e87a4653b43e2cba47b9e0563179c1c49fcf8", + "reference": "079e87a4653b43e2cba47b9e0563179c1c49fcf8", + "shasum": "" + }, + "require": { + "league/container": "~1.0", + "nikic/fast-route": "~0.3", + "php": ">=5.4.0", + "symfony/http-foundation": "~2.6" + }, + "replace": { + "orno/http": "~1.0", + "orno/route": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Route\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phil Bennett", + "email": "philipobenito@gmail.com", + "homepage": "http://philipobenito.github.io", + "role": "Developer" + } + ], + "description": "A fast routing and dispatch package built on top of FastRoute.", + "homepage": "https://github.com/thephpleague/route", + "keywords": [ + "league", + "route" + ], + "time": "2015-09-11 07:40:31" + }, + { + "name": "nikic/fast-route", + "version": "v0.7.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/FastRoute.git", + "reference": "8164b4a0d8afde4eae5f1bfc39084972ba23ad36" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/FastRoute/zipball/8164b4a0d8afde4eae5f1bfc39084972ba23ad36", + "reference": "8164b4a0d8afde4eae5f1bfc39084972ba23ad36", + "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": "2015-12-20 19:50:12" + }, + { + "name": "symfony/http-foundation", + "version": "v2.8.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "9194b33c71da8ef4d05d22964376f2f9c95a1bfd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9194b33c71da8ef4d05d22964376f2f9c95a1bfd", + "reference": "9194b33c71da8ef4d05d22964376f2f9c95a1bfd", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-php54": "~1.0", + "symfony/polyfill-php55": "~1.0" + }, + "require-dev": { + "symfony/expression-language": "~2.4|~3.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-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": "2016-01-13 10:28:07" + }, + { + "name": "symfony/polyfill-php54", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php54.git", + "reference": "74663d5a2ff3c530c1bc0571500e0feec9094054" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/74663d5a2ff3c530c1bc0571500e0feec9094054", + "reference": "74663d5a2ff3c530c1bc0571500e0feec9094054", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php54\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "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 backporting some PHP 5.4+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2016-01-20 09:13:37" + }, + { + "name": "symfony/polyfill-php55", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php55.git", + "reference": "b4f3f07d91702f8f926339fc4fcf81671d8c27e6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/b4f3f07d91702f8f926339fc4fcf81671d8c27e6", + "reference": "b4f3f07d91702f8f926339fc4fcf81671d8c27e6", + "shasum": "" + }, + "require": { + "ircmaxell/password-compat": "~1.0", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php55\\": "" + }, + "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 backporting some PHP 5.5+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2016-01-20 09:13:37" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/config.template.php b/config.template.php new file mode 100644 index 0000000..40254c7 --- /dev/null +++ b/config.template.php @@ -0,0 +1,4 @@ +addRoute('GET', '/', function(Request $request, Response $response) { + $response->setContent(view('index', [ + 'title' => 'Percolator' + ])); + return $response; +}); diff --git a/lib/helpers.php b/lib/helpers.php new file mode 100644 index 0000000..c0c11f7 --- /dev/null +++ b/lib/helpers.php @@ -0,0 +1,6 @@ +render($template, $data); +} diff --git a/public/assets/script.js b/public/assets/script.js new file mode 100644 index 0000000..e69de29 diff --git a/public/assets/style.css b/public/assets/style.css new file mode 100644 index 0000000..e69de29 diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..d68e2d6 --- /dev/null +++ b/public/index.php @@ -0,0 +1,16 @@ +getDispatcher(); +$request = Request::createFromGlobals(); +$response = $dispatcher->dispatch($request->getMethod(), $request->getPathInfo()); +$response->send(); diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..e1213dd --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,4 @@ +layout('layout', ['title' => $title]); ?> + + diff --git a/views/layout.php b/views/layout.php new file mode 100644 index 0000000..3a367a9 --- /dev/null +++ b/views/layout.php @@ -0,0 +1,20 @@ + + + + <?= $this->e($title) ?> + + + + + + +
+ section('content') ?> +
+ + + + +