diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..bb3b170 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,7 @@ +flux-publish-utils: + stage: build + image: docker-registry.fluxpublisher.ch/flux-publish-utils:latest + script: + - "false" + only: + - main \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d0c6b8a..7f313f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [2.1.0] +- Change: Upgrade composer dependencies +- Change: Refactored UserDefaultsConfig +- Change: Added publish-utils + ## [2.0.0] - Add: ILIAS 7 Support - Change: Upgrade composer dependencies diff --git a/README.md b/README.md index b8c39ff..62c79b3 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,13 @@ git clone https://github.com/fluxapps/UserDefaults.git UserDefaults ``` As ILIAS administrator go to "Administration->Plugins" and install/activate the plugin. +## ILIAS 7 core ilCtrl patch +For make this plugin work with ilCtrl in ILIAS 7, you may need to patch the core, before you update the plugin (At your own risk) + +Start at the plugin directory + +./vendor/srag/dic/bin/ilias7_core_apply_ilctrl_patch.sh + ## Contributing :purple_heart: Please ... 1. ... register an account at https://git.fluxlabs.ch diff --git a/composer.json b/composer.json index eef0093..2886392 100644 --- a/composer.json +++ b/composer.json @@ -1,12 +1,12 @@ { - "name": "srag-plugins/userdefaults", - "description": "", - "version": "2.0.0", - "type": "library", + "name": "fluxapp/user-defaults", + "description": "ILIAS UserDefaults Plugin", + "version": "2.1.0", + "type": "plugin", "keywords": [ - "ILIAS", - "Plugin", - "UserDefaults" + "ilias", + "fluxlabs", + "user-defaults" ], "license": "GPL-3.0-only", "authors": [ @@ -14,14 +14,14 @@ "name": "fluxlabs ag - lab burgdorf", "email": "support@fluxlabs.ch", "homepage": "https://fluxlabs.ch", - "role": "Developer" + "role": "Developer, Maintainer" } ], "support": { - "issues": "https://plugins.studer-raimann.ch/goto.php?target=uihk_srsu_PLUSERDEFAULTS" + "issues": "https://git.fluxlabs.ch" }, "require": { - "php": ">=7.2", + "php": ">=7.4", "ext-dom": "*", "ext-json": "*", "srag/activerecordconfig": ">=0.1.0", @@ -44,8 +44,7 @@ }, "scripts": { "pre-autoload-dump": [ - "srag\\LibrariesNamespaceChanger\\LibrariesNamespaceChanger::rewriteLibrariesNamespaces", - "srag\\LibrariesNamespaceChanger\\PHP72Backport::PHP72Backport" + "srag\\LibrariesNamespaceChanger\\LibrariesNamespaceChanger::rewriteLibrariesNamespaces" ] } } \ No newline at end of file diff --git a/composer.lock b/composer.lock index de421f8..4e817dc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "694f0c508dab4c16db8217b03963b2e7", + "content-hash": "6507ecb9d5f00a775a993c1fa0bed0c3", "packages": [ { "name": "srag/activerecordconfig", @@ -37,7 +37,7 @@ }, "autoload": { "psr-4": { - "srag\\ActiveRecordConfig\\UserDefaults\\": "src/" + "srag\\ActiveRecordConfig\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -59,6 +59,9 @@ "activerecord", "config" ], + "support": { + "source": "https://github.com/fluxapps/ActiveRecordConfig/tree/v0.21.1" + }, "time": "2021-07-20T08:32:29+00:00" }, { @@ -91,7 +94,7 @@ }, "autoload": { "psr-4": { - "srag\\CustomInputGUIs\\UserDefaults\\": "src/" + "srag\\CustomInputGUIs\\": "src/" }, "classmap": [ "src/MultiSelectSearchNewInputGUI/class.ObjectChildrenAjaxAutoCompleteCtrl.php", @@ -121,20 +124,23 @@ "input", "table" ], + "support": { + "source": "https://github.com/fluxapps/CustomInputGUIs/tree/v0.43.2" + }, "time": "2021-08-31T08:50:12+00:00" }, { "name": "srag/dic", - "version": "0.33.2", + "version": "0.34.1", "source": { "type": "git", "url": "https://github.com/fluxapps/DIC.git", - "reference": "a3b217ecba4964b7dc71ed332c503d35edfc78fe" + "reference": "d07315f7303e82982f78cdecce5f5aa83205a9e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fluxapps/DIC/zipball/a3b217ecba4964b7dc71ed332c503d35edfc78fe", - "reference": "a3b217ecba4964b7dc71ed332c503d35edfc78fe", + "url": "https://api.github.com/repos/fluxapps/DIC/zipball/d07315f7303e82982f78cdecce5f5aa83205a9e4", + "reference": "d07315f7303e82982f78cdecce5f5aa83205a9e4", "shasum": "" }, "require": { @@ -152,7 +158,7 @@ }, "autoload": { "psr-4": { - "srag\\DIC\\UserDefaults\\": "src/" + "srag\\DIC\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -175,7 +181,10 @@ "globals", "trait" ], - "time": "2021-07-20T11:49:07+00:00" + "support": { + "source": "https://github.com/fluxapps/DIC/tree/v0.34.1" + }, + "time": "2022-03-17T09:36:38+00:00" }, { "name": "srag/librariesnamespacechanger", @@ -222,6 +231,10 @@ "libraries", "namespace" ], + "support": { + "source": "https://github.com/fluxapps/LibrariesNamespaceChanger/tree/v0.16.1" + }, + "abandoned": "https://github.com/flux-eco/flux-namespace-changer", "time": "2021-07-20T08:31:26+00:00" }, { @@ -254,7 +267,7 @@ }, "autoload": { "psr-4": { - "srag\\LibraryLanguageInstaller\\UserDefaults\\": "src/" + "srag\\LibraryLanguageInstaller\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -277,6 +290,9 @@ "language", "library" ], + "support": { + "source": "https://github.com/fluxapps/LibraryLanguageInstaller/tree/v1.2.1" + }, "time": "2021-07-20T08:31:18+00:00" }, { @@ -310,7 +326,7 @@ }, "autoload": { "psr-4": { - "srag\\RemovePluginDataConfirm\\UserDefaults\\": "src/" + "srag\\RemovePluginDataConfirm\\": "src/" }, "classmap": [ "src/class.RemovePluginDataConfirmCtrl.php" @@ -337,6 +353,9 @@ "plugin", "uninstall" ], + "support": { + "source": "https://github.com/fluxapps/RemovePluginDataConfirm/tree/v0.8.1" + }, "time": "2021-07-20T08:30:56+00:00" } ], @@ -347,10 +366,10 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.2", + "php": ">=7.4", "ext-dom": "*", "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.3.0" } diff --git a/src/Config/UserDefaultsConfig.php b/src/Config/UserDefaultsConfig.php index c213bfb..d182c0b 100644 --- a/src/Config/UserDefaultsConfig.php +++ b/src/Config/UserDefaultsConfig.php @@ -3,7 +3,9 @@ namespace srag\Plugins\UserDefaults\Config; use ilUserDefaultsPlugin; -use srag\ActiveRecordConfig\UserDefaults\Config\Config; +use ActiveRecord; +use srag\DIC\UserDefaults\DICTrait; +use arConnector; /** * Class Config @@ -12,11 +14,160 @@ * * @author studer + raimann ag - Team Custom 1 */ -class UserDefaultsConfig extends Config { +class UserDefaultsConfig extends ActiveRecord +{ + use DICTrait; + protected static $table_name = "usr_def_config"; + const TABLE_NAME = "usr_def_config"; + const PLUGIN_CLASS_NAME = ilUserDefaultsPlugin::class; + const KEY_CATEGORY_REF_ID = "category_ref_id"; + /** + * @var string + */ + const SQL_DATE_FORMAT = "Y-m-d H:i:s"; + /** + * @var int + */ + const TYPE_BOOLEAN = 4; + /** + * @var int + */ + const TYPE_DATETIME = 6; + /** + * @var int + */ + const TYPE_DOUBLE = 3; + /** + * @var int + */ + const TYPE_INTEGER = 2; + /** + * @var int + */ + const TYPE_JSON = 7; + /** + * @var int + */ + const TYPE_STRING = 1; + /** + * @var int + */ + const TYPE_TIMESTAMP = 5; + + /** + * @var string + * + * @con_has_field true + * @con_fieldtype text + * @con_length 100 + * @con_is_notnull true + * @con_is_primary true + */ + protected $name = ""; + /** + * @var mixed + * + * @con_has_field true + * @con_fieldtype text + * @con_is_notnull false + */ + protected $value = null; + + + /** + * Config constructor + * + * @param string|null $primary_name_value + * @param arConnector|null $connector + */ + public function __construct(/*?string*/ $primary_name_value = null, /*?*/ arConnector $connector = null) + { + parent::__construct($primary_name_value, $connector); + } + + + + /** + * @inheritDoc + * + * @deprecated + */ + public static function returnDbTableName() : string + { + return self::getTableName(); + } + + + /** + * @inheritDoc + */ + public function getConnectorContainerName() : string + { + return self::getTableName(); + } + + + /** + * @return string + */ + public function getName() : string + { + return $this->name; + } + + + /** + * @param string $name + */ + public function setName(string $name) : void + { + $this->name = $name; + } + + + /** + * @return mixed + */ + public function getValue() + { + return $this->value; + } + + + /** + * @param mixed $value + */ + public function setValue($value) : void + { + $this->value = $value; + } + + + /** + * @inheritDoc + */ + public function sleep(/*string*/ $field_name) + { + $field_value = $this->{$field_name}; + + switch ($field_name) { + default: + return parent::sleep($field_name); + } + } + + + /** + * @inheritDoc + */ + public function wakeUp(/*string*/ $field_name, $field_value) + { + switch ($field_name) { + default: + return parent::wakeUp($field_name, $field_value); + } + } - const TABLE_NAME = "usr_def_config"; - const PLUGIN_CLASS_NAME = ilUserDefaultsPlugin::class; - const KEY_CATEGORY_REF_ID = "category_ref_id"; /** * @var array */ @@ -24,6 +175,20 @@ class UserDefaultsConfig extends Config { self::KEY_CATEGORY_REF_ID => self::TYPE_INTEGER ]; + + public static function getTableName() : string { + return self::$table_name; + } + + /** + * @param string $table_name + */ + public static function setTableName(string $table_name) : void + { + self::$table_name = $table_name; + } + + public static function getField(string $field): int { if (array_key_exists($field, self::$fields)) { return self::$fields[$field]; diff --git a/src/UserSetting/UserSetting.php b/src/UserSetting/UserSetting.php index 843e0aa..399554e 100644 --- a/src/UserSetting/UserSetting.php +++ b/src/UserSetting/UserSetting.php @@ -59,20 +59,23 @@ class UserSetting extends ActiveRecord { self::P_USER_EMAIL, ); + /** + * @throws \arException + * @deprecated + */ + public static function returnDbTableName() + { + return self::TABLE_NAME; + } - /** - * @return string - */ - public function getConnectorContainerName() { - return self::TABLE_NAME; - } - + public static function getTableName() : string { + return self::TABLE_NAME; + } - /** + /** * @return string - * @deprecated */ - public static function returnDbTableName() { + public function getConnectorContainerName() { return self::TABLE_NAME; } diff --git a/vendor/autoload.php b/vendor/autoload.php index bdac4de..715706a 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitf1ca73e5dff97b87cd234c419013b72f::getLoader(); +return ComposerAutoloaderInite4e194e8b14c7471adf365b41e191675::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 03b9bb9..afef3fa 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -37,26 +37,80 @@ * * @author Fabien Potencier * @author Jordi Boggiano - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ */ class ClassLoader { + /** @var ?string */ + private $vendorDir; + // PSR-4 + /** + * @var array[] + * @psalm-var array> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array> + */ private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * @var array[] + * @psalm-var array> + */ private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array + */ private $missingClasses = array(); + + /** @var ?string */ private $apcuPrefix; + /** + * @var self[] + */ + private static $registeredLoaders = array(); + + /** + * @param ?string $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + } + + /** + * @return string[] + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -66,28 +120,47 @@ public function getPrefixes() return array(); } + /** + * @return array[] + * @psalm-return array> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return string[] Array of classname => path + * @psalm-return array + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param string[] $classMap Class to filename map + * @psalm-param array $classMap + * + * @return void */ public function addClassMap(array $classMap) { @@ -102,9 +175,11 @@ public function addClassMap(array $classMap) * 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 array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void */ public function add($prefix, $paths, $prepend = false) { @@ -147,11 +222,13 @@ public function add($prefix, $paths, $prepend = false) * 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 array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @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 * * @throws \InvalidArgumentException + * + * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { @@ -195,8 +272,10 @@ public function addPsr4($prefix, $paths, $prepend = false) * 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 array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -211,10 +290,12 @@ public function set($prefix, $paths) * 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 array|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -234,6 +315,8 @@ public function setPsr4($prefix, $paths) * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -256,6 +339,8 @@ public function getUseIncludePath() * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -276,6 +361,8 @@ public function isClassMapAuthoritative() * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix + * + * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -296,25 +383,44 @@ public function getApcuPrefix() * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } } /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } } /** * Loads the given class or interface. * * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise + * @return true|null True if loaded, null otherwise */ public function loadClass($class) { @@ -323,6 +429,8 @@ public function loadClass($class) return true; } + + return null; } /** @@ -367,6 +475,21 @@ public function findFile($class) return $file; } + /** + * Returns the currently registered loaders indexed by their corresponding vendor directories. + * + * @return self[] + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -438,6 +561,10 @@ private function findFileWithExtension($class, $ext) * Scope isolated include. * * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private */ function includeFile($file) { diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php new file mode 100644 index 0000000..41bc143 --- /dev/null +++ b/vendor/composer/InstalledVersions.php @@ -0,0 +1,352 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final + */ +class InstalledVersions +{ + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints($constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // 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 = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + 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'; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // 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'; + } else { + self::$installed = array(); + } + } + $installed[] = self::$installed; + + return $installed; + } +} diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 8aba485..4bb0247 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -2,10 +2,11 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( + 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 'UDFCheckGUI' => $baseDir . '/classes/UDFCheck/class.UDFCheckGUI.php', 'UserDefaultsGlobalSettingsGUI' => $baseDir . '/classes/UserSetting/class.UserDefaultsGlobalSettingsGUI.php', 'UserSettingsGUI' => $baseDir . '/classes/UserSetting/class.UserSettingsGUI.php', diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index b7fc012..15a2ff3 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 0a3ba99..85f2080 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index a87dbf1..dfcac34 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitf1ca73e5dff97b87cd234c419013b72f +class ComposerAutoloaderInite4e194e8b14c7471adf365b41e191675 { private static $loader; @@ -22,21 +22,12 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitf1ca73e5dff97b87cd234c419013b72f', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInitf1ca73e5dff97b87cd234c419013b72f', 'loadClassLoader')); + spl_autoload_register(array('ComposerAutoloaderInite4e194e8b14c7471adf365b41e191675', 'loadClassLoader'), true, true); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); + spl_autoload_unregister(array('ComposerAutoloaderInite4e194e8b14c7471adf365b41e191675', 'loadClassLoader')); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require_once __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInitf1ca73e5dff97b87cd234c419013b72f::getInitializer($loader)); - } else { - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } + require __DIR__ . '/autoload_static.php'; + \Composer\Autoload\ComposerStaticInite4e194e8b14c7471adf365b41e191675::getInitializer($loader)(); $loader->setClassMapAuthoritative(true); $loader->register(true); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 690fca0..9aaef52 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitf1ca73e5dff97b87cd234c419013b72f +class ComposerStaticInite4e194e8b14c7471adf365b41e191675 { public static $prefixLengthsPsr4 = array ( 's' => @@ -51,6 +51,7 @@ class ComposerStaticInitf1ca73e5dff97b87cd234c419013b72f ); public static $classMap = array ( + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 'UDFCheckGUI' => __DIR__ . '/../..' . '/classes/UDFCheck/class.UDFCheckGUI.php', 'UserDefaultsGlobalSettingsGUI' => __DIR__ . '/../..' . '/classes/UserSetting/class.UserDefaultsGlobalSettingsGUI.php', 'UserSettingsGUI' => __DIR__ . '/../..' . '/classes/UserSetting/class.UserSettingsGUI.php', @@ -168,9 +169,9 @@ class ComposerStaticInitf1ca73e5dff97b87cd234c419013b72f public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitf1ca73e5dff97b87cd234c419013b72f::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitf1ca73e5dff97b87cd234c419013b72f::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitf1ca73e5dff97b87cd234c419013b72f::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInite4e194e8b14c7471adf365b41e191675::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInite4e194e8b14c7471adf365b41e191675::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInite4e194e8b14c7471adf365b41e191675::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index f5104d8..e05ce2c 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,347 +1,376 @@ -[ - { - "name": "srag/activerecordconfig", - "version": "0.21.1", - "version_normalized": "0.21.1.0", - "source": { - "type": "git", - "url": "https://github.com/fluxapps/ActiveRecordConfig.git", - "reference": "a717d2f31140a78e71517a6b8d3972e107f1eacb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fluxapps/ActiveRecordConfig/zipball/a717d2f31140a78e71517a6b8d3972e107f1eacb", - "reference": "a717d2f31140a78e71517a6b8d3972e107f1eacb", - "shasum": "" - }, - "require": { - "php": ">=7.2", - "srag/custominputguis": ">=0.1.0", - "srag/dic": ">=0.1.0" - }, - "require-dev": { - "srag/generateplugininfoshelper": ">=0.1.0" - }, - "time": "2021-07-20T08:32:29+00:00", - "type": "library", - "extra": { - "ilias_plugin": { - "ilias_min_version": "6.0", - "ilias_max_version": "7.999" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "srag\\ActiveRecordConfig\\UserDefaults\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-only" - ], - "authors": [ - { - "name": "fluxlabs", - "email": "support@fluxlabs.ch", - "homepage": "https://fluxlabs.ch", - "role": "Developer" - } - ], - "description": "Simple ActiveRecord config for ILIAS plugins", - "homepage": "https://github.com/fluxapps/ActiveRecordConfig", - "keywords": [ - "ILIAS", - "activerecord", - "config" - ] - }, - { - "name": "srag/custominputguis", - "version": "0.43.2", - "version_normalized": "0.43.2.0", - "source": { - "type": "git", - "url": "https://github.com/fluxapps/CustomInputGUIs.git", - "reference": "547ac0aaf7056848aac936b965e8847deb1cf415" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fluxapps/CustomInputGUIs/zipball/547ac0aaf7056848aac936b965e8847deb1cf415", - "reference": "547ac0aaf7056848aac936b965e8847deb1cf415", - "shasum": "" - }, - "require": { - "php": ">=7.2", - "srag/dic": ">=0.1.0" - }, - "require-dev": { - "srag/generateplugininfoshelper": ">=0.1.0" - }, - "time": "2021-08-31T08:50:12+00:00", - "type": "library", - "extra": { - "ilias_plugin": { - "ilias_min_version": "6.0", - "ilias_max_version": "7.999" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "srag\\CustomInputGUIs\\UserDefaults\\": "src/" - }, - "classmap": [ - "src/MultiSelectSearchNewInputGUI/class.ObjectChildrenAjaxAutoCompleteCtrl.php", - "src/MultiSelectSearchNewInputGUI/class.ObjectsAjaxAutoCompleteCtrl.php", - "src/MultiSelectSearchNewInputGUI/class.OrgUnitAjaxAutoCompleteCtrl.php", - "src/MultiSelectSearchNewInputGUI/class.UsersAjaxAutoCompleteCtrl.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-only" - ], - "authors": [ - { - "name": "fluxlabs", - "email": "support@fluxlabs.ch", - "homepage": "https://fluxlabs.ch", - "role": "Developer" - } - ], - "description": "Custom Input-GUI's", - "homepage": "https://github.com/fluxapps/CustomInputGUIs", - "keywords": [ - "ILIAS", - "PropertyForm", - "gui", - "input", - "table" - ] - }, - { - "name": "srag/dic", - "version": "0.33.2", - "version_normalized": "0.33.2.0", - "source": { - "type": "git", - "url": "https://github.com/fluxapps/DIC.git", - "reference": "a3b217ecba4964b7dc71ed332c503d35edfc78fe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fluxapps/DIC/zipball/a3b217ecba4964b7dc71ed332c503d35edfc78fe", - "reference": "a3b217ecba4964b7dc71ed332c503d35edfc78fe", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "srag/generateplugininfoshelper": ">=0.1.0" - }, - "time": "2021-07-20T11:49:07+00:00", - "type": "library", - "extra": { - "ilias_plugin": { - "ilias_min_version": "6.0", - "ilias_max_version": "7.999" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "srag\\DIC\\UserDefaults\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-only" - ], - "authors": [ - { - "name": "fluxlabs", - "email": "support@fluxlabs.ch", - "homepage": "https://fluxlabs.ch", - "role": "Developer" - } - ], - "description": "Use all ILIAS globals in your class", - "homepage": "https://github.com/fluxapps/DIC", - "keywords": [ - "ILIAS", - "dic", - "globals", - "trait" - ] - }, - { - "name": "srag/librariesnamespacechanger", - "version": "0.16.1", - "version_normalized": "0.16.1.0", - "source": { - "type": "git", - "url": "https://github.com/fluxapps/LibrariesNamespaceChanger.git", - "reference": "186c543c88544ecf3907767e1645d4faf37dede0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fluxapps/LibrariesNamespaceChanger/zipball/186c543c88544ecf3907767e1645d4faf37dede0", - "reference": "186c543c88544ecf3907767e1645d4faf37dede0", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "srag/generateplugininfoshelper": ">=0.1.0" - }, - "time": "2021-07-20T08:31:26+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "srag\\LibrariesNamespaceChanger\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-only" - ], - "authors": [ - { - "name": "fluxlabs", - "email": "support@fluxlabs.ch", - "homepage": "https://fluxlabs.ch", - "role": "Developer" - } - ], - "description": "Change namespace of libraries to plugin namespace", - "homepage": "https://github.com/fluxapps/LibrariesNamespaceChanger", - "keywords": [ - "changer", - "libraries", - "namespace" - ] - }, - { - "name": "srag/librarylanguageinstaller", - "version": "1.2.1", - "version_normalized": "1.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/fluxapps/LibraryLanguageInstaller.git", - "reference": "7c0e146d92f66368e9c756bc89e257fc60ea3e59" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fluxapps/LibraryLanguageInstaller/zipball/7c0e146d92f66368e9c756bc89e257fc60ea3e59", - "reference": "7c0e146d92f66368e9c756bc89e257fc60ea3e59", - "shasum": "" - }, - "require": { - "php": ">=7.2", - "srag/dic": ">=0.1.0" - }, - "require-dev": { - "srag/generateplugininfoshelper": ">=0.1.0" - }, - "time": "2021-07-20T08:31:18+00:00", - "type": "library", - "extra": { - "ilias_plugin": { - "ilias_min_version": "6.0", - "ilias_max_version": "7.999" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "srag\\LibraryLanguageInstaller\\UserDefaults\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-only" - ], - "authors": [ - { - "name": "fluxlabs", - "email": "support@fluxlabs.ch", - "homepage": "https://fluxlabs.ch", - "role": "Developer" - } - ], - "description": "Install additional and external lang files for a plugin", - "homepage": "https://github.com/fluxapps/LibraryLanguageInstaller", - "keywords": [ - "ILIAS", - "installer", - "language", - "library" - ] - }, - { - "name": "srag/removeplugindataconfirm", - "version": "0.8.1", - "version_normalized": "0.8.1.0", - "source": { - "type": "git", - "url": "https://github.com/fluxapps/RemovePluginDataConfirm.git", - "reference": "c2bdd6425e04edc3d49da36b0822ba2b33e21600" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fluxapps/RemovePluginDataConfirm/zipball/c2bdd6425e04edc3d49da36b0822ba2b33e21600", - "reference": "c2bdd6425e04edc3d49da36b0822ba2b33e21600", - "shasum": "" - }, - "require": { - "php": ">=7.2", - "srag/dic": ">=0.1.0", - "srag/librarylanguageinstaller": ">=0.1.0" - }, - "require-dev": { - "srag/generateplugininfoshelper": ">=0.1.0" - }, - "time": "2021-07-20T08:30:56+00:00", - "type": "library", - "extra": { - "ilias_plugin": { - "ilias_min_version": "6.0", - "ilias_max_version": "7.999" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "srag\\RemovePluginDataConfirm\\UserDefaults\\": "src/" - }, - "classmap": [ - "src/class.RemovePluginDataConfirmCtrl.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-only" - ], - "authors": [ - { - "name": "fluxlabs", - "email": "support@fluxlabs.ch", - "homepage": "https://fluxlabs.ch", - "role": "Developer" - } - ], - "description": "Demand if plugin data should be removed on uninstall", - "homepage": "https://github.com/fluxapps/RemovePluginDataConfirm", - "keywords": [ - "ILIAS", - "confirm", - "data", - "plugin", - "uninstall" - ] - } -] +{ + "packages": [ + { + "name": "srag/activerecordconfig", + "version": "0.21.1", + "version_normalized": "0.21.1.0", + "source": { + "type": "git", + "url": "https://github.com/fluxapps/ActiveRecordConfig.git", + "reference": "a717d2f31140a78e71517a6b8d3972e107f1eacb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fluxapps/ActiveRecordConfig/zipball/a717d2f31140a78e71517a6b8d3972e107f1eacb", + "reference": "a717d2f31140a78e71517a6b8d3972e107f1eacb", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "srag/custominputguis": ">=0.1.0", + "srag/dic": ">=0.1.0" + }, + "require-dev": { + "srag/generateplugininfoshelper": ">=0.1.0" + }, + "time": "2021-07-20T08:32:29+00:00", + "type": "library", + "extra": { + "ilias_plugin": { + "ilias_min_version": "6.0", + "ilias_max_version": "7.999" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "srag\\ActiveRecordConfig\\UserDefaults\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-only" + ], + "authors": [ + { + "name": "fluxlabs", + "email": "support@fluxlabs.ch", + "homepage": "https://fluxlabs.ch", + "role": "Developer" + } + ], + "description": "Simple ActiveRecord config for ILIAS plugins", + "homepage": "https://github.com/fluxapps/ActiveRecordConfig", + "keywords": [ + "ILIAS", + "activerecord", + "config" + ], + "support": { + "source": "https://github.com/fluxapps/ActiveRecordConfig/tree/v0.21.1" + }, + "install-path": "../srag/activerecordconfig" + }, + { + "name": "srag/custominputguis", + "version": "0.43.2", + "version_normalized": "0.43.2.0", + "source": { + "type": "git", + "url": "https://github.com/fluxapps/CustomInputGUIs.git", + "reference": "547ac0aaf7056848aac936b965e8847deb1cf415" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fluxapps/CustomInputGUIs/zipball/547ac0aaf7056848aac936b965e8847deb1cf415", + "reference": "547ac0aaf7056848aac936b965e8847deb1cf415", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "srag/dic": ">=0.1.0" + }, + "require-dev": { + "srag/generateplugininfoshelper": ">=0.1.0" + }, + "time": "2021-08-31T08:50:12+00:00", + "type": "library", + "extra": { + "ilias_plugin": { + "ilias_min_version": "6.0", + "ilias_max_version": "7.999" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "srag\\CustomInputGUIs\\UserDefaults\\": "src/" + }, + "classmap": [ + "src/MultiSelectSearchNewInputGUI/class.ObjectChildrenAjaxAutoCompleteCtrl.php", + "src/MultiSelectSearchNewInputGUI/class.ObjectsAjaxAutoCompleteCtrl.php", + "src/MultiSelectSearchNewInputGUI/class.OrgUnitAjaxAutoCompleteCtrl.php", + "src/MultiSelectSearchNewInputGUI/class.UsersAjaxAutoCompleteCtrl.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-only" + ], + "authors": [ + { + "name": "fluxlabs", + "email": "support@fluxlabs.ch", + "homepage": "https://fluxlabs.ch", + "role": "Developer" + } + ], + "description": "Custom Input-GUI's", + "homepage": "https://github.com/fluxapps/CustomInputGUIs", + "keywords": [ + "ILIAS", + "PropertyForm", + "gui", + "input", + "table" + ], + "support": { + "source": "https://github.com/fluxapps/CustomInputGUIs/tree/v0.43.2" + }, + "install-path": "../srag/custominputguis" + }, + { + "name": "srag/dic", + "version": "0.34.1", + "version_normalized": "0.34.1.0", + "source": { + "type": "git", + "url": "https://github.com/fluxapps/DIC.git", + "reference": "d07315f7303e82982f78cdecce5f5aa83205a9e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fluxapps/DIC/zipball/d07315f7303e82982f78cdecce5f5aa83205a9e4", + "reference": "d07315f7303e82982f78cdecce5f5aa83205a9e4", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "require-dev": { + "srag/generateplugininfoshelper": ">=0.1.0" + }, + "time": "2022-03-17T09:36:38+00:00", + "type": "library", + "extra": { + "ilias_plugin": { + "ilias_min_version": "6.0", + "ilias_max_version": "7.999" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "srag\\DIC\\UserDefaults\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-only" + ], + "authors": [ + { + "name": "fluxlabs", + "email": "support@fluxlabs.ch", + "homepage": "https://fluxlabs.ch", + "role": "Developer" + } + ], + "description": "Use all ILIAS globals in your class", + "homepage": "https://github.com/fluxapps/DIC", + "keywords": [ + "ILIAS", + "dic", + "globals", + "trait" + ], + "support": { + "source": "https://github.com/fluxapps/DIC/tree/v0.34.1" + }, + "install-path": "../srag/dic" + }, + { + "name": "srag/librariesnamespacechanger", + "version": "0.16.1", + "version_normalized": "0.16.1.0", + "source": { + "type": "git", + "url": "https://github.com/fluxapps/LibrariesNamespaceChanger.git", + "reference": "186c543c88544ecf3907767e1645d4faf37dede0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fluxapps/LibrariesNamespaceChanger/zipball/186c543c88544ecf3907767e1645d4faf37dede0", + "reference": "186c543c88544ecf3907767e1645d4faf37dede0", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "require-dev": { + "srag/generateplugininfoshelper": ">=0.1.0" + }, + "time": "2021-07-20T08:31:26+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "srag\\LibrariesNamespaceChanger\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-only" + ], + "authors": [ + { + "name": "fluxlabs", + "email": "support@fluxlabs.ch", + "homepage": "https://fluxlabs.ch", + "role": "Developer" + } + ], + "description": "Change namespace of libraries to plugin namespace", + "homepage": "https://github.com/fluxapps/LibrariesNamespaceChanger", + "keywords": [ + "changer", + "libraries", + "namespace" + ], + "support": { + "source": "https://github.com/fluxapps/LibrariesNamespaceChanger/tree/v0.16.1" + }, + "abandoned": "https://github.com/flux-eco/flux-namespace-changer", + "install-path": "../srag/librariesnamespacechanger" + }, + { + "name": "srag/librarylanguageinstaller", + "version": "1.2.1", + "version_normalized": "1.2.1.0", + "source": { + "type": "git", + "url": "https://github.com/fluxapps/LibraryLanguageInstaller.git", + "reference": "7c0e146d92f66368e9c756bc89e257fc60ea3e59" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fluxapps/LibraryLanguageInstaller/zipball/7c0e146d92f66368e9c756bc89e257fc60ea3e59", + "reference": "7c0e146d92f66368e9c756bc89e257fc60ea3e59", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "srag/dic": ">=0.1.0" + }, + "require-dev": { + "srag/generateplugininfoshelper": ">=0.1.0" + }, + "time": "2021-07-20T08:31:18+00:00", + "type": "library", + "extra": { + "ilias_plugin": { + "ilias_min_version": "6.0", + "ilias_max_version": "7.999" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "srag\\LibraryLanguageInstaller\\UserDefaults\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-only" + ], + "authors": [ + { + "name": "fluxlabs", + "email": "support@fluxlabs.ch", + "homepage": "https://fluxlabs.ch", + "role": "Developer" + } + ], + "description": "Install additional and external lang files for a plugin", + "homepage": "https://github.com/fluxapps/LibraryLanguageInstaller", + "keywords": [ + "ILIAS", + "installer", + "language", + "library" + ], + "support": { + "source": "https://github.com/fluxapps/LibraryLanguageInstaller/tree/v1.2.1" + }, + "install-path": "../srag/librarylanguageinstaller" + }, + { + "name": "srag/removeplugindataconfirm", + "version": "0.8.1", + "version_normalized": "0.8.1.0", + "source": { + "type": "git", + "url": "https://github.com/fluxapps/RemovePluginDataConfirm.git", + "reference": "c2bdd6425e04edc3d49da36b0822ba2b33e21600" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fluxapps/RemovePluginDataConfirm/zipball/c2bdd6425e04edc3d49da36b0822ba2b33e21600", + "reference": "c2bdd6425e04edc3d49da36b0822ba2b33e21600", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "srag/dic": ">=0.1.0", + "srag/librarylanguageinstaller": ">=0.1.0" + }, + "require-dev": { + "srag/generateplugininfoshelper": ">=0.1.0" + }, + "time": "2021-07-20T08:30:56+00:00", + "type": "library", + "extra": { + "ilias_plugin": { + "ilias_min_version": "6.0", + "ilias_max_version": "7.999" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "srag\\RemovePluginDataConfirm\\UserDefaults\\": "src/" + }, + "classmap": [ + "src/class.RemovePluginDataConfirmCtrl.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-only" + ], + "authors": [ + { + "name": "fluxlabs", + "email": "support@fluxlabs.ch", + "homepage": "https://fluxlabs.ch", + "role": "Developer" + } + ], + "description": "Demand if plugin data should be removed on uninstall", + "homepage": "https://github.com/fluxapps/RemovePluginDataConfirm", + "keywords": [ + "ILIAS", + "confirm", + "data", + "plugin", + "uninstall" + ], + "support": { + "source": "https://github.com/fluxapps/RemovePluginDataConfirm/tree/v0.8.1" + }, + "install-path": "../srag/removeplugindataconfirm" + } + ], + "dev": true, + "dev-package-names": [] +} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php new file mode 100644 index 0000000..c6b187c --- /dev/null +++ b/vendor/composer/installed.php @@ -0,0 +1,77 @@ + array( + 'pretty_version' => '2.0.0', + 'version' => '2.0.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => NULL, + 'name' => 'srag-plugins/userdefaults', + 'dev' => true, + ), + 'versions' => array( + 'srag-plugins/userdefaults' => array( + 'pretty_version' => '2.0.0', + 'version' => '2.0.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => NULL, + 'dev_requirement' => false, + ), + 'srag/activerecordconfig' => array( + 'pretty_version' => '0.21.1', + 'version' => '0.21.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../srag/activerecordconfig', + 'aliases' => array(), + 'reference' => 'a717d2f31140a78e71517a6b8d3972e107f1eacb', + 'dev_requirement' => false, + ), + 'srag/custominputguis' => array( + 'pretty_version' => '0.43.2', + 'version' => '0.43.2.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../srag/custominputguis', + 'aliases' => array(), + 'reference' => '547ac0aaf7056848aac936b965e8847deb1cf415', + 'dev_requirement' => false, + ), + 'srag/dic' => array( + 'pretty_version' => '0.34.1', + 'version' => '0.34.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../srag/dic', + 'aliases' => array(), + 'reference' => 'd07315f7303e82982f78cdecce5f5aa83205a9e4', + 'dev_requirement' => false, + ), + 'srag/librariesnamespacechanger' => array( + 'pretty_version' => '0.16.1', + 'version' => '0.16.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../srag/librariesnamespacechanger', + 'aliases' => array(), + 'reference' => '186c543c88544ecf3907767e1645d4faf37dede0', + 'dev_requirement' => false, + ), + 'srag/librarylanguageinstaller' => array( + 'pretty_version' => '1.2.1', + 'version' => '1.2.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../srag/librarylanguageinstaller', + 'aliases' => array(), + 'reference' => '7c0e146d92f66368e9c756bc89e257fc60ea3e59', + 'dev_requirement' => false, + ), + 'srag/removeplugindataconfirm' => array( + 'pretty_version' => '0.8.1', + 'version' => '0.8.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../srag/removeplugindataconfirm', + 'aliases' => array(), + 'reference' => 'c2bdd6425e04edc3d49da36b0822ba2b33e21600', + 'dev_requirement' => false, + ), + ), +); diff --git a/vendor/srag/activerecordconfig/src/Config/Config.php b/vendor/srag/activerecordconfig/src/Config/Config.php index 9cb5c98..6b3a4e7 100644 --- a/vendor/srag/activerecordconfig/src/Config/Config.php +++ b/vendor/srag/activerecordconfig/src/Config/Config.php @@ -49,10 +49,7 @@ class Config extends ActiveRecord * @var int */ const TYPE_TIMESTAMP = 5; - /** - * @var string - */ - protected static $table_name; + /** * @var string * @@ -85,26 +82,6 @@ public function __construct(/*?string*/ $primary_name_value = null, /*?*/ arConn } - /** - * @return string - */ - public static function getTableName() : string - { - if (empty(self::$table_name)) { - throw new LogicException("table name is empty - please call repository earlier!"); - } - - return self::$table_name; - } - - - /** - * @param string $table_name - */ - public static function setTableName(string $table_name) : void - { - self::$table_name = $table_name; - } /** diff --git a/vendor/srag/dic/CHANGELOG.md b/vendor/srag/dic/CHANGELOG.md index b4091c0..b6352f5 100644 --- a/vendor/srag/dic/CHANGELOG.md +++ b/vendor/srag/dic/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [0.34.1] +- Use local patch + +## [0.34.0] +- Move `ilias7_core_apply_ilctrl_patch.sh` + ## [0.33.2] - Use renderAsync in async ilCtrl contexts diff --git a/vendor/srag/dic/README.md b/vendor/srag/dic/README.md index 3b74b0d..2b4ca12 100644 --- a/vendor/srag/dic/README.md +++ b/vendor/srag/dic/README.md @@ -24,6 +24,16 @@ Tip: Because of multiple autoloaders of plugins, it could be, that different ver So I recommand to use [srag/librariesnamespacechanger](https://packagist.org/packages/srag/librariesnamespacechanger) in your plugin. +## ILIAS 7 core ilCtrl patch + +For make some plugins work with ilCtrl in ILIAS 7, you may need to patch the core, before you update the plugin (At your own risk) + +Start at the plugin directory + +```shell +./vendor/srag/dic/bin/ilias7_core_apply_ilctrl_patch.sh +``` + ## Use trait Declare your class like follow: diff --git a/vendor/srag/dic/bin/ilias7_core_apply_ilctrl_patch.sh b/vendor/srag/dic/bin/ilias7_core_apply_ilctrl_patch.sh new file mode 100755 index 0000000..19d85a2 --- /dev/null +++ b/vendor/srag/dic/bin/ilias7_core_apply_ilctrl_patch.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env sh + +# https://github.com/ILIAS-eLearning/ILIAS/pull/3512.diff +patch_file="`dirname $0`/ilias7_core_apply_ilctrl_patch_3512.diff" +echo "Patch file: $patch_file" + +ilias_root_dir="$(realpath -s "$(dirname $0)/../../../../../../../../../../..")" +echo "ILIAS root directory: $ilias_root_dir" + +if which git > /dev/null; then + echo "Uses git" + apply_patch="git -C $ilias_root_dir apply -v" +elif which patch > /dev/null; then + echo "Uses patch" + apply_patch="patch -p1 -d $ilias_root_dir -f -r /dev/null" +else + echo "Neither git or patch found" + exit 1 +fi + +echo "Download and apply" +set -e +cat $patch_file | $apply_patch + +echo "Done" diff --git a/vendor/srag/dic/bin/ilias7_core_apply_ilctrl_patch_3512.diff b/vendor/srag/dic/bin/ilias7_core_apply_ilctrl_patch_3512.diff new file mode 100644 index 0000000..6e7e70e --- /dev/null +++ b/vendor/srag/dic/bin/ilias7_core_apply_ilctrl_patch_3512.diff @@ -0,0 +1,80 @@ +diff --git a/Services/UICore/classes/Setup/class.ilCtrlStructureReader.php b/Services/UICore/classes/Setup/class.ilCtrlStructureReader.php +index 9a374b30f04f..2bef038825a2 100755 +--- a/Services/UICore/classes/Setup/class.ilCtrlStructureReader.php ++++ b/Services/UICore/classes/Setup/class.ilCtrlStructureReader.php +@@ -311,7 +311,7 @@ protected function setClassFileIdsInDB() : void + */ + protected function parseFileTo(\ilCtrlStructure $cs, string $full_path, string $content) : \ilCtrlStructure + { +- list($parent, $children) = $this->getIlCtrlCalls($content); ++ foreach ($this->getIlCtrlCalls($content) ?? [] as [$parent, $children]) { + if ($parent) { + $cs = $cs->withClassScript($parent, $full_path); + } +@@ -320,8 +320,9 @@ protected function parseFileTo(\ilCtrlStructure $cs, string $full_path, string $ + $cs = $cs->withClassChild($parent, $child); + } + } ++ } + +- list($child, $parents) = $this->getIlCtrlIsCalledBy($content); ++ foreach ($this->getIlCtrlIsCalledBy($content) ?? [] as [$child, $parents]) { + if ($child) { + $cs = $cs->withClassScript($child, $full_path); + } +@@ -330,6 +331,7 @@ protected function parseFileTo(\ilCtrlStructure $cs, string $full_path, string $ + $cs = $cs->withClassChild($parent, $child); + } + } ++ } + + $cl = $this->getGUIClassNameFromClassPath($full_path); + if ($cl && $this->containsClassDefinitionFor($cl, $content)) { +@@ -394,21 +396,16 @@ protected function getIlCtrlDeclarations(string $content, string $which) : ?arra + return null; + } + +- $class_names = array_unique($res[1]); +- if (count($class_names) != 1) { +- throw new \LogicException( +- "Found different class names in ilctrl_calls: " . join(",", $class_names) +- ); +- } +- ++ $declarations = []; ++ foreach ($res[1] as $i => $class_name) { + $declaration = []; +- foreach ($res[2] as $ls) { +- foreach (explode(",", $ls) as $l) { ++ foreach (explode(",", $res[2][$i]) as $l) { + $declaration[] = strtolower(trim($l)); + } ++ $declarations[] = [strtolower(trim($class_name)), $declaration]; + } + +- return [strtolower(trim($class_names[0])), $declaration]; ++ return $declarations; + } + + +diff --git a/Services/UICore/classes/class.ilCtrlStructure.php b/Services/UICore/classes/class.ilCtrlStructure.php +index fee94c6f795a..d2de025b68ad 100644 +--- a/Services/UICore/classes/class.ilCtrlStructure.php ++++ b/Services/UICore/classes/class.ilCtrlStructure.php +@@ -75,14 +75,14 @@ protected function addClassScript(string $class, string $file_path) : void + ); + } + +- if (isset($this->class_scripts[$class]) && $this->class_scripts[$class] != $file_path) { ++ /*if (isset($this->class_scripts[$class]) && $this->class_scripts[$class] != $file_path) { + $e = new \RuntimeException( + "Can't add script '$file_path' for class '$class', a script for that class already exists." + ); + $e->file_path = $file_path; + $e->class = $class; + throw $e; +- } ++ }*/ + + $this->class_scripts[$class] = $file_path; + } diff --git a/vendor/srag/dic/composer.json b/vendor/srag/dic/composer.json index d4fc98d..66453b8 100644 --- a/vendor/srag/dic/composer.json +++ b/vendor/srag/dic/composer.json @@ -1,7 +1,7 @@ { "name": "srag/dic", "description": "Use all ILIAS globals in your class", - "version": "0.33.2", + "version": "0.34.1", "extra": { "ilias_plugin": { "ilias_min_version": "6.0",