diff --git a/www/composer.lock b/www/composer.lock index 2c946264..8cb99f44 100644 --- a/www/composer.lock +++ b/www/composer.lock @@ -8,11 +8,11 @@ "packages": [ { "name": "egrajp/smarty-extended", - "version": "4.3.0", + "version": "4.4.1", "dist": { "type": "zip", - "url": "https://git.egplusww.jp/api/packages/Composer/composer/files/egrajp%2Fsmarty-extended/4.3.0/egrajp-smarty-extended.4.3.0.zip", - "shasum": "d41bda35c0d52da35cf911ab0b018655a09f072b" + "url": "https://git.egplusww.jp/api/packages/Composer/composer/files/egrajp%2Fsmarty-extended/4.4.1/egrajp-smarty-extended.4.4.1.zip", + "shasum": "edd7a0960e49bfcc709e0a525729aaaf9ed0db75" }, "type": "library", "autoload": { @@ -34,7 +34,7 @@ "keywords": [ "templating" ], - "time": "2023-02-17T14:14:10+09:00" + "time": "2024-03-06T18:43:44+09:00" }, { "name": "gullevek/dotenv", @@ -151,5 +151,5 @@ "php": ">=8.1" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/www/vendor/composer/ClassLoader.php b/www/vendor/composer/ClassLoader.php index fd56bd7d..7824d8f7 100644 --- a/www/vendor/composer/ClassLoader.php +++ b/www/vendor/composer/ClassLoader.php @@ -45,35 +45,34 @@ class ClassLoader /** @var \Closure(string):void */ private static $includeFile; - /** @var ?string */ + /** @var string|null */ private $vendorDir; // PSR-4 /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixLengthsPsr4 = array(); /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixDirsPsr4 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr4 = array(); // PSR-0 /** - * @var array[] - * @psalm-var array> + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> */ private $prefixesPsr0 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr0 = array(); @@ -81,8 +80,7 @@ class ClassLoader private $useIncludePath = false; /** - * @var string[] - * @psalm-var array + * @var array */ private $classMap = array(); @@ -90,21 +88,20 @@ class ClassLoader private $classMapAuthoritative = false; /** - * @var bool[] - * @psalm-var array + * @var array */ private $missingClasses = array(); - /** @var ?string */ + /** @var string|null */ private $apcuPrefix; /** - * @var self[] + * @var array */ private static $registeredLoaders = array(); /** - * @param ?string $vendorDir + * @param string|null $vendorDir */ public function __construct($vendorDir = null) { @@ -113,7 +110,7 @@ class ClassLoader } /** - * @return string[] + * @return array> */ public function getPrefixes() { @@ -125,8 +122,7 @@ class ClassLoader } /** - * @return array[] - * @psalm-return array> + * @return array> */ public function getPrefixesPsr4() { @@ -134,8 +130,7 @@ class ClassLoader } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirs() { @@ -143,8 +138,7 @@ class ClassLoader } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirsPsr4() { @@ -152,8 +146,7 @@ class ClassLoader } /** - * @return string[] Array of classname => path - * @psalm-return array + * @return array Array of classname => path */ public function getClassMap() { @@ -161,8 +154,7 @@ class ClassLoader } /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap + * @param array $classMap Class to filename map * * @return void */ @@ -179,24 +171,25 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -205,19 +198,19 @@ class ClassLoader $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -226,9 +219,9 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * @@ -236,17 +229,18 @@ class ClassLoader */ public function addPsr4($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -256,18 +250,18 @@ class ClassLoader throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -276,8 +270,8 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories * * @return void */ @@ -294,8 +288,8 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * @@ -429,7 +423,8 @@ class ClassLoader public function loadClass($class) { if ($file = $this->findFile($class)) { - (self::$includeFile)($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } @@ -480,9 +475,9 @@ class ClassLoader } /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. + * Returns the currently registered loaders keyed by their corresponding vendor directories. * - * @return self[] + * @return array */ public static function getRegisteredLoaders() { @@ -560,7 +555,10 @@ class ClassLoader return false; } - private static function initializeIncludeClosure(): void + /** + * @return void + */ + private static function initializeIncludeClosure() { if (self::$includeFile !== null) { return; @@ -574,8 +572,8 @@ class ClassLoader * @param string $file * @return void */ - self::$includeFile = static function($file) { + self::$includeFile = \Closure::bind(static function($file) { include $file; - }; + }, null, null); } } diff --git a/www/vendor/composer/InstalledVersions.php b/www/vendor/composer/InstalledVersions.php index c6b54af7..51e734a7 100644 --- a/www/vendor/composer/InstalledVersions.php +++ b/www/vendor/composer/InstalledVersions.php @@ -98,7 +98,7 @@ class InstalledVersions { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } @@ -119,7 +119,7 @@ class InstalledVersions */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints($constraint); + $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -328,7 +328,9 @@ class InstalledVersions if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } @@ -340,12 +342,17 @@ class InstalledVersions // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; } else { self::$installed = array(); } } - $installed[] = self::$installed; + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } return $installed; } diff --git a/www/vendor/composer/installed.json b/www/vendor/composer/installed.json index dc7144b6..c7b5e684 100644 --- a/www/vendor/composer/installed.json +++ b/www/vendor/composer/installed.json @@ -2,14 +2,14 @@ "packages": [ { "name": "egrajp/smarty-extended", - "version": "4.3.0", - "version_normalized": "4.3.0.0", + "version": "4.4.1", + "version_normalized": "4.4.1.0", "dist": { "type": "zip", - "url": "https://git.egplusww.jp/api/packages/Composer/composer/files/egrajp%2Fsmarty-extended/4.3.0/egrajp-smarty-extended.4.3.0.zip", - "shasum": "d41bda35c0d52da35cf911ab0b018655a09f072b" + "url": "https://git.egplusww.jp/api/packages/Composer/composer/files/egrajp%2Fsmarty-extended/4.4.1/egrajp-smarty-extended.4.4.1.zip", + "shasum": "edd7a0960e49bfcc709e0a525729aaaf9ed0db75" }, - "time": "2023-02-17T14:14:10+09:00", + "time": "2024-03-06T18:43:44+09:00", "type": "library", "installation-source": "dist", "autoload": { diff --git a/www/vendor/composer/installed.php b/www/vendor/composer/installed.php index 3d9e8833..71fb9599 100644 --- a/www/vendor/composer/installed.php +++ b/www/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'egrajp/corelibs-dev', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => NULL, + 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,16 +13,16 @@ 'egrajp/corelibs-dev' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => NULL, + 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), 'egrajp/smarty-extended' => array( - 'pretty_version' => '4.3.0', - 'version' => '4.3.0.0', - 'reference' => NULL, + 'pretty_version' => '4.4.1', + 'version' => '4.4.1.0', + 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../egrajp/smarty-extended', 'aliases' => array(), diff --git a/www/vendor/egrajp/smarty-extended/ReadMe.md b/www/vendor/egrajp/smarty-extended/ReadMe.md index f3b5c5f8..ded4fcec 100644 --- a/www/vendor/egrajp/smarty-extended/ReadMe.md +++ b/www/vendor/egrajp/smarty-extended/ReadMe.md @@ -11,45 +11,36 @@ For local install only ## Setup from central composer -| Host | Location | Type | -| - | - | - | -| composer.tokyo.tequila.jp | soba-local | Local test | -| composer-local.tokyo.tequila.jp | udon-local | Local Live, no https | -| composer.egplusww.jp | udon | General Live (use this) | +Setup from gitea internal servers -composer.json: - -For Local test, note that secure-http has to be turned off: - -```json -{ - "repositories": [ - { - "type": "composer", - "url": "http://composer.tokyo.tequila.jp" - } - ], - "require": { - "egrajp/smarty-extended": "@dev" - }, - "config": { - "secure-http": false - } -} +```sh +composer config repositories.git.egplusww.jp.Composer composer https://git.egplusww.jp/api/packages/Composer/composer ``` -For live settings +Alternative setup composer local zip file repot: +`composer config repositories.composer.egplusww.jp composer http://composer.egplusww.jp` -```json -{ - "repositories": [ - { - "type": "composer", - "url": "https://composer.egplusww.jp" - } - ], - "require": { - "egrajp/smarty-extended": "@dev" - } -} -``` +## Install package + +`composer require egrajp/smarty-extended:^4.3` + +## How to update + +1) update the original composer for ^4.3 +2) copy over the src/sysplugins and all base files in src/ +3) check either function.html_checkboxes.php and function.html_options.php have changed +4) copy src/plugins except the above two files, be sure to keep the block.t.php and function_popup*.php +5) Create new release version as official relase number + +## Updated files (different from master) + +### New + +`src/plugins/block.t.php` +`src/plugins/function_popup.php` +`src/plugins/function_popup.init.php` + +### Changed + +`src/plugins/function.html_checkboxes.php` +`src/plugins/function.html_options.php` diff --git a/www/vendor/egrajp/smarty-extended/publish/.gitignore b/www/vendor/egrajp/smarty-extended/publish/.gitignore new file mode 100644 index 00000000..81a38be6 --- /dev/null +++ b/www/vendor/egrajp/smarty-extended/publish/.gitignore @@ -0,0 +1 @@ +.env* diff --git a/www/vendor/egrajp/smarty-extended/publish/last.published b/www/vendor/egrajp/smarty-extended/publish/last.published new file mode 100644 index 00000000..eda862a9 --- /dev/null +++ b/www/vendor/egrajp/smarty-extended/publish/last.published @@ -0,0 +1 @@ +4.3.4 diff --git a/www/vendor/egrajp/smarty-extended/publish/package-download/.gitignore b/www/vendor/egrajp/smarty-extended/publish/package-download/.gitignore new file mode 100644 index 00000000..c4c4ffc6 --- /dev/null +++ b/www/vendor/egrajp/smarty-extended/publish/package-download/.gitignore @@ -0,0 +1 @@ +*.zip diff --git a/www/vendor/egrajp/smarty-extended/publish/publish.sh b/www/vendor/egrajp/smarty-extended/publish/publish.sh new file mode 100755 index 00000000..7095275c --- /dev/null +++ b/www/vendor/egrajp/smarty-extended/publish/publish.sh @@ -0,0 +1,88 @@ +#!/usr/bin/env bash + +BASE_FOLDER=$(dirname $(readlink -f $0))"/"; +PACKAGE_DOWNLOAD="${BASE_FOLDER}package-download/"; +if [ ! -d "${PACKAGE_DOWNLOAD}" ]; then + mkdir "${PACKAGE_DOWNLOAD}"; +fi; +VERSION=$(git tag --list | sort -V | tail -n1 | sed -e "s/^v//"); +file_last_published="${BASE_FOLDER}last.published"; +go_flag="$1"; + +if [ -z "${VERSION}" ]; then + echo "Version must be set in the form x.y.z without any leading characters"; + exit; +fi; +# compare version, if different or newer, deploy +if [ -f "${file_last_published}" ]; then + LAST_PUBLISHED_VERSION=$(cat ${file_last_published}); + 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}"; + exit; + fi; +fi; + +# read in the .env.deploy file and we must have +# GITEA_UPLOAD_FILENAME +# GITLAB_USER +# GITLAB_TOKEN +# GITLAB_URL +# GITEA_USER +# GITEA_DEPLOY_TOKEN +# GITEA_URL_DL +# GITEA_URL_PUSH +if [ ! -f "${BASE_FOLDER}.env.deploy" ]; then + echo "Deploy enviroment file .env.deploy is missing"; + exit; +fi; +set -o allexport; +cd ${BASE_FOLDER}; +source .env.deploy; +cd -; +set +o allexport; + +if [ "${go_flag}" != "go" ]; then + echo "No go flag given"; + echo "Would publish ${VERSION}"; + echo "[END]"; + exit; +fi; + +echo "[START]"; +# gitea +if [ ! -z "${GITEA_UPLOAD_FILENAME}" ] && + [ ! -z "${GITEA_URL_DL}" ] && [ ! -z "${GITEA_URL_PUSH}" ] && + [ ! -z "${GITEA_USER}" ] && [ ! -z "${GITEA_TOKEN}" ]; then + curl -LJO \ + --output-dir "${PACKAGE_DOWNLOAD}" \ + ${GITEA_URL_DL}/v${VERSION}.zip; + # echo "curl -LJO \ + # --output-dir "${PACKAGE_DOWNLOAD}" \ + # ${GITEA_URL_DL}/v${VERSION}.zip;" + curl --user ${GITEA_USER}:${GITEA_TOKEN} \ + --upload-file "${PACKAGE_DOWNLOAD}${GITEA_UPLOAD_FILENAME}-v${VERSION}.zip" \ + ${GITEA_URL_PUSH}?version=${VERSION}; + # echo "curl --user ${GITEA_USER}:${GITEA_TOKEN} \ + # --upload-file "${PACKAGE_DOWNLOAD}${GITEA_UPLOAD_FILENAME}-v${VERSION}.zip" \ + # ${GITEA_URL_PUSH}?version=${VERSION};" + echo "${VERSION}" > "${file_last_published}"; +else + echo "Missing either GITEA_UPLOAD_FILENAME, GITEA_URL_DL, GITEA_URL_PUSH, GITEA_USER or GITEA_TOKEN environment variable"; +fi; + +# gitlab +if [ ! -z "${GITLAB_URL}" ] && [ ! -z "${GITLAB_DEPLOY_TOKEN}" ]; then + curl --data tag=v${VERSION} \ + --header "Deploy-Token: ${GITLAB_DEPLOY_TOKEN}" \ + "${GITLAB_URL}"; + curl --data branch=master \ + --header "Deploy-Token: ${GITLAB_DEPLOY_TOKEN}" \ + "${GITLAB_URL}"; + echo "${VERSION}" > "${file_last_published}"; +else + echo "Missing GITLAB_DEPLOY_TOKEN environment variable"; +fi; +echo ""; +echo "[DONE]"; + +# __END__ diff --git a/www/vendor/egrajp/smarty-extended/src/Smarty.class.php b/www/vendor/egrajp/smarty-extended/src/Smarty.class.php index 5351b579..0a47c835 100644 --- a/www/vendor/egrajp/smarty-extended/src/Smarty.class.php +++ b/www/vendor/egrajp/smarty-extended/src/Smarty.class.php @@ -107,7 +107,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '4.3.0'; + const SMARTY_VERSION = '4.4.1'; /** * define variable scopes */ diff --git a/www/vendor/egrajp/smarty-extended/src/debug.tpl b/www/vendor/egrajp/smarty-extended/src/debug.tpl index 4f82a582..cd932566 100644 --- a/www/vendor/egrajp/smarty-extended/src/debug.tpl +++ b/www/vendor/egrajp/smarty-extended/src/debug.tpl @@ -167,9 +167,7 @@ {/capture} diff --git a/www/vendor/egrajp/smarty-extended/src/plugins/function.math.php b/www/vendor/egrajp/smarty-extended/src/plugins/function.math.php index f9cf67fe..34912d23 100644 --- a/www/vendor/egrajp/smarty-extended/src/plugins/function.math.php +++ b/www/vendor/egrajp/smarty-extended/src/plugins/function.math.php @@ -67,7 +67,7 @@ function smarty_function_math($params, $template) $equation = preg_replace('/\s+/', '', $equation); // Adapted from https://www.php.net/manual/en/function.eval.php#107377 - $number = '(?:\d+(?:[,.]\d+)?|pi|π)'; // What is a number + $number = '-?(?:\d+(?:[,.]\d+)?|pi|π)'; // What is a number $functionsOrVars = '((?:0x[a-fA-F0-9]+)|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))'; $operators = '[,+\/*\^%-]'; // Allowed math operators $regexp = '/^(('.$number.'|'.$functionsOrVars.'|('.$functionsOrVars.'\s*\((?1)*\)|\((?1)*\)))(?:'.$operators.'(?1))?)+$/'; diff --git a/www/vendor/egrajp/smarty-extended/src/plugins/modifier.escape.php b/www/vendor/egrajp/smarty-extended/src/plugins/modifier.escape.php index 11e44682..e168679c 100644 --- a/www/vendor/egrajp/smarty-extended/src/plugins/modifier.escape.php +++ b/www/vendor/egrajp/smarty-extended/src/plugins/modifier.escape.php @@ -115,7 +115,9 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ // see https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements '