Commit 893fc4c1 authored by Arnaud Buathier's avatar Arnaud Buathier

init

parent 75bf4ece
.idea
vendor
cache
demo/cache
composer.lock
.php_cs.cache
\ No newline at end of file
<?php
$header = <<<HEADER
This file is part of the Arnapou Simple Site package.
(c) Arnaud Buathier <[email protected]>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
HEADER;
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/src');
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules(
[
'@PSR2' => true,
'@DoctrineAnnotation' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_after_opening_tag' => true,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'concat_space' => ['spacing' => 'one'],
'native_function_casing' => true,
'no_alias_functions' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unused_imports' => true,
'phpdoc_scalar' => true,
'phpdoc_single_line_var_spacing' => true,
'short_scalar_cast' => true,
'single_quote' => true,
'standardize_not_equals' => true,
'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline_array' => true,
'native_function_invocation' => ['include' => ['@compiler_optimized']],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'single_import_per_statement' => true,
'header_comment' => ['header' => $header],
]
)
->setFinder($finder);
build: update
php -d "phar.readonly=Off" ./bin/box build
update:
php bin/composer update
php-cs-fixer:
php bin/php-cs-fixer fix --config=.php_cs --verbose --using-cache=no
File added
File added
{
"chmod": "0755",
"main": "src/main.php",
"output": "site/simple_site.phar",
"compression": "GZ",
"intercept": true,
"directories": [
"src",
"templates"
],
"finder": [
{
"name": "*.php",
"exclude": [
"examples",
"demo",
"test",
"vendor",
"tests",
"Tests"
],
"in": "vendor"
}
],
"shebang": false,
"stub": true
}
\ No newline at end of file
{
"name": "arnapou/simple_site",
"description": "Arnapou Simple Site",
"authors": [
{
"name": "Arnaud Buathier",
"email": "[email protected]",
"homepage": "http://arnapou.net"
}
],
"require": {
"php": "^7.2.9",
"arnapou/pfdb": "^[email protected]",
"monolog/monolog": "^1.24",
"symfony/cache": "^4.2",
"symfony/http-foundation": "^4.2",
"symfony/routing": "^4.2",
"twig/twig": "^3.0"
},
"autoload": {
"psr-4": {
"Arnapou\\SimpleSite\\": "src"
}
}
}
<?php return array (
0 =>
array (
'date' => 20191207,
'ip' => '127.0.0.1',
'id' => 'IP.127.0.0.1.20191207',
),
1 =>
array (
'number' => 1,
'id' => 'COUNT',
),
2 =>
array (
'number' => 1,
'id' => 'MOIS.2019-12',
),
3 =>
array (
'number' => 1,
'id' => 'YEAR.2019',
),
);
#
# Example of "simple" table of persons
# YAML is easy to maintain
#
- id: 1
name: Andromache
gender: Female
language: Spanish
- id: 2
name: Karen
gender: Female
language: Filipino
- id: 3
name: Weber
gender: Male
language: Albanian
- id: 4
name: Kiel
gender: Male
language: Haitian Creole
- id: 5
name: Gottfried
gender: Male
language: Filipino
- id: 6
name: Addy
gender: Female
language: Persian
- id: 7
name: Robby
gender: Female
language: Hiri Motu
- id: 8
name: Agata
gender: Female
language: Nepali
- id: 9
name: Inness
gender: Male
language: Filipino
- id: 10
name: Lindon
gender: Male
language: Somali
- id: 11
name: Antonetta
gender: Female
language: Tamil
- id: 12
name: Erminia
gender: Female
language: Burmese
- id: 13
name: Dunn
gender: Male
language: Hungarian
- id: 14
name: Chariot
gender: Male
language: Aymara
- id: 15
name: Nappie
gender: Male
language: Lithuanian
- id: 16
name: Matias
gender: Male
language: Ndebele
- id: 17
name: Carmela
gender: Female
language: Icelandic
- id: 18
name: Colene
gender: Female
language: Luxembourgish
- id: 19
name: Rayna
gender: Female
language: Dutch
- id: 20
name: Cart
gender: Male
language: Macedonian
- id: 21
name: Cecelia
gender: Female
language: Filipino
- id: 22
name: Catriona
gender: Female
language: Pashto
- id: 23
name: Conrade
gender: Male
language: Kannada
- id: 24
name: Terencio
gender: Male
language: French
- id: 25
name: Sarah
gender: Female
language: Marathi
- id: 26
name: Patrizius
gender: Male
language: Fijian
- id: 27
name: Bunni
gender: Female
language: Dhivehi
- id: 28
name: Tillie
gender: Female
language: Finnish
- id: 29
name: Nil
gender: Male
language: Swahili
- id: 30
name: Salome
gender: Female
language: Hiri Motu
- id: 31
name: Alexio
gender: Male
language: Papiamento
- id: 32
name: Iggie
gender: Male
language: Montenegrin
- id: 33
name: Jody
gender: Male
language: Gagauz
- id: 34
name: Ingeborg
gender: Female
language: Icelandic
- id: 35
name: Isak
gender: Male
language: Latvian
- id: 36
name: Benyamin
gender: Male
language: Dhivehi
- id: 37
name: Jemie
gender: Female
language: Oriya
- id: 38
name: Kimbell
gender: Male
language: Tok Pisin
- id: 39
name: Tallie
gender: Female
language: Oriya
- id: 40
name: Leonore
gender: Female
language: Bulgarian
- id: 41
name: Burr
gender: Male
language: New Zealand Sign Language
- id: 42
name: Conni
gender: Female
language: Aymara
- id: 43
name: Godfree
gender: Male
language: Italian
- id: 44
name: Humfrid
gender: Male
language: Greek
- id: 45
name: Care
gender: Male
language: Quechua
- id: 46
name: Ambrosius
gender: Male
language: Bengali
- id: 47
name: Eveleen
gender: Female
language: Chinese
- id: 48
name: Jonie
gender: Female
language: Polish
- id: 49
name: Robinetta
gender: Female
language: Guaraní
- id: 50
name: Yulma
gender: Male
language: Montenegrin
- id: 51
name: Chen
gender: Male
language: English
- id: 52
name: Finn
gender: Male
language: Hebrew
- id: 53
name: Floyd
gender: Male
language: Papiamento
- id: 54
name: Umberto
gender: Male
language: Nepali
- id: 55
name: Xerxes
gender: Male
language: Greek
- id: 56
name: Inez
gender: Female
language: Dhivehi
- id: 57
name: Jane
gender: Female
language: Northern Sotho
- id: 58
name: Seka
gender: Female
language: Punjabi
- id: 59
name: Addie
gender: Male
language: Kashmiri
- id: 60
name: Nikolai
gender: Male
language: Pashto
- id: 61
name: Tess
gender: Female
language: Bulgarian
- id: 62
name: Ricoriki
gender: Male
language: Indonesian
- id: 63
name: Cheston
gender: Male
language: Chinese
- id: 64
name: Arny
gender: Male
language: Korean
- id: 65
name: Emylee
gender: Female
language: Assamese
- id: 66
name: Michal
gender: Male
language: Persian
- id: 67
name: Mimi
gender: Female
language: Thai
- id: 68
name: Onfre
gender: Male
language: Dari
- id: 69
name: Davy
gender: Male
language: Icelandic
- id: 70
name: Joey
gender: Male
language: Amharic
- id: 71
name: Baily
gender: Male
language: Telugu
- id: 72
name: Marcos
gender: Male
language: Ndebele
- id: 73
name: Linus
gender: Male
language: Dutch
- id: 74
name: Hill
gender: Male
language: Latvian
- id: 75
name: Anet
gender: Female
language: Gagauz
- id: 76
name: Hilton
gender: Male
language: Italian
- id: 77
name: Kakalina
gender: Female
language: Tsonga
- id: 78
name: Fransisco
gender: Male
language: Chinese
- id: 79
name: Hyman
gender: Male
language: Arabic
- id: 80
name: Bryan
gender: Male
language: Aymara
- id: 81
name: Zollie
gender: Male
language: Dutch
- id: 82
name: Daphna
gender: Female
language: Portuguese
- id: 83
name: Jane
gender: Female
language: Dhivehi
- id: 84
name: Germayne
gender: Male
language: Thai
- id: 85
name: Violette
gender: Female
language: New Zealand Sign Language
- id: 86
name: Ty
gender: Male
language: Kannada
- id: 87
name: Hayward
gender: Male
language: Bosnian
- id: 88
name: Tani
gender: Female
language: New Zealand Sign Language
- id: 89
name: Hali
gender: Female
language: Pashto
- id: 90
name: Elysee
gender: Female
language: Croatian
- id: 91
name: Lita
gender: Female
language: Moldovan
- id: 92
name: Therese
gender: Female
language: Arabic
- id: 93
name: Bertie
gender: Male
language: Tetum
- id: 94
name: Clayton
gender: Male
language: Kazakh
- id: 95
name: Augustine
gender: Male
language: Romanian
- id: 96
name: Orly
gender: Female
language: Korean
- id: 97
name: Missie
gender: Female
language: Haitian Creole
- id: 98
name: Clara
gender: Female
language: Dzongkha
- id: 99
name: Martainn
gender: Male
language: Icelandic
- id: 100
name: Cherice
gender: Female
language: Gagauz
#
# base de variables disponibles en global dans le twig
#
-
id: url_arnapou
value: 'http://arnapou.net/'
-
id: url_github
value: 'https://github.com/arnapou/simplesite'
-
id: url_twig
value: 'https://twig.symfony.com/'
-
id: url_yaml
value: 'https://fr.wikipedia.org/wiki/YAML'
-
id: url_php
value: 'https://www.php.net/'
-
id: url_http_foundation
value: 'https://symfony.com/doc/current/components/http_foundation.html'
-
id: url_routing
value: 'https://symfony.com/doc/current/components/routing.html'
<?php
use Arnapou\SimpleSite\Core\Controller;
return new class() extends Controller {
public function configure(): void
{
$this->addRoute('hello-{name}', [$this, 'hello'], 'hello')
->setRequirement('name', '[a-zA-Z]+');
}
public function hello($name)
{