Plugin Directory

Changeset 3301853


Ignore:
Timestamp:
05/27/2025 11:18:48 PM (10 months ago)
Author:
lehelm
Message:

Refine Test Mode.

Location:
terms-popup-on-user-login/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • terms-popup-on-user-login/trunk/public/js/terms-popup-on-user-login-public.js

    r3301851 r3301853  
    371371
    372372            // should check cookie for this session
    373             if (window.TPUL.__shouldPopupCheckCookie()) {
     373            if (window.TPUL.__shouldPopupCheckCookie() && !window.TPUL.__isTestMode()) {
    374374                // cookie already present
    375375                // anon user has already accepted this modal
  • terms-popup-on-user-login/trunk/vendor/autoload.php

    r3131667 r3301853  
    1515        }
    1616    }
    17     trigger_error(
    18         $err,
    19         E_USER_ERROR
    20     );
     17    throw new RuntimeException($err);
    2118}
    2219
  • terms-popup-on-user-login/trunk/vendor/composer/InstalledVersions.php

    r3131667 r3301853  
    2828{
    2929    /**
     30     * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
     31     * @internal
     32     */
     33    private static $selfDir = null;
     34
     35    /**
    3036     * @var mixed[]|null
    3137     * @psalm-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<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
    3238     */
    3339    private static $installed;
     40
     41    /**
     42     * @var bool
     43     */
     44    private static $installedIsLocalDir;
    3445
    3546    /**
     
    310321        self::$installed = $data;
    311322        self::$installedByVendor = array();
     323
     324        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     325        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     326        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     327        // all installed packages for example
     328        self::$installedIsLocalDir = false;
     329    }
     330
     331    /**
     332     * @return string
     333     */
     334    private static function getSelfDir()
     335    {
     336        if (self::$selfDir === null) {
     337            self::$selfDir = strtr(__DIR__, '\\', '/');
     338        }
     339
     340        return self::$selfDir;
    312341    }
    313342
     
    323352
    324353        $installed = array();
     354        $copiedLocalDir = false;
    325355
    326356        if (self::$canGetVendors) {
     357            $selfDir = self::getSelfDir();
    327358            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     359                $vendorDir = strtr($vendorDir, '\\', '/');
    328360                if (isset(self::$installedByVendor[$vendorDir])) {
    329361                    $installed[] = self::$installedByVendor[$vendorDir];
     
    331363                    /** @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<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
    332364                    $required = require $vendorDir.'/composer/installed.php';
    333                     $installed[] = self::$installedByVendor[$vendorDir] = $required;
    334                     if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    335                         self::$installed = $installed[count($installed) - 1];
     365                    self::$installedByVendor[$vendorDir] = $required;
     366                    $installed[] = $required;
     367                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
     368                        self::$installed = $required;
     369                        self::$installedIsLocalDir = true;
    336370                    }
     371                }
     372                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     373                    $copiedLocalDir = true;
    337374                }
    338375            }
     
    351388        }
    352389
    353         if (self::$installed !== array()) {
     390        if (self::$installed !== array() && !$copiedLocalDir) {
    354391            $installed[] = self::$installed;
    355392        }
  • terms-popup-on-user-login/trunk/vendor/composer/installed.php

    r3202934 r3301853  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => '70aa321c8827665e98667af6941c4ccb8912b6c4',
     6        'reference' => '9ad2ab632a2a619a5e403db511d9434e3e1ff243',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    4141            'pretty_version' => 'dev-master',
    4242            'version' => 'dev-master',
    43             'reference' => '70aa321c8827665e98667af6941c4ccb8912b6c4',
     43            'reference' => '9ad2ab632a2a619a5e403db511d9434e3e1ff243',
    4444            'type' => 'library',
    4545            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.