Browse Source

empty project template

pull/39/head
Aaron Parecki 8 years ago
commit
22a71fd7e9
16 changed files with 536 additions and 0 deletions
  1. +3
    -0
      .gitignore
  2. +1
    -0
      CONTRIBUTING.md
  3. +7
    -0
      LICENSE.txt
  4. +2
    -0
      README.md
  5. +7
    -0
      app.yaml
  6. +11
    -0
      composer.json
  7. +440
    -0
      composer.lock
  8. +4
    -0
      config.template.php
  9. +10
    -0
      controllers/controllers.php
  10. +6
    -0
      lib/helpers.php
  11. +0
    -0
      public/assets/script.js
  12. +0
    -0
      public/assets/style.css
  13. +16
    -0
      public/index.php
  14. +4
    -0
      tests/bootstrap.php
  15. +5
    -0
      views/index.php
  16. +20
    -0
      views/layout.php

+ 3
- 0
.gitignore View File

@ -0,0 +1,3 @@
.DS_Store
config.php
vendor/

+ 1
- 0
CONTRIBUTING.md View File

@ -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.

+ 7
- 0
LICENSE.txt View File

@ -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.

+ 2
- 0
README.md View File

@ -0,0 +1,2 @@
Percolator
==========

+ 7
- 0
app.yaml View File

@ -0,0 +1,7 @@
runtime: php55
api_version: 1
handlers:
- url: /assets
static_dir: public/assets
- url: /.*
script: public/index.php

+ 11
- 0
composer.json View File

@ -0,0 +1,11 @@
{
"require": {
"league/plates": "3.*",
"league/route": "~1.2"
},
"autoload": {
"files": [
"lib/helpers.php"
]
}
}

+ 440
- 0
composer.lock View File

@ -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": []
}

+ 4
- 0
config.template.php View File

@ -0,0 +1,4 @@
<?php
class Config {
public static $base = 'http://example.com';
}

+ 10
- 0
controllers/controllers.php View File

@ -0,0 +1,10 @@
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
$router->addRoute('GET', '/', function(Request $request, Response $response) {
$response->setContent(view('index', [
'title' => 'Percolator'
]));
return $response;
});

+ 6
- 0
lib/helpers.php View File

@ -0,0 +1,6 @@
<?php
function view($template, $data=[]) {
global $templates;
return $templates->render($template, $data);
}

+ 0
- 0
public/assets/script.js View File


+ 0
- 0
public/assets/style.css View File


+ 16
- 0
public/index.php View File

@ -0,0 +1,16 @@
<?php
chdir('..');
include('config.php');
include('vendor/autoload.php');
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
$router = new League\Route\RouteCollection;
$templates = new League\Plates\Engine(dirname(__FILE__).'/../views');
include('controllers/controllers.php');
$dispatcher = $router->getDispatcher();
$request = Request::createFromGlobals();
$response = $dispatcher->dispatch($request->getMethod(), $request->getPathInfo());
$response->send();

+ 4
- 0
tests/bootstrap.php View File

@ -0,0 +1,4 @@
<?php
namespace p3k;
const TESTING = true;
require __DIR__ . '/../vendor/autoload.php';

+ 5
- 0
views/index.php View File

@ -0,0 +1,5 @@
<?php $this->layout('layout', ['title' => $title]); ?>
<div id="header">
<h1>Percolator</h1>
</div>

+ 20
- 0
views/layout.php View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title><?= $this->e($title) ?></title>
<link href="/assets/style.css" rel="stylesheet">
<script src="/assets/script.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div id="page-content">
<?= $this->section('content') ?>
</div>
<footer>
<a href="https://indiewebcamp.com/Percolator">What is Percolator?</a>
</footer>
</body>
</html>

Loading…
Cancel
Save