Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e3ce162e5 | |||
| 22806d6add | |||
| 46e39fa85d | |||
| 8eb8e33dc4 | |||
| afcb953d2d | |||
| 742b4087aa | |||
| f0c8daf26a | |||
| ee32a90ff9 |
@@ -17,7 +17,7 @@ Run `publish/publish.sh` script to create composer packages.
|
|||||||
|
|
||||||
This will automatically run all commands to create the packages
|
This will automatically run all commands to create the packages
|
||||||
|
|
||||||
### composer.egplusww.jp web host
|
### composer.omnicomproduction.jp web host
|
||||||
|
|
||||||
For the local composer package host.
|
For the local composer package host.
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ The entry is a copy of the `composer.json` with the following new entries:
|
|||||||
"version": "X.Y.Z",
|
"version": "X.Y.Z",
|
||||||
...
|
...
|
||||||
"dist": {
|
"dist": {
|
||||||
"url": "https://git.egplusww.jp/Composer/CoreLibs-Composer-All/archive/vX.Y.Z.zip",
|
"url": "https://packages.omnicomproduction.jp/Composer/CoreLibs-Composer-All/archive/vX.Y.Z.zip",
|
||||||
"type": "zip"
|
"type": "zip"
|
||||||
},
|
},
|
||||||
...
|
...
|
||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.2",
|
"php": ">=8.3",
|
||||||
"psr/log": "^3.0"
|
"psr/log": "^3.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
|
|||||||
+15
-1
@@ -1,7 +1,8 @@
|
|||||||
<phpunit
|
<phpunit
|
||||||
cacheResultFile="/tmp/phpunit-corelibs-composer.result.cache"
|
cacheResultFile="/tmp/phpunit-corelibs-composer.result.cache"
|
||||||
colors="true"
|
colors="true"
|
||||||
verbose="true"
|
verbose="false"
|
||||||
|
convertDeprecationsToExceptions="true"
|
||||||
bootstrap="test/phpunit/bootstrap.php"
|
bootstrap="test/phpunit/bootstrap.php"
|
||||||
>
|
>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
@@ -9,4 +10,17 @@
|
|||||||
<directory>test/phpunit</directory>
|
<directory>test/phpunit</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
|
<coverage processUncoveredFiles="true">
|
||||||
|
<include>
|
||||||
|
<directory suffix=".php">./www/lib/CoreLibs</directory>
|
||||||
|
</include>
|
||||||
|
<!-- <report>
|
||||||
|
<html outputDirectory="build/coverage-report"/>
|
||||||
|
</report> -->
|
||||||
|
</coverage>
|
||||||
|
<!-- <source>
|
||||||
|
<include>
|
||||||
|
<directory>./src</directory>
|
||||||
|
</include>
|
||||||
|
</source> -->
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
9.40.0.1
|
9.41.0.2
|
||||||
|
|||||||
+32
-14
@@ -11,6 +11,9 @@ go_flag="$1";
|
|||||||
|
|
||||||
function gitea_publish
|
function gitea_publish
|
||||||
{
|
{
|
||||||
|
# MUST have in app.ini, else upload will fail
|
||||||
|
# [repository]
|
||||||
|
# PREFIX_ARCHIVE_FILES = false
|
||||||
_GITEA_PUBLISH="${1}"
|
_GITEA_PUBLISH="${1}"
|
||||||
_GITEA_UPLOAD_FILENAME="${2}"
|
_GITEA_UPLOAD_FILENAME="${2}"
|
||||||
_GITEA_URL_DL="${3}"
|
_GITEA_URL_DL="${3}"
|
||||||
@@ -28,26 +31,40 @@ function gitea_publish
|
|||||||
[ -n "${_GITEA_URL_DL}" ] && [ -n "${_GITEA_URL_PUSH}" ] &&
|
[ -n "${_GITEA_URL_DL}" ] && [ -n "${_GITEA_URL_PUSH}" ] &&
|
||||||
[ -n "${_GITEA_USER}" ] && [ -n "${_GITEA_TOKEN}" ]; then
|
[ -n "${_GITEA_USER}" ] && [ -n "${_GITEA_TOKEN}" ]; then
|
||||||
echo "> Publish ${_GITEA_UPLOAD_FILENAME} with ${_VERSION} to: ${_GITEA_URL_PUSH}";
|
echo "> Publish ${_GITEA_UPLOAD_FILENAME} with ${_VERSION} to: ${_GITEA_URL_PUSH}";
|
||||||
|
error=0;
|
||||||
if [ ! -f "${_PACKAGE_DOWNLOAD}${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip" ]; then
|
if [ ! -f "${_PACKAGE_DOWNLOAD}${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip" ]; then
|
||||||
echo "> Download: ${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip";
|
echo "> Download: ${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip";
|
||||||
curl -LJO \
|
http_response=$(curl -LJO \
|
||||||
--output-dir "${_PACKAGE_DOWNLOAD}" \
|
-w "%{http_code}" \
|
||||||
"${_GITEA_URL_DL}"/v"${_VERSION}".zip;
|
--output-dir "${_PACKAGE_DOWNLOAD}" \
|
||||||
|
-H "Authorization: token ${_GITEA_TOKEN}" \
|
||||||
|
"${_GITEA_URL_DL}/v${_VERSION}.zip"
|
||||||
|
);
|
||||||
|
if [ "$http_response" -eq 200 ]; then
|
||||||
|
echo "[!] Error downloading file: ${http_response}";
|
||||||
|
error=1;
|
||||||
|
fi;
|
||||||
fi;
|
fi;
|
||||||
if [ ! -f "${_PACKAGE_DOWNLOAD}${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip" ]; then
|
if [ $error -eq 0 ]; then
|
||||||
echo "[!] Package file does not exist for version: ${_VERSION}";
|
# if this is the short name rename to long name, if long name down load does not work
|
||||||
else
|
if [ -f "${_PACKAGE_DOWNLOAD}v${_VERSION}.zip" ]; then
|
||||||
response=$(curl --user "${_GITEA_USER}":"${_GITEA_TOKEN}" \
|
mv "${_PACKAGE_DOWNLOAD}v${_VERSION}.zip" "${_PACKAGE_DOWNLOAD}${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip";
|
||||||
|
fi;
|
||||||
|
if [ ! -f "${_PACKAGE_DOWNLOAD}${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip" ]; then
|
||||||
|
echo "[!] Package file does not exist for version: ${_VERSION}";
|
||||||
|
else
|
||||||
|
response=$(curl --user "${_GITEA_USER}":"${_GITEA_TOKEN}" \
|
||||||
--upload-file "${_PACKAGE_DOWNLOAD}${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip" \
|
--upload-file "${_PACKAGE_DOWNLOAD}${_GITEA_UPLOAD_FILENAME}-v${_VERSION}.zip" \
|
||||||
"${_GITEA_URL_PUSH}"?version="${_VERSION}");
|
"${_GITEA_URL_PUSH}"?version="${_VERSION}");
|
||||||
status=$(echo "${response}" | jq .errors[].status);
|
status=$(echo "${response}" | jq .errors[].status);
|
||||||
message=$(echo "${response}" | jq .errors[].message);
|
message=$(echo "${response}" | jq .errors[].message);
|
||||||
if [ -n "${status}" ]; then
|
if [ -n "${status}" ]; then
|
||||||
echo "[!] Error ${status}: ${message}";
|
echo "[!] Error ${status}: ${message}";
|
||||||
else
|
else
|
||||||
echo "> Publish completed";
|
echo "> Publish completed";
|
||||||
|
echo "${_VERSION}" > "${_file_last_published}";
|
||||||
|
fi;
|
||||||
fi;
|
fi;
|
||||||
echo "${_VERSION}" > "${_file_last_published}";
|
|
||||||
fi;
|
fi;
|
||||||
else
|
else
|
||||||
echo "[!] Missing either GITEA_UPLOAD_FILENAME, GITEA_URL_DL, GITEA_URL_PUSH, GITEA_USER or GITEA_TOKEN environment variable";
|
echo "[!] Missing either GITEA_UPLOAD_FILENAME, GITEA_URL_DL, GITEA_URL_PUSH, GITEA_USER or GITEA_TOKEN environment variable";
|
||||||
@@ -88,6 +105,7 @@ if [ -f "${file_last_published}" ]; then
|
|||||||
LAST_PUBLISHED_VERSION=$(cat "${file_last_published}");
|
LAST_PUBLISHED_VERSION=$(cat "${file_last_published}");
|
||||||
if dpkg --compare-versions "${VERSION}" le "${LAST_PUBLISHED_VERSION}"; then
|
if dpkg --compare-versions "${VERSION}" le "${LAST_PUBLISHED_VERSION}"; then
|
||||||
echo "[!] git tag version ${VERSION} is not newer than previous published version ${LAST_PUBLISHED_VERSION}";
|
echo "[!] git tag version ${VERSION} is not newer than previous published version ${LAST_PUBLISHED_VERSION}";
|
||||||
|
exit;
|
||||||
fi;
|
fi;
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ class L10n
|
|||||||
* Get the local as array same to the GetLocale::setLocale return
|
* Get the local as array same to the GetLocale::setLocale return
|
||||||
* This does not set from outside, but only what is set in the l10n class
|
* This does not set from outside, but only what is set in the l10n class
|
||||||
*
|
*
|
||||||
* @return array{locale: string, lang: string, lang_short: string, domain: string, encoding: string, path: string}
|
* @return array{locale:string,lang:string,lang_short:string,domain:string,encoding:string,path:string}
|
||||||
*/
|
*/
|
||||||
public function getLocaleAsArray(): array
|
public function getLocaleAsArray(): array
|
||||||
{
|
{
|
||||||
@@ -321,7 +321,7 @@ class L10n
|
|||||||
* parse the locale string for further processing
|
* parse the locale string for further processing
|
||||||
*
|
*
|
||||||
* @param string $locale Locale to parse
|
* @param string $locale Locale to parse
|
||||||
* @return array<string,string|null> array with lang, country, charset, modifier
|
* @return array{lang:string|null,country:string|null,charset:string|null,modifier:string|null} parsed locale
|
||||||
*/
|
*/
|
||||||
public static function parseLocale(string $locale = ''): array
|
public static function parseLocale(string $locale = ''): array
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user