Compare commits

..

1 Commits

Author SHA1 Message Date
7e9bcfef00 maj deps php8.2 2025-01-24 16:20:58 +04:00
25 changed files with 885 additions and 609 deletions

View File

@ -4,230 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "ab280aa4a5f5c83fa488537530b29759", "content-hash": "356c1dcfe9eee39e9e6eadff4f63cdfe",
"packages": [ "packages": [],
{
"name": "symfony/deprecation-contracts",
"version": "v2.5.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "605389f2a7e5625f273b53960dc46aeaf9c62918"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918",
"reference": "605389f2a7e5625f273b53960dc46aeaf9c62918",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/contracts",
"name": "symfony/contracts"
},
"branch-alias": {
"dev-main": "2.5-dev"
}
},
"autoload": {
"files": [
"function.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": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4"
},
"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": "2024-09-25T14:11:13+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638",
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
"provide": {
"ext-ctype": "*"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
"files": [
"bootstrap.php"
],
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
}
},
"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.31.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": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/yaml",
"version": "v5.4.45",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "a454d47278cc16a5db371fe73ae66a78a633371e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/a454d47278cc16a5db371fe73ae66a78a633371e",
"reference": "a454d47278cc16a5db371fe73ae66a78a633371e",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1|^3",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"symfony/console": "<5.3"
},
"require-dev": {
"symfony/console": "^5.3|^6.0"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
},
"bin": [
"Resources/bin/yaml-lint"
],
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
},
"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": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/yaml/tree/v5.4.45"
},
"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": "2024-09-25T14:11:13+00:00"
}
],
"packages-dev": [ "packages-dev": [
{ {
"name": "doctrine/instantiator", "name": "doctrine/instantiator",
@ -301,16 +79,16 @@
}, },
{ {
"name": "myclabs/deep-copy", "name": "myclabs/deep-copy",
"version": "1.12.1", "version": "1.12.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/myclabs/DeepCopy.git", "url": "https://github.com/myclabs/DeepCopy.git",
"reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c",
"reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -349,7 +127,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/myclabs/DeepCopy/issues", "issues": "https://github.com/myclabs/DeepCopy/issues",
"source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0"
}, },
"funding": [ "funding": [
{ {
@ -357,20 +135,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-11-08T17:47:46+00:00" "time": "2024-06-12T14:39:25+00:00"
}, },
{ {
"name": "nikic/php-parser", "name": "nikic/php-parser",
"version": "v5.4.0", "version": "v5.3.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nikic/PHP-Parser.git", "url": "https://github.com/nikic/PHP-Parser.git",
"reference": "447a020a1f875a434d62f2a401f53b82a396e494" "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b",
"reference": "447a020a1f875a434d62f2a401f53b82a396e494", "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -413,9 +191,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/nikic/PHP-Parser/issues", "issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1"
}, },
"time": "2024-12-30T11:07:19+00:00" "time": "2024-10-08T18:51:32+00:00"
}, },
{ {
"name": "nulib/tests", "name": "nulib/tests",
@ -423,7 +201,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.univ-reunion.fr/sda-php/nulib-tests.git", "url": "https://git.univ-reunion.fr/sda-php/nulib-tests.git",
"reference": "9b5c9c295c3dee6fc02ccddbd8a70bca797c8045" "reference": "6ce8257560b42e8fb3eea03eba84d3877c9648ca"
}, },
"require": { "require": {
"php": ">=7.3", "php": ">=7.3",
@ -447,7 +225,7 @@
} }
], ],
"description": "fonctions et classes pour les tests", "description": "fonctions et classes pour les tests",
"time": "2025-01-30T13:18:31+00:00" "time": "2024-03-26T10:56:17+00:00"
}, },
{ {
"name": "phar-io/manifest", "name": "phar-io/manifest",
@ -888,16 +666,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "9.6.22", "version": "9.6.21",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa",
"reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -908,7 +686,7 @@
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-xml": "*", "ext-xml": "*",
"ext-xmlwriter": "*", "ext-xmlwriter": "*",
"myclabs/deep-copy": "^1.12.1", "myclabs/deep-copy": "^1.12.0",
"phar-io/manifest": "^2.0.4", "phar-io/manifest": "^2.0.4",
"phar-io/version": "^3.2.1", "phar-io/version": "^3.2.1",
"php": ">=7.3", "php": ">=7.3",
@ -971,7 +749,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy", "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.21"
}, },
"funding": [ "funding": [
{ {
@ -987,7 +765,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-12-05T13:48:26+00:00" "time": "2024-09-19T10:50:18+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",
@ -2009,7 +1787,6 @@
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"ext-json": "*",
"php": "^7.4" "php": "^7.4"
}, },
"platform-dev": { "platform-dev": {

View File

@ -5,4 +5,4 @@ RUNPHP=
# Si RUNPHP n'est pas défini, les variables suivantes peuvent être définies # Si RUNPHP n'est pas défini, les variables suivantes peuvent être définies
DIST=d12 DIST=d12
#REGISTRY=pubdocker.univ-reunion.fr/dist #REGISTRY=pubdocker.univ-reunion.fr

View File

@ -22,7 +22,7 @@ done
if [ -z "$PROJDIR" ]; then if [ -z "$PROJDIR" ]; then
# s'il n'y a pas de projet, --bs est l'action par défaut # s'il n'y a pas de projet, --bs est l'action par défaut
[ $# -gt 0 ] || set -- --bs --ue [ $# -gt 0 ] || set -- --bs
elif [ "$MYNAME" == composer ]; then elif [ "$MYNAME" == composer ]; then
set -- composer "$@" set -- composer "$@"
else else

44
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "ab280aa4a5f5c83fa488537530b29759", "content-hash": "92c82f1783bab891c66fa145a07f88c7",
"packages": [ "packages": [
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
@ -25,12 +25,12 @@
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"thanks": {
"url": "https://github.com/symfony/contracts",
"name": "symfony/contracts"
},
"branch-alias": { "branch-alias": {
"dev-main": "2.5-dev" "dev-main": "2.5-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
} }
}, },
"autoload": { "autoload": {
@ -99,8 +99,8 @@
"type": "library", "type": "library",
"extra": { "extra": {
"thanks": { "thanks": {
"url": "https://github.com/symfony/polyfill", "name": "symfony/polyfill",
"name": "symfony/polyfill" "url": "https://github.com/symfony/polyfill"
} }
}, },
"autoload": { "autoload": {
@ -361,16 +361,16 @@
}, },
{ {
"name": "nikic/php-parser", "name": "nikic/php-parser",
"version": "v5.4.0", "version": "v5.3.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nikic/PHP-Parser.git", "url": "https://github.com/nikic/PHP-Parser.git",
"reference": "447a020a1f875a434d62f2a401f53b82a396e494" "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b",
"reference": "447a020a1f875a434d62f2a401f53b82a396e494", "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -413,9 +413,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/nikic/PHP-Parser/issues", "issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1"
}, },
"time": "2024-12-30T11:07:19+00:00" "time": "2024-10-08T18:51:32+00:00"
}, },
{ {
"name": "nulib/tests", "name": "nulib/tests",
@ -423,7 +423,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.univ-reunion.fr/sda-php/nulib-tests.git", "url": "https://git.univ-reunion.fr/sda-php/nulib-tests.git",
"reference": "9b5c9c295c3dee6fc02ccddbd8a70bca797c8045" "reference": "6ce8257560b42e8fb3eea03eba84d3877c9648ca"
}, },
"require": { "require": {
"php": ">=7.3", "php": ">=7.3",
@ -447,7 +447,7 @@
} }
], ],
"description": "fonctions et classes pour les tests", "description": "fonctions et classes pour les tests",
"time": "2025-01-30T13:18:31+00:00" "time": "2024-03-26T10:56:17+00:00"
}, },
{ {
"name": "phar-io/manifest", "name": "phar-io/manifest",
@ -888,16 +888,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "9.6.22", "version": "9.6.21",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa",
"reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -908,7 +908,7 @@
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-xml": "*", "ext-xml": "*",
"ext-xmlwriter": "*", "ext-xmlwriter": "*",
"myclabs/deep-copy": "^1.12.1", "myclabs/deep-copy": "^1.12.0",
"phar-io/manifest": "^2.0.4", "phar-io/manifest": "^2.0.4",
"phar-io/version": "^3.2.1", "phar-io/version": "^3.2.1",
"php": ">=7.3", "php": ">=7.3",
@ -971,7 +971,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy", "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.21"
}, },
"funding": [ "funding": [
{ {
@ -987,7 +987,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-12-05T13:48:26+00:00" "time": "2024-09-19T10:50:18+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 # -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
ARG NDIST=12 ARG NDIST=12
ARG REGISTRY=pubdocker.univ-reunion.fr/dist ARG REGISTRY=pubdocker.univ-reunion.fr
FROM $REGISTRY/src/base AS base FROM $REGISTRY/src/base AS base
FROM $REGISTRY/src/php AS php FROM $REGISTRY/src/php AS php

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 # -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
ARG NDIST=12 ARG NDIST=12
ARG REGISTRY=pubdocker.univ-reunion.fr/dist ARG REGISTRY=pubdocker.univ-reunion.fr
FROM $REGISTRY/src/base AS base FROM $REGISTRY/src/base AS base
FROM $REGISTRY/src/instantclient AS instantclient FROM $REGISTRY/src/instantclient AS instantclient

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 # -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
ARG REGISTRY=pubdocker.univ-reunion.fr/dist ARG REGISTRY=pubdocker.univ-reunion.fr
FROM $REGISTRY/src/base AS base FROM $REGISTRY/src/base AS base
FROM $REGISTRY/src/mariadb AS mariadb FROM $REGISTRY/src/mariadb AS mariadb
FROM $REGISTRY/src/legacytools AS legacytools FROM $REGISTRY/src/legacytools AS legacytools

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 # -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
ARG NDIST=12 ARG NDIST=12
ARG REGISTRY=pubdocker.univ-reunion.fr/dist ARG REGISTRY=pubdocker.univ-reunion.fr
FROM $REGISTRY/src/base AS base FROM $REGISTRY/src/base AS base
FROM $REGISTRY/src/php AS php FROM $REGISTRY/src/php AS php

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 # -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
ARG NDIST=12 ARG NDIST=12
ARG REGISTRY=pubdocker.univ-reunion.fr/dist ARG REGISTRY=pubdocker.univ-reunion.fr
FROM $REGISTRY/src/base AS base FROM $REGISTRY/src/base AS base
FROM $REGISTRY/src/legacytools AS legacytools FROM $REGISTRY/src/legacytools AS legacytools

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 # -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
ARG NDIST=12 ARG NDIST=12
ARG REGISTRY=pubdocker.univ-reunion.fr/dist ARG REGISTRY=pubdocker.univ-reunion.fr
FROM $REGISTRY/src/base AS base FROM $REGISTRY/src/base AS base
FROM $REGISTRY/src/php AS php FROM $REGISTRY/src/php AS php

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 # -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
ARG NDIST=12 ARG NDIST=12
ARG REGISTRY=pubdocker.univ-reunion.fr/dist ARG REGISTRY=pubdocker.univ-reunion.fr
FROM $REGISTRY/src/base AS base FROM $REGISTRY/src/base AS base
FROM $REGISTRY/src/legacytools AS legacytools FROM $REGISTRY/src/legacytools AS legacytools

View File

@ -1,6 +1,5 @@
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 # -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
ARG REGISTRY=pubdocker.univ-reunion.fr/dist ARG REGISTRY=pubdocker.univ-reunion.fr
FROM $REGISTRY/src/base AS base FROM $REGISTRY/src/base AS base
FROM $REGISTRY/src/postgres AS postgres FROM $REGISTRY/src/postgres AS postgres

View File

@ -222,13 +222,4 @@ class cv {
if ($a > $b) return 1; if ($a > $b) return 1;
return 0; return 0;
} }
/** comparer la longueur de $a et $b */
static final function complen($a, $b): int {
if (is_array($a)) $la = count($a);
else $la = strlen(strval($a));
if (is_array($b)) $lb = count($b);
else $lb = strlen(strval($b));
return self::compare($la, $lb);
}
} }

View File

@ -309,32 +309,8 @@ class Stream extends AbstractIterator implements IReader, IWriter {
} }
} }
/** @var bool faut-il faire un mapping pour la compatibilité avec nur/sery */
const NURSERY_COMPAT_ENABLED = true;
/**
* @var string[] mappings pour la compatibilité avec des fichiers générés par
* nur/sery
*/
const NURSERY_COMPAT_MAPPING = [
'O:22:"nur\sery\php\time\Date":' => 'O:19:"nulib\php\time\Date":',
'O:26:"nur\sery\php\time\DateTime":' => 'O:23:"nulib\php\time\DateTime":',
'O:23:"nur\sery\php\time\Delay":' => 'O:20:"nulib\php\time\Delay":',
];
static function nursery_compat_verifix(string $contents): string {
if (static::NURSERY_COMPAT_ENABLED) {
foreach (self::NURSERY_COMPAT_MAPPING as $from => $to) {
$contents = str_replace($from, $to, $contents);
}
}
return $contents;
}
function unserialize(?array $options=null, bool $close=true, bool $alreadyLocked=false) { function unserialize(?array $options=null, bool $close=true, bool $alreadyLocked=false) {
$contents = $this->getContents($close, $alreadyLocked); $args = [$this->getContents($close, $alreadyLocked)];
$contents = self::nursery_compat_verifix($contents);
$args = [$contents];
if ($options !== null) $args[] = $options; if ($options !== null) $args[] = $options;
return unserialize(...$args); return unserialize(...$args);
} }

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 # -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
ARG NDIST=12 ARG NDIST=12
ARG REGISTRY=pubdocker.univ-reunion.fr/dist ARG REGISTRY=pubdocker.univ-reunion.fr
FROM $REGISTRY/src/base AS base FROM $REGISTRY/src/base AS base
FROM $REGISTRY/src/php AS php FROM $REGISTRY/src/php AS php

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 # -*- coding: utf-8 mode: dockerfile -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
ARG NDIST=12 ARG NDIST=12
ARG REGISTRY=pubdocker.univ-reunion.fr/dist ARG REGISTRY=pubdocker.univ-reunion.fr
FROM $REGISTRY/src/base AS base FROM $REGISTRY/src/base AS base
FROM $REGISTRY/src/legacytools AS legacytools FROM $REGISTRY/src/legacytools AS legacytools

View File

@ -2,7 +2,7 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 # -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
MYDIR="$(cd "$(dirname -- "$0")"; pwd)" MYDIR="$(cd "$(dirname -- "$0")"; pwd)"
RUNPHP="$MYDIR/runphp" RUNPHP="$MYDIR/runphp"
"$RUNPHP" --bs --ue || exit 1 "$RUNPHP" --bs --ue --ci || exit 1
RUNPHP_STANDALONE= RUNPHP_STANDALONE=
PROJDIR=; COMPOSERDIR=; COMPOSERPHAR=; VENDORDIR=; BUILDENV0=; BUILDENV= PROJDIR=; COMPOSERDIR=; COMPOSERPHAR=; VENDORDIR=; BUILDENV0=; BUILDENV=
BUILD_IMAGES=(php-apache mariadb10); export BUILD_FLAVOUR=; DIST=; IMAGENAME= BUILD_IMAGES=(php-apache mariadb10); export BUILD_FLAVOUR=; DIST=; IMAGENAME=

View File

@ -14,8 +14,8 @@ PRIVAREG=
################################################################################ ################################################################################
# Ne pas toucher à partir d'ici # Ne pas toucher à partir d'ici
REGISTRY=pubdocker.univ-reunion.fr/dist REGISTRY=pubdocker.univ-reunion.fr
DIST=d12 DIST=d12
IMAGENAME=nulib/ IMAGENAME=runphp
#DEVUSER_USERENT=user:x:1000:1000:User,,,:/home/user:/bin/bash #DEVUSER_USERENT=user:x:1000:1000:User,,,:/home/user:/bin/bash
#DEVUSER_GROUPENT=user:x:1000: #DEVUSER_GROUPENT=user:x:1000:

View File

@ -1,4 +1,5 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 # -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
default_profile "${DKBUILD_PROFILE:-prod}"
# Source des paquets et proxy # Source des paquets et proxy
setenv APT_PROXY= setenv APT_PROXY=
@ -8,5 +9,20 @@ setenv SEC_MIRROR=default
# Timezone du serveur # Timezone du serveur
setenv TIMEZONE=Europe/Paris setenv TIMEZONE=Europe/Paris
setenv REGISTRY=pubdocker.univ-reunion.fr/dist if profile prod test; then
setenv PRIVAREG= setenv REGISTRY=pubdocker.univ-reunion.fr
setenv PRIVAREG=pridocker.univ-reunion.fr
host_mappings=(
pridocker.univ-reunion.fr:10.85.1.56
pubdocker.univ-reunion.fr:10.85.1.57
repos.univ-reunion.fr:10.85.1.57
git.univ-reunion.fr:10.85.1.55
)
default docker host-mappings="${host_mappings[*]}"
elif profile devel; then
setenv REGISTRY=docker.devel.self
setenv PRIVAREG=docker.devel.self
else
setenv REGISTRY=pubdocker.univ-reunion.fr
setenv PRIVAREG=
fi

View File

@ -5,4 +5,4 @@ RUNPHP=
# Si RUNPHP n'est pas défini, les variables suivantes peuvent être définies # Si RUNPHP n'est pas défini, les variables suivantes peuvent être définies
#DIST=d12 #DIST=d12
#REGISTRY=pubdocker.univ-reunion.fr/dist #REGISTRY=pubdocker.univ-reunion.fr

View File

@ -33,7 +33,7 @@ BUILDENV0=
BUILDENV= BUILDENV=
# Listes des images que le script build construit automatiquement # Listes des images que le script build construit automatiquement
BUILD_IMAGES=(php-apache mariadb10) BUILD_IMAGES=()
BUILD_FLAVOUR= BUILD_FLAVOUR=
## En ce qui concerne DIST et IMAGENAME, les valeurs dans BUILDENV prennent le ## En ce qui concerne DIST et IMAGENAME, les valeurs dans BUILDENV prennent le
@ -117,12 +117,9 @@ function eerror() { eecho "ERROR: $*"; }
function die() { [ $# -gt 0 ] && eerror "$*"; exit 1; } function die() { [ $# -gt 0 ] && eerror "$*"; exit 1; }
function is_defined() { [ -n "$(declare -p "$1" 2>/dev/null)" ]; } function is_defined() { [ -n "$(declare -p "$1" 2>/dev/null)" ]; }
function in_path() { [ -n "$1" -a -x "$(which "$1" 2>/dev/null)" ]; } function in_path() { [ -n "$1" -a -x "$(which "$1" 2>/dev/null)" ]; }
function composer() { function composer() {
if [ -n "$PROJDIR" -a -n "$COMPOSERDIR" ]; then
cd "$PROJDIR/$COMPOSERDIR" || exit 1 cd "$PROJDIR/$COMPOSERDIR" || exit 1
fi if [ -n "$COMPOSERPHAR" -a -x "$PROJDIR/$COMPOSERPHAR" ]; then
if [ -n "$PROJDIR" -a -n "$COMPOSERPHAR" -a -x "$PROJDIR/$COMPOSERPHAR" ]; then
"$PROJDIR/$COMPOSERPHAR" "$@" "$PROJDIR/$COMPOSERPHAR" "$@"
elif in_path composer; then elif in_path composer; then
command composer "$@" command composer "$@"
@ -133,40 +130,11 @@ function composer() {
else else
die "impossible de trouver composer" die "impossible de trouver composer"
fi fi
if [ -n "$PROJDIR" -a -z "$RUNPHP_STANDALONE" -a -f composer.lock ]; then if [ -z "$RUNPHP_STANDALONE" -a -f composer.lock ]; then
cp composer.lock "$PROJDIR/.composer.lock.runphp" cp composer.lock "$PROJDIR/.composer.lock.runphp"
fi fi
} }
function ensure_image() {
function host_parse_args() {
# analyser les arguments et calculer les opérations à lancer: bootstrap,
# composer install et/ou commande
# faut-il lancer bootstrap?
Bootstrap=auto
# faut-il installer les dépendances?
Composer=
# commande à lancer
Cmd=()
if [ "$1" == --runphp-bootstrap -o "$1" == --bs ]; then
Bootstrap=1
shift
elif [ "$1" == --runphp-exec ]; then
Bootstrap=
shift
elif [ "$1" == --runphp-install -o "$1" == --ci ]; then
Composer=ci
shift
elif [ "$1" == --runphp-update -o "$1" == --cu ]; then
Composer=cu
shift
fi
Cmd=("$@")
}
function host_ensure_image() {
# calculer le nom de l'image runphp
local dfdir suffix dockerfiles dockerfile local dfdir suffix dockerfiles dockerfile
local privareg imagename local privareg imagename
if [ -z "$Image" ]; then if [ -z "$Image" ]; then
@ -193,9 +161,7 @@ function host_ensure_image() {
Image="$privareg/$imagename$suffix:$DIST" Image="$privareg/$imagename$suffix:$DIST"
fi fi
} }
function check_image() {
function host_check_image() {
# vérifier que l'image runphp existe
local image="$Image" local image="$Image"
for prefix in docker.io/library/ docker.io; do for prefix in docker.io/library/ docker.io; do
if [ "${image#$prefix}" != "$image" ]; then if [ "${image#$prefix}" != "$image" ]; then
@ -206,25 +172,43 @@ function host_check_image() {
[ -n "$(docker image ls --no-trunc --format '{{.Repository}}:{{.Tag}}' "$image" 2>/dev/null)" ] [ -n "$(docker image ls --no-trunc --format '{{.Repository}}:{{.Tag}}' "$image" 2>/dev/null)" ]
} }
function host_check_projdir() { ## Arguments initiaux
# vérifier le projet pour voir s'il faut installer les dépendances
[ -n "$RUNPHP_STANDALONE" ] && return
local install Bootstrap=
ComposerInstall=
if [ "$1" == --runphp-bootstrap -o "$1" == --bs ]; then
Bootstrap=1
shift
elif [ "$1" == --runphp-exec ]; then
Bootstrap=
shift
elif [ "$1" == --runphp-install -o "$1" == --ci ]; then
ComposerInstall=1
shift
fi
ForcedBootstrap=
if [ -z "$Bootstrap" -a -z "$RUNPHP_STANDALONE" ]; then
# si vendor/ n'existe pas, alors on doit faire bootstrap
if [ ! -f "$PROJDIR/$VENDORDIR/nulib/php/load.sh" ]; then if [ ! -f "$PROJDIR/$VENDORDIR/nulib/php/load.sh" ]; then
install=1 ForcedBootstrap=1
elif [ ! -f "$PROJDIR/.composer.lock.runphp" ]; then elif [ ! -f "$PROJDIR/.composer.lock.runphp" ]; then
install=1 ForcedBootstrap=1
elif ! diff -q "$PROJDIR/$COMPOSERDIR/composer.lock" "$PROJDIR/.composer.lock.runphp" >&/dev/null; then elif ! diff -q "$PROJDIR/$COMPOSERDIR/composer.lock" "$PROJDIR/.composer.lock.runphp" >&/dev/null; then
install=1 ForcedBootstrap=1
fi fi
if [ -n "$install" ]; then if [ -n "$ForcedBootstrap" ]; then
eecho "== bootstrapping runphp" [ "$RUNPHP_MODE" != docker ] && eecho "== bootstrapping runphp"
[ -n "$Composer" ] || Composer=ci Bootstrap=1
ComposerInstall=1
fi fi
} fi
if [ "$RUNPHP_MODE" != docker ]; then
############################################################################
# Lancement depuis l'extérieur du container
############################################################################
function host_init_env() {
## Charger ~/.dkbuild.env ## Charger ~/.dkbuild.env
APT_PROXY= APT_PROXY=
@ -275,7 +259,7 @@ function host_init_env() {
[ -n "$SEC_MIRROR" ] || SEC_MIRROR=default [ -n "$SEC_MIRROR" ] || SEC_MIRROR=default
[ -n "$TIMEZONE" ] || TIMEZONE=Europe/Paris [ -n "$TIMEZONE" ] || TIMEZONE=Europe/Paris
[ -n "$PRIVAREG" ] || PRIVAREG= [ -n "$PRIVAREG" ] || PRIVAREG=
[ -n "$REGISTRY" ] || REGISTRY=pubdocker.univ-reunion.fr/dist [ -n "$REGISTRY" ] || REGISTRY=pubdocker.univ-reunion.fr
## Charger la configuration ## Charger la configuration
@ -297,26 +281,32 @@ function host_init_env() {
UseRslave=1 UseRslave=1
fi fi
# Toujours vérifier l'existence de l'image
Image= Image=
if [ -z "$Bootstrap" ]; then
if [ -n "$RUNPHP_FORCE_BUILDENVS" ]; then if [ -n "$RUNPHP_FORCE_BUILDENVS" ]; then
eval "Configs=($RUNPHP_FORCE_BUILDENVS)" eval "Configs=($RUNPHP_FORCE_BUILDENVS)"
elif [ -n "$BUILDENV" -a -f "$PROJDIR/$BUILDENV" ]; then
Configs=("$PROJDIR/$BUILDENV")
elif [ -n "$BUILDENV0" -a -f "$PROJDIR/$BUILDENV0" ]; then
Configs=("$PROJDIR/$BUILDENV0")
else
Configs=()
fi
for config in "${Configs[@]}"; do for config in "${Configs[@]}"; do
source "$config" || exit 1 source "$config" || exit 1
done done
after_source_buildenv after_source_buildenv
elif [ -n "$BUILDENV" -a -f "$PROJDIR/$BUILDENV" ]; then
source "$PROJDIR/$BUILDENV" || exit 1
after_source_buildenv
elif [ -n "$BUILDENV0" -a -f "$PROJDIR/$BUILDENV0" ]; then
source "$PROJDIR/$BUILDENV0" || exit 1
after_source_buildenv
fi
ensure_image
check_image || Bootstrap=1
fi
Chdir= Chdir=
Verbose="$RUNPHP_VERBOSE" Verbose="$RUNPHP_VERBOSE"
} if [ -n "$Bootstrap" ]; then
## Mode bootstrap de l'image ###########################################
# Ici, on a déterminé que l'image doit être construite
function host_docker_build() {
BUILD_ARGS=( BUILD_ARGS=(
DIST NDIST DIST NDIST
REGISTRY REGISTRY
@ -331,6 +321,15 @@ function host_docker_build() {
args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args" args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args"
Dist= Dist=
if [ -n "$RUNPHP_FORCE_BUILDENVS" ]; then
eval "Configs=($RUNPHP_FORCE_BUILDENVS)"
elif [ -n "$BUILDENV" -a -f "$PROJDIR/$BUILDENV" ]; then
Configs=("$PROJDIR/$BUILDENV")
elif [ -n "$BUILDENV0" -a -f "$PROJDIR/$BUILDENV0" ]; then
Configs=("$PROJDIR/$BUILDENV0")
else
Configs=()
fi
UnlessExists= UnlessExists=
Pull= Pull=
NoCache= NoCache=
@ -343,31 +342,25 @@ function host_docker_build() {
runphp: construire l'image docker runphp: construire l'image docker
USAGE USAGE
$MYNAME --bs [options...] $MYNAME --bootstrap [options...]
OPTIONS OPTIONS
-c, --config build.env -c, --config build.env
-d, --dist DIST --unless-exists
--ue, --unless-exists
-U, --pull -U, --pull
-j, --nc, --no-cache -j, --no-cache
-D, --po, --plain-output -D, --plain-output
-x, --apt-proxy APT_PROXY -x, --apt-proxy APT_PROXY
-z, --timezone TIMEZONE -z, --timezone TIMEZONE
-r, --privareg PRIVAREG -r, --privareg PRIVAREG
-p, --push -p, --push
paramètres pour la consruction de l'image paramètres pour la consruction de l'image"
--ci
--cu
lancer composer install (resp. update) après bootstrap
--no-use-rslave
paramètre montage des volumes"
exit 0 exit 0
;; ;;
-c|--config) shift; Configs+=("$1");;
-d|--dist) shift; Dist="$1";; -d|--dist) shift; Dist="$1";;
-[0-9]) Dist="d1${1#-}";; -[0-9]) Dist="d1${1#-}";;
--d*) Dist="${1#--}";; --d*) Dist="${1#--}";;
-c|--config) shift; Configs+="$1";;
--ue|--unless-exists) UnlessExists=1;; --ue|--unless-exists) UnlessExists=1;;
-U|--pull) Pull=1;; -U|--pull) Pull=1;;
-j|--nc|--no-cache) NoCache=1;; -j|--nc|--no-cache) NoCache=1;;
@ -376,14 +369,12 @@ OPTIONS
-z|--timezone) shift; TIMEZONE="$1";; -z|--timezone) shift; TIMEZONE="$1";;
-r|--privareg) shift; PRIVAREG="$1";; -r|--privareg) shift; PRIVAREG="$1";;
-p|--push) Push=1;; -p|--push) Push=1;;
--ci) Composer=ci;; --ci) ComposerInstall=1;;
--cu) Composer=cu;;
--no-use-rslave) UseRslave=;; --no-use-rslave) UseRslave=;;
*) die "$1: option non configurée";; *) die "$1: option non configurée";;
esac esac
shift shift
done done
Cmd=("$@")
for config in "${Configs[@]}"; do for config in "${Configs[@]}"; do
if [ "$config" == none ]; then if [ "$config" == none ]; then
@ -399,10 +390,8 @@ OPTIONS
fi fi
[ -n "$Dist" ] && DIST="$Dist" [ -n "$Dist" ] && DIST="$Dist"
Image= ensure_image
host_ensure_image check_image && exists=1 || exists=
host_check_image && exists=1 || exists=
if [ -z "$UnlessExists" -o -z "$exists" ]; then if [ -z "$UnlessExists" -o -z "$exists" ]; then
eecho "== Building $Image" eecho "== Building $Image"
args=( args=(
@ -429,10 +418,16 @@ OPTIONS
docker push "$Image" || exit 1 docker push "$Image" || exit 1
fi fi
fi fi
} if [ -z "$RUNPHP_STANDALONE" -a ! -f "$PROJDIR/$VENDORDIR/nulib/php/load.sh" ]; then
# Forcer l'installation des dépendances si nécessaire
ComposerInstall=1
fi
[ -z "$ComposerInstall" -o -n "$UnlessExists" ] && exit 0
else
## Mode exécution de commande ##########################################
# Ici, on a déterminé qu'il faut lancer une commande
function host_docker_run() {
# lancer une commande avec docker
SOPTS=+w: SOPTS=+w:
LOPTS=help,chdir:,no-use-rslave LOPTS=help,chdir:,no-use-rslave
args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args" args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args"
@ -460,9 +455,7 @@ courant est forcé au répertoire du projet composer
OPTIONS OPTIONS
-w, --chdir CHDIR -w, --chdir CHDIR
aller dans le répertoire spécifié avant de lancer la commande aller dans le répertoire spécifié avant de lancer la commande"
--no-use-rslave
paramètre montage des volumes"
exit 0 exit 0
;; ;;
-w|--chdir) shift; Chdir="$1";; -w|--chdir) shift; Chdir="$1";;
@ -472,6 +465,14 @@ OPTIONS
shift shift
done done
if [ -z "$RUNPHP_STANDALONE" -a ! -f "$PROJDIR/$VENDORDIR/nulib/php/load.sh" ]; then
# Forcer l'installation des dépendances si nécessaire
ComposerInstall=1
fi
fi
## Lancer la commande
args=( args=(
run -it --rm run -it --rm
--name "runphp-$(basename -- "$1")-$$" --name "runphp-$(basename -- "$1")-$$"
@ -499,7 +500,7 @@ OPTIONS
[ -n "$RUNPHP_STANDALONE" ] && [ -n "$RUNPHP_STANDALONE" ] &&
[ "${RUNPHP_STANDALONE#$HOME/}" != "$RUNPHP_STANDALONE" ] && [ "${RUNPHP_STANDALONE#$HOME/}" != "$RUNPHP_STANDALONE" ] &&
mount_runphp= mount_runphp=
elif [ -n "$PROJDIR" ]; then else
# bind mount uniquement le répertoire du projet # bind mount uniquement le répertoire du projet
args+=(-v "$PROJDIR:$PROJDIR${UseRslave:+:rslave}") args+=(-v "$PROJDIR:$PROJDIR${UseRslave:+:rslave}")
mount_composer=1 mount_composer=1
@ -528,13 +529,15 @@ OPTIONS
"$Image" "$Image"
exec "$0" ${Chdir:+-w "$Chdir"} exec "$0" ${Chdir:+-w "$Chdir"}
) )
[ -n "$ComposerInstall" ] && set -- ci
[ -n "$Verbose" ] && eecho "\$ docker ${args[*]} $*" [ -n "$Verbose" ] && eecho "\$ docker ${args[*]} $*"
docker "${args[@]}" "$@" exec docker "${args[@]}" "$@"
}
else
############################################################################
# Lancement depuis l'intérieur du container
############################################################################
function container_exec() {
# lancer la commande $@. cette fonction doit être lancée dans le container
# docker
if [ -n "$DEVUSER_USERENT" ]; then if [ -n "$DEVUSER_USERENT" ]; then
user="${DEVUSER_USERENT%%:*}" user="${DEVUSER_USERENT%%:*}"
export DEVUSER_USERENT= export DEVUSER_USERENT=
@ -561,16 +564,14 @@ function container_exec() {
shift shift
done done
if [ $# -eq 0 ]; then if [ -z "$1" ]; then
die "no command specified" die "no command specified"
elif [ "$1" == ci ]; then elif [ "$1" == ci ]; then
eecho "== installing composer dependencies" eecho "== installing composer dependencies"
shift composer i
composer i "$@"
elif [ "$1" == cu ]; then elif [ "$1" == cu ]; then
eecho "== upgrading composer dependencies" eecho "== upgrading composer dependencies"
shift composer u
composer u "$@"
elif [ "$1" == composer ]; then elif [ "$1" == composer ]; then
"$@" "$@"
else else
@ -579,38 +580,4 @@ function container_exec() {
fi fi
exec "$@" exec "$@"
fi fi
}
################################################################################
if [ "$RUNPHP_MODE" != docker ]; then
# Lancement depuis l'extérieur du container
host_parse_args "$@"
host_init_env
Image=
if [ "$Bootstrap" == auto ]; then
host_ensure_image
host_check_image && Bootstrap= || Bootstrap=1
fi
if [ -n "$Bootstrap" ]; then
host_docker_build "${Cmd[@]}" || exit $?
else
host_ensure_image
fi
host_check_projdir
if [ -n "$Composer" ]; then
host_docker_run "$Composer" || exit $?
fi
if [ ${#Cmd[*]} -gt 0 ]; then
host_docker_run "${Cmd[@]}" || exit $?
fi
else
# Lancement depuis l'intérieur du container
container_exec "$@"
fi fi
exit 0

18
runphp/runphp.1preamble Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
# Script permettant de lancer une commande dans docker et/ou de bootstrapper
# l'utilisation de nulib dans un projet PHP
# Les fichiers suivants doivent être copiés à un endroit quelconque du projet:
# - runphp (ce script, à générer avec update-runphp.sh)
# - Dockerfile.runphp
# Les fichiers suivants peuvent être intégrés dans le projet comme exemples:
# - dot-build.env.dist (à renommer en .build.env.dist)
# - dot-dkbuild.env.dist (indiquer qu'il faut le copier en ~/.dkbuild.env)
# Par défaut, ce script assume que runphp est copié dans le répertoire sbin/
# du projet, et que le fichier composer.json et le répertoire vendor/ sont à la
# racine du projet. Le cas échéant, modifier les valeurs ci-dessous
(return 0 2>/dev/null) && _sourced=1 || _sourced=
###############################################################################
# Modifier les valeurs suivantes si nécessaire
#SOF:runphp.userconf:ne pas modifier cette ligne

534
runphp/runphp.2postamble Normal file
View File

@ -0,0 +1,534 @@
#EOF:runphp.userconf:ne pas modifier cette ligne
################################################################################
# Ne pas modifier à partir d'ici
if [ -n "$_sourced" ]; then
if [ "${0#-}" != "$0" ]; then
# sourcé depuis la ligne de commande
MYSELF="${BASH_SOURCE[1]}"
else
# sourcé depuis un script
MYSELF="${BASH_SOURCE[0]}"
fi
MYDIR="$(cd "$(dirname -- "$MYSELF")"; pwd)"
MYNAME="$(basename -- "$MYSELF")"
else
MYDIR="$(cd "$(dirname -- "$0")"; pwd)"
MYNAME="$(basename -- "$0")"
fi
if [ -f "$MYDIR/runphp.userconf.local" ]; then
source "$MYDIR/runphp.userconf.local"
fi
DEFAULT_DIST=d12
if [ -n "$RUNPHP_STANDALONE" ]; then
PROJDIR="$RUNPHP_PROJDIR"
COMPOSERDIR=.
COMPOSERPHAR=
VENDORDIR=vendor
BUILDENV0=
BUILDENV=
DIST="${RUNPHP_DIST:-$DEFAULT_DIST}"
IMAGENAME=nulib/
PRIVAREG=docker.io
REGISTRY="$RUNPHP_REGISTRY"
[ -n "$RUNPHP_BUILD_FLAVOUR" ] && BUILD_FLAVOUR="$RUNPHP_BUILD_FLAVOUR"
else
[ -n "$PROJDIR" ] || PROJDIR="$(dirname -- "$MYDIR")"
[ "${PROJDIR#/}" != "$PROJDIR" ] || PROJDIR="$(cd "$MYDIR/$PROJDIR"; pwd)"
[ -n "$COMPOSERDIR" ] || COMPOSERDIR=.
[ -n "$COMPOSERPHAR" ] || COMPOSERPHAR=sbin/composer.phar
[ -n "$VENDORDIR" ] || VENDORDIR=vendor
[ -n "$BUILDENV0" ] || BUILDENV0=.build.env.dist
[ -n "$BUILDENV" ] || BUILDENV=build.env
[ -n "$DIST" ] || DIST="$DEFAULT_DIST"
[ -n "$IMAGENAME" ] || IMAGENAME=nulib/
[ "$COMPOSERPHAR" == none ] && COMPOSERPHAR=
[ "$BUILDENV0" == none ] && BUILDENV0=
[ "$BUILDENV" == none ] && BUILDENV=
fi
[ "$BUILD_FLAVOUR" == none ] && BUILD_FLAVOUR=
function after_source_buildenv() {
NDIST="${DIST#d}"
}
after_source_buildenv
[ -n "$_sourced" ] && return 0
function eecho() { echo "$*" 1>&2; }
function eerror() { eecho "ERROR: $*"; }
function die() { [ $# -gt 0 ] && eerror "$*"; exit 1; }
function is_defined() { [ -n "$(declare -p "$1" 2>/dev/null)" ]; }
function in_path() { [ -n "$1" -a -x "$(which "$1" 2>/dev/null)" ]; }
function composer() {
cd "$PROJDIR/$COMPOSERDIR" || exit 1
if [ -n "$COMPOSERPHAR" -a -x "$PROJDIR/$COMPOSERPHAR" ]; then
"$PROJDIR/$COMPOSERPHAR" "$@"
elif in_path composer; then
command composer "$@"
elif [ -x /usr/bin/composer ]; then
/usr/bin/composer "$@"
elif [ -x /usr/local/bin/composer ]; then
/usr/local/bin/composer "$@"
else
die "impossible de trouver composer"
fi
if [ -z "$RUNPHP_STANDALONE" -a -f composer.lock ]; then
cp composer.lock "$PROJDIR/.composer.lock.runphp"
fi
}
function ensure_image() {
local dfdir suffix dockerfiles dockerfile
local privareg imagename
if [ -z "$Image" ]; then
[ -n "$RUNPHP_STANDALONE" ] && dfdir="$RUNPHP_STANDALONE/runphp" || dfdir="$MYDIR"
dockerfiles=(
"_local:$dfdir/Dockerfile.runphp.local"
"${BUILD_FLAVOUR//+/_}:$dfdir/Dockerfile.runphp$BUILD_FLAVOUR"
":$dfdir/Dockerfile.runphp"
)
for dockerfile in "${dockerfiles[@]}"; do
suffix="${dockerfile%:*}"
dockerfile="${dockerfile##*:}"
[ -f "$dockerfile" ] && break
done
Dockerfile="$dockerfile"
[[ "$IMAGENAME" == */ ]] && imagename=runphp || imagename="${IMAGENAME%/*}/runphp"
privareg="$PRIVAREG"
if [ "$imagename" == runphp ]; then
[ -z "$privareg" -o "$privareg" == docker.io ] && privareg=docker.io/library
else
[ -z "$privareg" ] && privareg=docker.io
fi
Image="$privareg/$imagename$suffix:$DIST"
fi
}
function check_image() {
local image="$Image"
for prefix in docker.io/library/ docker.io; do
if [ "${image#$prefix}" != "$image" ]; then
image="${image#$prefix}"
break
fi
done
[ -n "$(docker image ls --no-trunc --format '{{.Repository}}:{{.Tag}}' "$image" 2>/dev/null)" ]
}
## Arguments initiaux
Bootstrap=
ComposerInstall=
if [ "$1" == --runphp-bootstrap -o "$1" == --bs ]; then
Bootstrap=1
shift
elif [ "$1" == --runphp-exec ]; then
Bootstrap=
shift
elif [ "$1" == --runphp-install -o "$1" == --ci ]; then
ComposerInstall=1
shift
fi
ForcedBootstrap=
if [ -z "$Bootstrap" -a -z "$RUNPHP_STANDALONE" ]; then
# si vendor/ n'existe pas, alors on doit faire bootstrap
if [ ! -f "$PROJDIR/$VENDORDIR/nulib/php/load.sh" ]; then
ForcedBootstrap=1
elif [ ! -f "$PROJDIR/.composer.lock.runphp" ]; then
ForcedBootstrap=1
elif ! diff -q "$PROJDIR/$COMPOSERDIR/composer.lock" "$PROJDIR/.composer.lock.runphp" >&/dev/null; then
ForcedBootstrap=1
fi
if [ -n "$ForcedBootstrap" ]; then
[ "$RUNPHP_MODE" != docker ] && eecho "== bootstrapping runphp"
Bootstrap=1
ComposerInstall=1
fi
fi
if [ "$RUNPHP_MODE" != docker ]; then
############################################################################
# Lancement depuis l'extérieur du container
############################################################################
## Charger ~/.dkbuild.env
APT_PROXY=
APT_MIRROR=
SEC_MIRROR=
TIMEZONE=
PRIVAREG=
REGISTRY=
PROFILE=
HOST_MAPPINGS=()
function default_profile() {
PROFILE="$1"
}
function profile() {
local profile
for profile in "$@"; do
[ "$profile" == "$PROFILE" ] && return 0
done
return 1
}
function setenv() {
eval "export $1"
}
function default() {
local command="$1"; shift
local nv n v
case "$command" in
docker)
for nv in "$@"; do
[[ "$nv" == *=* ]] || continue
n="${nv%%=*}"
v="${nv#*=}"
case "$n" in
host-mappings)
read -a ns <<<"$v"
for v in "${ns[@]}"; do
HOST_MAPPINGS+=("$v")
done
;;
esac
done
;;
esac
}
[ -f ~/.dkbuild.env ] && source ~/.dkbuild.env
[ -n "$APT_PROXY" ] || APT_PROXY=
[ -n "$APT_MIRROR" ] || APT_MIRROR=default
[ -n "$SEC_MIRROR" ] || SEC_MIRROR=default
[ -n "$TIMEZONE" ] || TIMEZONE=Europe/Paris
[ -n "$PRIVAREG" ] || PRIVAREG=
[ -n "$REGISTRY" ] || REGISTRY=pubdocker.univ-reunion.fr
## Charger la configuration
# Recenser les valeur de proxy
declare -A PROXY_VARS
for var in {HTTPS,ALL,NO}_PROXY {http,https,all,no}_proxy; do
is_defined "$var" && PROXY_VARS[${var,,}]="${!var}"
done
# Paramètres de montage
if [ -n "$RUNPHP_NO_USE_RSLAVE" ]; then
UseRslave=
elif [ -n "$RUNPHP_USE_RSLAVE" ]; then
UseRslave=1
elif [ -e /proc/sys/fs/binfmt_misc/WSLInterop ]; then
# pas de mount propagation sous WSL
UseRslave=
else
UseRslave=1
fi
# Toujours vérifier l'existence de l'image
Image=
if [ -z "$Bootstrap" ]; then
if [ -n "$RUNPHP_FORCE_BUILDENVS" ]; then
eval "Configs=($RUNPHP_FORCE_BUILDENVS)"
for config in "${Configs[@]}"; do
source "$config" || exit 1
done
after_source_buildenv
elif [ -n "$BUILDENV" -a -f "$PROJDIR/$BUILDENV" ]; then
source "$PROJDIR/$BUILDENV" || exit 1
after_source_buildenv
elif [ -n "$BUILDENV0" -a -f "$PROJDIR/$BUILDENV0" ]; then
source "$PROJDIR/$BUILDENV0" || exit 1
after_source_buildenv
fi
ensure_image
check_image || Bootstrap=1
fi
Chdir=
Verbose="$RUNPHP_VERBOSE"
if [ -n "$Bootstrap" ]; then
## Mode bootstrap de l'image ###########################################
# Ici, on a déterminé que l'image doit être construite
BUILD_ARGS=(
DIST NDIST
REGISTRY
APT_PROXY
APT_MIRROR
SEC_MIRROR
TIMEZONE
)
SOPTS=+d:9876543210:c:UjDx:z:r:p
LOPTS=help,dist:,d19,d18,d17,d16,d15,d14,d13,d12,d11,d10,config:,ue,unless-exists,pull,nc,no-cache,po,plain-output,apt-proxy:,timezone:,privareg:,push,ci,no-use-rslave
args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args"
Dist=
if [ -n "$RUNPHP_FORCE_BUILDENVS" ]; then
eval "Configs=($RUNPHP_FORCE_BUILDENVS)"
elif [ -n "$BUILDENV" -a -f "$PROJDIR/$BUILDENV" ]; then
Configs=("$PROJDIR/$BUILDENV")
elif [ -n "$BUILDENV0" -a -f "$PROJDIR/$BUILDENV0" ]; then
Configs=("$PROJDIR/$BUILDENV0")
else
Configs=()
fi
UnlessExists=
Pull=
NoCache=
PlainOutput=
while [ $# -gt 0 ]; do
case "$1" in
--) shift; break;;
--help)
eecho "\
runphp: construire l'image docker
USAGE
$MYNAME --bootstrap [options...]
OPTIONS
-c, --config build.env
--unless-exists
-U, --pull
-j, --no-cache
-D, --plain-output
-x, --apt-proxy APT_PROXY
-z, --timezone TIMEZONE
-r, --privareg PRIVAREG
-p, --push
paramètres pour la consruction de l'image"
exit 0
;;
-d|--dist) shift; Dist="$1";;
-[0-9]) Dist="d1${1#-}";;
--d*) Dist="${1#--}";;
-c|--config) shift; Configs+="$1";;
--ue|--unless-exists) UnlessExists=1;;
-U|--pull) Pull=1;;
-j|--nc|--no-cache) NoCache=1;;
-D|--po|--plain-output) PlainOutput=1;;
-x|--apt-proxy) shift; APT_PROXY="$1";;
-z|--timezone) shift; TIMEZONE="$1";;
-r|--privareg) shift; PRIVAREG="$1";;
-p|--push) Push=1;;
--ci) ComposerInstall=1;;
--no-use-rslave) UseRslave=;;
*) die "$1: option non configurée";;
esac
shift
done
for config in "${Configs[@]}"; do
if [ "$config" == none ]; then
Configs=()
break
fi
done
if [ ${#Configs[*]} -gt 0 ]; then
for config in "${Configs[@]}"; do
source "$config" || exit 1
done
after_source_buildenv
fi
[ -n "$Dist" ] && DIST="$Dist"
ensure_image
check_image && exists=1 || exists=
if [ -z "$UnlessExists" -o -z "$exists" ]; then
eecho "== Building $Image"
args=(
-f "$Dockerfile"
${Pull:+--pull}
${NoCache:+--no-cache}
${BuildPlain:+--progress plain}
-t "$Image"
)
for arg in "${BUILD_ARGS[@]}"; do
args+=(--build-arg "$arg=${!arg}")
done
for arg in "${!PROXY_VARS[@]}"; do
args+=(--build-arg "$arg=${PROXY_VARS[$arg]}")
done
for host in "${HOST_MAPPINGS[@]}"; do
args+=(--add-host "$host")
done
mkdir -p /tmp/runphp-build
docker build "${args[@]}" /tmp/runphp-build || exit 1
if [ -n "$Push" -a -n "$PRIVAREG" ]; then
eecho "== Pushing $Image"
docker push "$Image" || exit 1
fi
fi
if [ -z "$RUNPHP_STANDALONE" -a ! -f "$PROJDIR/$VENDORDIR/nulib/php/load.sh" ]; then
# Forcer l'installation des dépendances si nécessaire
ComposerInstall=1
fi
[ -z "$ComposerInstall" -o -n "$UnlessExists" ] && exit 0
else
## Mode exécution de commande ##########################################
# Ici, on a déterminé qu'il faut lancer une commande
SOPTS=+w:
LOPTS=help,chdir:,no-use-rslave
args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args"
while [ $# -gt 0 ]; do
case "$1" in
--) shift; break;;
--help)
eecho "\
runphp: lancer une commande dans un environnement PHP déterminé
USAGE
$MYNAME ci|cu|composer
$MYNAME [options] command [args...]
COMMANDES COMPOSER
ci
cu
installer/mettre à jour les dépendances du projet avec composer
composer [args...]
lancer composer avec les arguments spécifiés.
pour les commandes ci-dessus, l'option --chdir est ignorée: le répertoire
courant est forcé au répertoire du projet composer
OPTIONS
-w, --chdir CHDIR
aller dans le répertoire spécifié avant de lancer la commande"
exit 0
;;
-w|--chdir) shift; Chdir="$1";;
--no-use-rslave) UseRslave=;;
*) die "$1: option non configurée";;
esac
shift
done
if [ -z "$RUNPHP_STANDALONE" -a ! -f "$PROJDIR/$VENDORDIR/nulib/php/load.sh" ]; then
# Forcer l'installation des dépendances si nécessaire
ComposerInstall=1
fi
fi
## Lancer la commande
args=(
run -it --rm
--name "runphp-$(basename -- "$1")-$$"
-e RUNPHP_MODE=docker
)
for arg in "${!PROXY_VARS[@]}"; do
args+=(-e "$arg=${PROXY_VARS[$arg]}")
done
if [ -n "$RUNPHP_STANDALONE" ]; then
args+=(
-e "RUNPHP_STANDALONE=$RUNPHP_STANDALONE"
-e "RUNPHP_PROJDIR=$PROJDIR"
)
fi
for host in "${HOST_MAPPINGS[@]}"; do
args+=(--add-host "$host")
done
# monter le répertoire qui contient $PROJDIR
mount_composer=
mount_runphp=1
if [ -z "$PROJDIR" -o "${PROJDIR#$HOME/}" != "$PROJDIR" -o "$PROJDIR" == "$HOME" ]; then
# bind mount $HOME
args+=(-v "$HOME:$HOME${UseRslave:+:rslave}")
[ -n "$RUNPHP_STANDALONE" ] &&
[ "${RUNPHP_STANDALONE#$HOME/}" != "$RUNPHP_STANDALONE" ] &&
mount_runphp=
else
# bind mount uniquement le répertoire du projet
args+=(-v "$PROJDIR:$PROJDIR${UseRslave:+:rslave}")
mount_composer=1
[ "$RUNPHP_STANDALONE" == "$PROJDIR" ] && mount_runphp=
fi
if [ -n "$mount_composer" -a -d "$HOME/.composer" ]; then
# monter la configuration de composer
args+=(-v "$HOME/.composer:$HOME/.composer")
fi
if [ -n "$RUNPHP_STANDALONE" -a -n "$mount_runphp" ]; then
args+=(-v "$RUNPHP_STANDALONE:$RUNPHP_STANDALONE")
fi
args+=(-w "$(pwd)")
# lancer avec l'utilisateur courant
if [ $(id -u) -ne 0 ]; then
# si c'est un utilisateur lambda, il faut monter les informations
# nécessaires. composer est déjà monté via $HOME
args+=(
-e DEVUSER_USERENT="$(getent passwd "$(id -un)")"
-e DEVUSER_GROUPENT="$(getent group "$(id -gn)")"
)
fi
args+=(
"$Image"
exec "$0" ${Chdir:+-w "$Chdir"}
)
[ -n "$ComposerInstall" ] && set -- ci
[ -n "$Verbose" ] && eecho "\$ docker ${args[*]} $*"
exec docker "${args[@]}" "$@"
else
############################################################################
# Lancement depuis l'intérieur du container
############################################################################
if [ -n "$DEVUSER_USERENT" ]; then
user="${DEVUSER_USERENT%%:*}"
export DEVUSER_USERENT=
export DEVUSER_GROUPENT=
if in_path su-exec; then
exec su-exec "$user" "$0" "$@"
else
exec runuser -u "$user" -- "$0" "$@"
fi
fi
SOPTS=+w:
LOPTS=chdir:
args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args"
chdir=
action=
while [ $# -gt 0 ]; do
case "$1" in
--) shift; break;;
-w|--chdir) shift; chdir="$1";;
*) die "$1: option non configurée";;
esac
shift
done
if [ -z "$1" ]; then
die "no command specified"
elif [ "$1" == ci ]; then
eecho "== installing composer dependencies"
composer i
elif [ "$1" == cu ]; then
eecho "== upgrading composer dependencies"
composer u
elif [ "$1" == composer ]; then
"$@"
else
if [ -n "$chdir" ]; then
cd "$chdir" || exit 1
fi
exec "$@"
fi
fi

29
runphp/runphp.userconf Normal file
View File

@ -0,0 +1,29 @@
# répertoire du projet. ce chemin doit être absolu. s'il est relatif, il est
# exprimé par rapport au répertoire de ce script
PROJDIR=
# composer: répertoire du projet composer (celui qui contient le fichier
# composer.json), chemin de composer.phar et répertoire vendor. ces chemins
# doivent être relatifs à $PROJDIR
COMPOSERDIR=
COMPOSERPHAR=
VENDORDIR=
# fichier de configuration pour le build
BUILDENV0=
BUILDENV=
# Listes des images que le script build construit automatiquement
BUILD_IMAGES=(php-apache mariadb10)
BUILD_FLAVOUR=
## En ce qui concerne DIST et IMAGENAME, les valeurs dans BUILDENV prennent le
## dessus. si BUILDENV *n'est pas* utilisé, ces valeurs peuvent être spécifiées
## ici
# version de debian à utiliser pour l'image
# d12=php8.2, d11=php7.4, d10=php7.3
DIST=
# Nom de base de l'image (sans le registry), e.g prefix/
IMAGENAME=

View File

@ -2,44 +2,6 @@
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 # -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/../load.sh" || exit 1 source "$(dirname "$0")/../load.sh" || exit 1
function parse_runphp() {
local runphp="$1" preamble="$2" conf="$3" postamble="$4"
local conf0
ac_set_tmpfile conf0
# extraire la configuration depuis le fichier
<"$runphp" awk -v preamble="$preamble" -v conf="$conf0" -v postamble="$postamble" '
BEGIN { out = preamble }
{
if ($0 ~ /SOF:runphp.userconf:/) {
if (out != "") print >out
out = conf
} else if ($0 ~ /EOF:runphp.userconf:/) {
out = postamble
if (out != "") print >out
} else {
if (out != "") print >out
}
}
'
# mettre en forme le fichier conf: pas de lignes vides avant et après
<"$conf0" >"$conf" awk '
BEGIN { p = 0; have_pending = 0; pending = "" }
$0 != "" { p = 1 }
p == 1 {
if ($0 != "") {
if (have_pending) print pending
print
have_pending = 0
pending = ""
} else {
if (!have_pending) have_pending = 1
else pending = pending "\n"
}
}
'
ac_clean "$conf0"
}
projdir= projdir=
args=( args=(
"Mettre à jour le script runphp" "Mettre à jour le script runphp"
@ -54,51 +16,58 @@ if [ -n "$projdir" ]; then
fi fi
runphp="${1:-.}" runphp="${1:-.}"
if [ -d "$runphp" ]; then [ -d "$runphp" ] && runphp="$runphp/runphp"
runphp="$runphp/runphp"
elif [ ! -e "$runphp" ]; then
[ "${runphp%/runphp}" != "$runphp" ] || runphp="$runphp/runphp"
fi
setx runphp=abspath "$runphp"
setx rundir=dirname -- "$runphp" setx rundir=dirname -- "$runphp"
[ "$rundir" == "$MYDIR" ] && exit 0
[ -d "$rundir" ] || mkdir -p "$rundir" [ -d "$rundir" ] || mkdir -p "$rundir"
# Tout d'abord, isoler chaque partie du fichier local
ac_set_tmpfile preamble
ac_set_tmpfile conf
ac_set_tmpfile postamble
parse_runphp "$MYDIR/runphp" "$preamble" "$conf" "$postamble"
# Puis analyser le fichier destination
if [ -f "$runphp" ]; then if [ -f "$runphp" ]; then
ac_set_tmpfile userconf ac_set_tmpfile userconf
parse_runphp "$runphp" "" "$userconf" "" <"$runphp" awk '
# extraire la configuration depuis le fichier
BEGIN { p = 0 }
/SOF:runphp.userconf:/ { p = 1; next }
/EOF:runphp.userconf:/ { p = 0; next }
p == 1 { print }
' | awk '
# mettre en forme le fichier: pas de lignes vides avant et après
BEGIN { p = 0; have_pending = 0; pending = "" }
$0 != "" { p = 1 }
p == 1 {
if ($0 != "") {
if (have_pending) print pending
print
have_pending = 0
pending = ""
} else {
if (!have_pending) have_pending = 1
else pending = pending "\n"
}
}
' >"$userconf"
initial_config= initial_config=
elif [ -n "$projdir" ]; then elif [ -n "$projdir" ]; then
# forcer BUILDENV0=..env.dist et BUILDENV=.env pour les projets de # forcer BUILDENV0=..env.dist et BUILDENV=.env pour les projets de
# l'université de la Réunion # l'université de la Réunion
initial_config=1
ac_set_tmpfile userconf ac_set_tmpfile userconf
sed <"$conf" >"$userconf" ' sed <"$MYDIR/runphp.userconf" >"$userconf" '
/^BUILDENV0=/s/=.*/=..env.dist/ /^BUILDENV0=/s/=.*/=..env.dist/
/^BUILDENV=/s/=.*/=.env/ /^BUILDENV=/s/=.*/=.env/
' '
initial_config=1
else else
userconf="$conf"
initial_config=1 initial_config=1
userconf="$MYDIR/runphp.userconf"
fi fi
# (Re)construire le fichier destination
( (
cat "$preamble" cat "$MYDIR/runphp.1preamble"
echo echo
cat "$userconf" cat "$userconf"
echo echo
cat "$postamble" cat "$MYDIR/runphp.2postamble"
) >"$runphp" ) >"$runphp"
[ -x "$runphp" ] || chmod +x "$runphp" [ -x "$runphp" ] || chmod +x "$runphp"