php composer modules

This commit is contained in:
Bryan Joshua Pedini 2020-12-29 11:08:14 +01:00
parent 2257381181
commit 6c48fceb08
7 changed files with 282 additions and 5 deletions

3
.gitignore vendored
View File

@ -1,4 +1,3 @@
/modules/*
!/modules/load_modules.php
/static/*
/templates/*
/vendor

9
.gitmodules vendored
View File

@ -7,6 +7,9 @@
[submodule "modules/config"]
path = modules/config
url = git@git.bjphoster.com:myphpfw/config.git
[submodule "modules/twig_templating"]
path = modules/twig_templating
url = git@git.bjphoster.com:myphpfw/twig_templating.git
[submodule "modules/get_include_contents"]
path = modules/get_include_contents
url = git@git.bjphoster.com:myphpfw/get_include_contents.git
[submodule "modules/composer_modules"]
path = modules/composer_modules
url = git@git.bjphoster.com:myphpfw/composer_modules.git

5
composer.json Normal file
View File

@ -0,0 +1,5 @@
{
"require": {
"twig/twig": "3.1.1"
}
}

254
composer.lock generated Normal file
View File

@ -0,0 +1,254 @@
{
"_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#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "03283c59f4e7869495860f39a3f181b2",
"packages": [
{
"name": "symfony/polyfill-ctype",
"version": "v1.20.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41",
"reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.20-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.20.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-23T14:02:19+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.20.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "39d483bdf39be819deabf04ec872eb0b2410b531"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531",
"reference": "39d483bdf39be819deabf04ec872eb0b2410b531",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.20-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"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"
],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-23T14:02:19+00:00"
},
{
"name": "twig/twig",
"version": "v3.1.1",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "b02fa41f3783a2616eccef7b92fbc2343ffed737"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/b02fa41f3783a2616eccef7b92fbc2343ffed737",
"reference": "b02fa41f3783a2616eccef7b92fbc2343ffed737",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-mbstring": "^1.3"
},
"require-dev": {
"psr/container": "^1.0",
"symfony/phpunit-bridge": "^4.4.9|^5.0.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.1-dev"
}
},
"autoload": {
"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": "Twig Team",
"role": "Contributors"
},
{
"name": "Armin Ronacher",
"email": "armin.ronacher@active-4.com",
"role": "Project Founder"
}
],
"description": "Twig, the flexible, fast, and secure template language for PHP",
"homepage": "https://twig.symfony.com",
"keywords": [
"templating"
],
"support": {
"issues": "https://github.com/twigphp/Twig/issues",
"source": "https://github.com/twigphp/Twig/tree/v3.1.1"
},
"funding": [
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/twig/twig",
"type": "tidelift"
}
],
"time": "2020-10-27T19:28:23+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.0.0"
}

14
docker_php-composer_modules.sh Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
docker ps &>/dev/null
if [ "$?" -ne 0 ]; then
# It appears that this user isn't enabled to talk to the Docker daemon
echo -e "You don't have access to the Docker daemon\nTry executing as \`root\` please."
exit 1
else
# List all files' permissions, one username only (uniq), extract uid and gid from respective files
user=$(cat /etc/passwd | grep -e "^$(ls -l $(pwd) | grep -v "total" | awk '{print $3}' | uniq | head -n1)" | cut -d: -f3)
group=$(cat /etc/group | grep -e "^$(ls -l $(pwd) | grep -v "total" | awk '{print $4}' | uniq | head -n1)" | cut -d: -f3)
# Retrieve composer modules using docker, the container gets deleted as soon as finished
docker run --rm -it --user "$user":"$group" -v `pwd`:/app composer:2.0.8 install
fi

@ -0,0 +1 @@
Subproject commit 1a2c8c14fe331806c1b0f2d211b068573df7a5f1

View File

@ -3,3 +3,4 @@
require_once(__DIR__."/../modules/load_modules.php");
$parser = new url_parser();
$parser->parse();
echo $parser->execute_template();