Plugin Directory

Changeset 3389705


Ignore:
Timestamp:
11/04/2025 01:40:30 PM (5 months ago)
Author:
sendcloudbv
Message:

Release version 1.0.18

Location:
sendcloud-connected-shipping
Files:
131 added
17 edited

Legend:

Unmodified
Added
Removed
  • sendcloud-connected-shipping/trunk/changelog.txt

    r3381752 r3389705  
    11*** WooCommerce Sendcloud | The all-in-one shipping platform Changelog ***
    22
    3 = 2025-10-13 - version 1.0.17 =
    4 * Fix service point validation on initial load in block checkout
     3= 2025-11-04 - version 1.0.18 =
     4* Track product EAN change and update related unprocessed orders
     5
     6= 2025-10-20 - version 1.0.17 =
     7* Service Point validation on initial load in Block Checkout.
     8* Ensured compatibility with other checkout modules.
    59
    610= 2025-09-24 - version 1.0.16 =
  • sendcloud-connected-shipping/trunk/composer.lock

    r3336392 r3389705  
    1010    "aliases": [],
    1111    "minimum-stability": "stable",
    12     "stability-flags": [],
     12    "stability-flags": {},
    1313    "prefer-stable": false,
    1414    "prefer-lowest": false,
     
    1717        "ext-json": "*"
    1818    },
    19     "platform-dev": [],
    20     "plugin-api-version": "2.2.0"
     19    "platform-dev": {},
     20    "plugin-api-version": "2.6.0"
    2121}
  • sendcloud-connected-shipping/trunk/includes/HookHandlers/class-product-handler.php

    r3266337 r3389705  
    33namespace SCCSP\SendCloud\Connected\Shipping\HookHandlers;
    44
     5use SCCSP\SendCloud\Connected\Shipping\Repositories\SCCSP_Order_Repository;
     6use SCCSP\SendCloud\Connected\Shipping\Utility\SCCSP_Logger;
    57use SCCSP\SendCloud\Connected\Shipping\Utility\SCCSP_Version_Utility;
    68use WC_Product;
     
    1517    static $ean_code_key = 'sc_ean_code';
    1618
     19
     20    /**
     21     * @var \SCCSP\SendCloud\Connected\Shipping\Repositories\SCCSP_Order_Repository
     22     */
     23    private $order_repository;
     24
     25    /**
     26     * Checkout_Handler constructor
     27     */
     28    public function __construct()
     29    {
     30        $this->order_repository = new SCCSP_Order_Repository();
     31    }
    1732
    1833    /**
     
    3045            'add_international_shipping_fields'
    3146        ) );
     47        add_action( 'woocommerce_update_product', array(
     48            $this,
     49            'on_update_product'
     50        ), 10, 2);
    3251    }
     52
     53    /**
     54     * Checks if product ean field is changed and updates related orders
     55     *
     56     * @param $product_id
     57     * @param $product
     58     * @return void
     59     */
     60    public function on_update_product($product_id, $product){
     61        $ean = SCCSP_Version_Utility::compare( '9.2', '<' )
     62            ? $product->get_meta( self::$ean_code_key )
     63            : $product->get_global_unique_id();;
     64
     65        $hash = md5(json_encode([$ean]));
     66        $hashBefore = get_post_meta( $product_id, "productUpdateHash", true );
     67
     68        if ($hash !== $hashBefore) {
     69            $order_ids = $this->order_repository->get_orders_by_product_id( $product_id );
     70            add_post_meta($product_id, "productUpdateHash", $hash);
     71
     72            if (!$order_ids) {
     73                return;
     74            }
     75
     76            $this->order_repository->set_orders_updated_by_id($order_ids);
     77            SCCSP_Logger::debug( sprintf('Orders (%s) updated after product (%d) EAN update',
     78                implode(", ", $order_ids),
     79                $product_id
     80            ));
     81        }
     82    }
    3383
    3484    /**
  • sendcloud-connected-shipping/trunk/includes/Repositories/class-order-repository.php

    r3312433 r3389705  
    33namespace SCCSP\SendCloud\Connected\Shipping\Repositories;
    44
     5use Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore;
     6use Automattic\WooCommerce\Enums\OrderStatus;
    57use SCCSP\SendCloud\Connected\Shipping\Models\SCCSP_Service_Point_Meta;
    68
     
    5153        $order->save();
    5254    }
     55
     56    /**
     57     * @param int $product_id
     58     *
     59     * @return array|null
     60     * @throws \Exception
     61     */
     62    public function get_orders_by_product_id( $product_id ) {
     63        global $wpdb;
     64        $product_table = $wpdb->prefix . 'wc_order_product_lookup';
     65        $order_table = $wpdb->prefix . 'wc_orders';
     66
     67        $sync_statuses = [
     68            "wc-" . OrderStatus::COMPLETED,
     69            "wc-" . OrderStatus::CANCELLED,
     70            "wc-" . OrderStatus::REFUNDED,
     71            "wc-" . OrderStatus::FAILED,
     72            "wc-" . OrderStatus::TRASH
     73        ];
     74
     75        $sql = "
     76            SELECT p.order_id
     77                FROM %1s p
     78                LEFT JOIN %1s o ON p.order_id = o.id
     79                WHERE p.product_id = %d
     80                  AND o.status NOT IN(".implode(', ', array_fill(0, count($sync_statuses), '%s')).")
     81                  AND o.date_created_gmt > NOW() - INTERVAL 30 DAY
     82        ";
     83
     84        $query = call_user_func_array(
     85            array($wpdb, 'prepare'),
     86            array_merge(array($sql, $product_table, $order_table, $product_id), $sync_statuses)
     87        );
     88        $result = $wpdb->get_results($query, ARRAY_A);
     89
     90        return $result ? array_column($result, 'order_id') : array();
     91    }
     92
     93    /**
     94     * @param $order_ids
     95     * @return void
     96     */
     97    public function set_orders_updated_by_id( $order_ids )
     98    {
     99        global $wpdb;
     100
     101        foreach ($order_ids as $order_id) {
     102            $wpdb->update(
     103                $wpdb->prefix . 'wc_orders',
     104                array(
     105                    'date_updated_gmt' => current_time( 'mysql', true ),
     106                ),
     107                array(
     108                    'id' => $order_id,
     109                ),
     110                array(
     111                    '%s',
     112                ),
     113                array(
     114                    '%d',
     115                )
     116            );
     117        }
     118
     119    }
    53120}
  • sendcloud-connected-shipping/trunk/includes/class-sendcloud.php

    r3381752 r3389705  
    2727
    2828class SCCSP_Sendcloud {
    29     const VERSION = '1.0.17';
     29    const VERSION = '1.0.18';
    3030
    3131    const INTEGRATION_NAME = 'sendcloudshipping';
  • sendcloud-connected-shipping/trunk/readme.txt

    r3381752 r3389705  
    11=== Sendcloud Shipping ===
    2 Version: 1.0.17
     2Version: 1.0.18
    33Developer: SendCloud Global B.V.
    44Developer URI: http://sendcloud.com
     
    77Requires PHP: 7.0
    88Tested up to: 6.8.2
    9 Stable tag: 1.0.17
     9Stable tag: 1.0.18
    1010License: GPLv2
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    104104== Changelog ==
    105105= 1.0.17 =
    106 * Fix service point validation on initial load in block checkout
     106* Service Point validation on initial load in Block Checkout.
     107* Ensured compatibility with other checkout modules.
    107108
    108109= 1.0.16 =
  • sendcloud-connected-shipping/trunk/sendcloud-connected-shipping.php

    r3381752 r3389705  
    44 * Plugin URI: https://wordpress.org/plugins/sendcloud-connected-shipping/
    55 * Description: Sendcloud plugin.
    6  * Version: 1.0.17
     6 * Version: 1.0.18
    77 * Woo:
    88 * Author: Sendcloud B.V.
  • sendcloud-connected-shipping/trunk/vendor/autoload.php

    r3381752 r3389705  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    if (!headers_sent()) {
     7        header('HTTP/1.1 500 Internal Server Error');
     8    }
     9    $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
     10    if (!ini_get('display_errors')) {
     11        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
     12            fwrite(STDERR, $err);
     13        } elseif (!headers_sent()) {
     14            echo $err;
     15        }
     16    }
     17    trigger_error(
     18        $err,
     19        E_USER_ERROR
     20    );
     21}
     22
    523require_once __DIR__ . '/composer/autoload_real.php';
    624
    7 return ComposerAutoloaderInit9c50fdbcac5d18c35949c84dab27a224::getLoader();
     25return ComposerAutoloaderInit799da1d7fc2f83b97f37781f90812d9d::getLoader();
  • sendcloud-connected-shipping/trunk/vendor/composer/ClassLoader.php

    r3336392 r3389705  
    4343class ClassLoader
    4444{
    45     /** @var ?string */
     45    /** @var \Closure(string):void */
     46    private static $includeFile;
     47
     48    /** @var string|null */
    4649    private $vendorDir;
    4750
    4851    // PSR-4
    4952    /**
    50      * @var array[]
    51      * @psalm-var array<string, array<string, int>>
     53     * @var array<string, array<string, int>>
    5254     */
    5355    private $prefixLengthsPsr4 = array();
    5456    /**
    55      * @var array[]
    56      * @psalm-var array<string, array<int, string>>
     57     * @var array<string, list<string>>
    5758     */
    5859    private $prefixDirsPsr4 = array();
    5960    /**
    60      * @var array[]
    61      * @psalm-var array<string, string>
     61     * @var list<string>
    6262     */
    6363    private $fallbackDirsPsr4 = array();
     
    6565    // PSR-0
    6666    /**
    67      * @var array[]
    68      * @psalm-var array<string, array<string, string[]>>
     67     * List of PSR-0 prefixes
     68     *
     69     * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
     70     *
     71     * @var array<string, array<string, list<string>>>
    6972     */
    7073    private $prefixesPsr0 = array();
    7174    /**
    72      * @var array[]
    73      * @psalm-var array<string, string>
     75     * @var list<string>
    7476     */
    7577    private $fallbackDirsPsr0 = array();
     
    7981
    8082    /**
    81      * @var string[]
    82      * @psalm-var array<string, string>
     83     * @var array<string, string>
    8384     */
    8485    private $classMap = array();
     
    8889
    8990    /**
    90      * @var bool[]
    91      * @psalm-var array<string, bool>
     91     * @var array<string, bool>
    9292     */
    9393    private $missingClasses = array();
    9494
    95     /** @var ?string */
     95    /** @var string|null */
    9696    private $apcuPrefix;
    9797
    9898    /**
    99      * @var self[]
     99     * @var array<string, self>
    100100     */
    101101    private static $registeredLoaders = array();
    102102
    103103    /**
    104      * @param ?string $vendorDir
     104     * @param string|null $vendorDir
    105105     */
    106106    public function __construct($vendorDir = null)
    107107    {
    108108        $this->vendorDir = $vendorDir;
    109     }
    110 
    111     /**
    112      * @return string[]
     109        self::initializeIncludeClosure();
     110    }
     111
     112    /**
     113     * @return array<string, list<string>>
    113114     */
    114115    public function getPrefixes()
     
    122123
    123124    /**
    124      * @return array[]
    125      * @psalm-return array<string, array<int, string>>
     125     * @return array<string, list<string>>
    126126     */
    127127    public function getPrefixesPsr4()
     
    131131
    132132    /**
    133      * @return array[]
    134      * @psalm-return array<string, string>
     133     * @return list<string>
    135134     */
    136135    public function getFallbackDirs()
     
    140139
    141140    /**
    142      * @return array[]
    143      * @psalm-return array<string, string>
     141     * @return list<string>
    144142     */
    145143    public function getFallbackDirsPsr4()
     
    149147
    150148    /**
    151      * @return string[] Array of classname => path
    152      * @psalm-return array<string, string>
     149     * @return array<string, string> Array of classname => path
    153150     */
    154151    public function getClassMap()
     
    158155
    159156    /**
    160      * @param string[] $classMap Class to filename map
    161      * @psalm-param array<string, string> $classMap
     157     * @param array<string, string> $classMap Class to filename map
    162158     *
    163159     * @return void
     
    176172     * appending or prepending to the ones previously set for this prefix.
    177173     *
    178      * @param string          $prefix  The prefix
    179      * @param string[]|string $paths   The PSR-0 root directories
    180      * @param bool            $prepend Whether to prepend the directories
     174     * @param string              $prefix  The prefix
     175     * @param list<string>|string $paths   The PSR-0 root directories
     176     * @param bool                $prepend Whether to prepend the directories
    181177     *
    182178     * @return void
     
    184180    public function add($prefix, $paths, $prepend = false)
    185181    {
     182        $paths = (array) $paths;
    186183        if (!$prefix) {
    187184            if ($prepend) {
    188185                $this->fallbackDirsPsr0 = array_merge(
    189                     (array) $paths,
     186                    $paths,
    190187                    $this->fallbackDirsPsr0
    191188                );
     
    193190                $this->fallbackDirsPsr0 = array_merge(
    194191                    $this->fallbackDirsPsr0,
    195                     (array) $paths
     192                    $paths
    196193                );
    197194            }
     
    202199        $first = $prefix[0];
    203200        if (!isset($this->prefixesPsr0[$first][$prefix])) {
    204             $this->prefixesPsr0[$first][$prefix] = (array) $paths;
     201            $this->prefixesPsr0[$first][$prefix] = $paths;
    205202
    206203            return;
     
    208205        if ($prepend) {
    209206            $this->prefixesPsr0[$first][$prefix] = array_merge(
    210                 (array) $paths,
     207                $paths,
    211208                $this->prefixesPsr0[$first][$prefix]
    212209            );
     
    214211            $this->prefixesPsr0[$first][$prefix] = array_merge(
    215212                $this->prefixesPsr0[$first][$prefix],
    216                 (array) $paths
     213                $paths
    217214            );
    218215        }
     
    223220     * appending or prepending to the ones previously set for this namespace.
    224221     *
    225      * @param string          $prefix  The prefix/namespace, with trailing '\\'
    226      * @param string[]|string $paths   The PSR-4 base directories
    227      * @param bool            $prepend Whether to prepend the directories
     222     * @param string              $prefix  The prefix/namespace, with trailing '\\'
     223     * @param list<string>|string $paths   The PSR-4 base directories
     224     * @param bool                $prepend Whether to prepend the directories
    228225     *
    229226     * @throws \InvalidArgumentException
     
    233230    public function addPsr4($prefix, $paths, $prepend = false)
    234231    {
     232        $paths = (array) $paths;
    235233        if (!$prefix) {
    236234            // Register directories for the root namespace.
    237235            if ($prepend) {
    238236                $this->fallbackDirsPsr4 = array_merge(
    239                     (array) $paths,
     237                    $paths,
    240238                    $this->fallbackDirsPsr4
    241239                );
     
    243241                $this->fallbackDirsPsr4 = array_merge(
    244242                    $this->fallbackDirsPsr4,
    245                     (array) $paths
     243                    $paths
    246244                );
    247245            }
     
    253251            }
    254252            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
    255             $this->prefixDirsPsr4[$prefix] = (array) $paths;
     253            $this->prefixDirsPsr4[$prefix] = $paths;
    256254        } elseif ($prepend) {
    257255            // Prepend directories for an already registered namespace.
    258256            $this->prefixDirsPsr4[$prefix] = array_merge(
    259                 (array) $paths,
     257                $paths,
    260258                $this->prefixDirsPsr4[$prefix]
    261259            );
     
    264262            $this->prefixDirsPsr4[$prefix] = array_merge(
    265263                $this->prefixDirsPsr4[$prefix],
    266                 (array) $paths
     264                $paths
    267265            );
    268266        }
     
    273271     * replacing any others previously set for this prefix.
    274272     *
    275      * @param string          $prefix The prefix
    276      * @param string[]|string $paths  The PSR-0 base directories
     273     * @param string              $prefix The prefix
     274     * @param list<string>|string $paths  The PSR-0 base directories
    277275     *
    278276     * @return void
     
    291289     * replacing any others previously set for this namespace.
    292290     *
    293      * @param string          $prefix The prefix/namespace, with trailing '\\'
    294      * @param string[]|string $paths  The PSR-4 base directories
     291     * @param string              $prefix The prefix/namespace, with trailing '\\'
     292     * @param list<string>|string $paths  The PSR-4 base directories
    295293     *
    296294     * @throws \InvalidArgumentException
     
    426424    {
    427425        if ($file = $this->findFile($class)) {
    428             includeFile($file);
     426            $includeFile = self::$includeFile;
     427            $includeFile($file);
    429428
    430429            return true;
     
    477476
    478477    /**
    479      * Returns the currently registered loaders indexed by their corresponding vendor directories.
    480      *
    481      * @return self[]
     478     * Returns the currently registered loaders keyed by their corresponding vendor directories.
     479     *
     480     * @return array<string, self>
    482481     */
    483482    public static function getRegisteredLoaders()
     
    556555        return false;
    557556    }
     557
     558    /**
     559     * @return void
     560     */
     561    private static function initializeIncludeClosure()
     562    {
     563        if (self::$includeFile !== null) {
     564            return;
     565        }
     566
     567        /**
     568         * Scope isolated include.
     569         *
     570         * Prevents access to $this/self from included files.
     571         *
     572         * @param  string $file
     573         * @return void
     574         */
     575        self::$includeFile = \Closure::bind(static function($file) {
     576            include $file;
     577        }, null, null);
     578    }
    558579}
    559 
    560 /**
    561  * Scope isolated include.
    562  *
    563  * Prevents access to $this/self from included files.
    564  *
    565  * @param  string $file
    566  * @return void
    567  * @private
    568  */
    569 function includeFile($file)
    570 {
    571     include $file;
    572 }
  • sendcloud-connected-shipping/trunk/vendor/composer/InstalledVersions.php

    r3336392 r3389705  
    2222 *
    2323 * To require its presence, you can require `composer-runtime-api ^2.0`
     24 *
     25 * @final
    2426 */
    2527class InstalledVersions
     
    2729    /**
    2830     * @var mixed[]|null
    29      * @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<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
     31     * @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
    3032     */
    3133    private static $installed;
    3234
    3335    /**
     36     * @var bool
     37     */
     38    private static $installedIsLocalDir;
     39
     40    /**
    3441     * @var bool|null
    3542     */
     
    3845    /**
    3946     * @var array[]
    40      * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     47     * @psalm-var array<string, 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[]}>}>
    4148     */
    4249    private static $installedByVendor = array();
     
    97104        foreach (self::getInstalled() as $installed) {
    98105            if (isset($installed['versions'][$packageName])) {
    99                 return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
     106                return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
    100107            }
    101108        }
     
    118125    public static function satisfies(VersionParser $parser, $packageName, $constraint)
    119126    {
    120         $constraint = $parser->parseConstraints($constraint);
     127        $constraint = $parser->parseConstraints((string) $constraint);
    121128        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
    122129
     
    242249    /**
    243250     * @return array
    244      * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
     251     * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
    245252     */
    246253    public static function getRootPackage()
     
    256263     * @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.
    257264     * @return array[]
    258      * @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<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
     265     * @psalm-return 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[]}>}
    259266     */
    260267    public static function getRawData()
     
    279286     *
    280287     * @return array[]
    281      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     288     * @psalm-return list<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[]}>}>
    282289     */
    283290    public static function getAllRawData()
     
    302309     * @return void
    303310     *
    304      * @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<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
     311     * @psalm-param 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[]}>} $data
    305312     */
    306313    public static function reload($data)
     
    308315        self::$installed = $data;
    309316        self::$installedByVendor = array();
     317
     318        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     319        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     320        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     321        // all installed packages for example
     322        self::$installedIsLocalDir = false;
    310323    }
    311324
    312325    /**
    313326     * @return array[]
    314      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     327     * @psalm-return list<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[]}>}>
    315328     */
    316329    private static function getInstalled()
     
    321334
    322335        $installed = array();
     336        $copiedLocalDir = false;
    323337
    324338        if (self::$canGetVendors) {
     339            $selfDir = strtr(__DIR__, '\\', '/');
    325340            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     341                $vendorDir = strtr($vendorDir, '\\', '/');
    326342                if (isset(self::$installedByVendor[$vendorDir])) {
    327343                    $installed[] = self::$installedByVendor[$vendorDir];
    328344                } elseif (is_file($vendorDir.'/composer/installed.php')) {
    329                     $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
    330                     if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    331                         self::$installed = $installed[count($installed) - 1];
     345                    /** @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 */
     346                    $required = require $vendorDir.'/composer/installed.php';
     347                    self::$installedByVendor[$vendorDir] = $required;
     348                    $installed[] = $required;
     349                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
     350                        self::$installed = $required;
     351                        self::$installedIsLocalDir = true;
    332352                    }
     353                }
     354                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     355                    $copiedLocalDir = true;
    333356                }
    334357            }
     
    339362            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
    340363            if (substr(__DIR__, -8, 1) !== 'C') {
    341                 self::$installed = require __DIR__ . '/installed.php';
     364                /** @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 */
     365                $required = require __DIR__ . '/installed.php';
     366                self::$installed = $required;
    342367            } else {
    343368                self::$installed = array();
    344369            }
    345370        }
    346         $installed[] = self::$installed;
     371
     372        if (self::$installed !== array() && !$copiedLocalDir) {
     373            $installed[] = self::$installed;
     374        }
    347375
    348376        return $installed;
  • sendcloud-connected-shipping/trunk/vendor/composer/LICENSE

    r3336392 r3389705  
     1
    12Copyright (c) Nils Adermann, Jordi Boggiano
    23
     
    1819OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    1920THE SOFTWARE.
     21
  • sendcloud-connected-shipping/trunk/vendor/composer/autoload_classmap.php

    r3336392 r3389705  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • sendcloud-connected-shipping/trunk/vendor/composer/autoload_namespaces.php

    r3336392 r3389705  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • sendcloud-connected-shipping/trunk/vendor/composer/autoload_psr4.php

    r3336392 r3389705  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • sendcloud-connected-shipping/trunk/vendor/composer/autoload_real.php

    r3381752 r3389705  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit9c50fdbcac5d18c35949c84dab27a224
     5class ComposerAutoloaderInit799da1d7fc2f83b97f37781f90812d9d
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit9c50fdbcac5d18c35949c84dab27a224', 'loadClassLoader'), true, true);
    28         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit9c50fdbcac5d18c35949c84dab27a224', 'loadClassLoader'));
     27        spl_autoload_register(array('ComposerAutoloaderInit799da1d7fc2f83b97f37781f90812d9d', 'loadClassLoader'), true, true);
     28        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit799da1d7fc2f83b97f37781f90812d9d', 'loadClassLoader'));
    3030
    31         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
    32         if ($useStaticLoader) {
    33             require __DIR__ . '/autoload_static.php';
    34 
    35             call_user_func(\Composer\Autoload\ComposerStaticInit9c50fdbcac5d18c35949c84dab27a224::getInitializer($loader));
    36         } else {
    37             $map = require __DIR__ . '/autoload_namespaces.php';
    38             foreach ($map as $namespace => $path) {
    39                 $loader->set($namespace, $path);
    40             }
    41 
    42             $map = require __DIR__ . '/autoload_psr4.php';
    43             foreach ($map as $namespace => $path) {
    44                 $loader->setPsr4($namespace, $path);
    45             }
    46 
    47             $classMap = require __DIR__ . '/autoload_classmap.php';
    48             if ($classMap) {
    49                 $loader->addClassMap($classMap);
    50             }
    51         }
     31        require __DIR__ . '/autoload_static.php';
     32        call_user_func(\Composer\Autoload\ComposerStaticInit799da1d7fc2f83b97f37781f90812d9d::getInitializer($loader));
    5233
    5334        $loader->register(true);
  • sendcloud-connected-shipping/trunk/vendor/composer/autoload_static.php

    r3381752 r3389705  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit9c50fdbcac5d18c35949c84dab27a224
     7class ComposerStaticInit799da1d7fc2f83b97f37781f90812d9d
    88{
    99    public static $classMap = array (
     
    7272    {
    7373        return \Closure::bind(function () use ($loader) {
    74             $loader->classMap = ComposerStaticInit9c50fdbcac5d18c35949c84dab27a224::$classMap;
     74            $loader->classMap = ComposerStaticInit799da1d7fc2f83b97f37781f90812d9d::$classMap;
    7575
    7676        }, null, ClassLoader::class);
  • sendcloud-connected-shipping/trunk/vendor/composer/installed.php

    r3381752 r3389705  
    11<?php return array(
    22    'root' => array(
     3        'name' => 'sendcloud/woocommerce',
    34        'pretty_version' => 'dev-main',
    45        'version' => 'dev-main',
     6        'reference' => 'b03c2e08f518aaf80b2602db2b78fbdd8f036b5f',
    57        'type' => 'library',
    68        'install_path' => __DIR__ . '/../../',
    79        'aliases' => array(),
    8         'reference' => '5e61bf9cf645cf75bc09be91d1a7d92b20ece53d',
    9         'name' => 'sendcloud/woocommerce',
    1010        'dev' => false,
    1111    ),
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
     16            'reference' => 'b03c2e08f518aaf80b2602db2b78fbdd8f036b5f',
    1617            'type' => 'library',
    1718            'install_path' => __DIR__ . '/../../',
    1819            'aliases' => array(),
    19             'reference' => '5e61bf9cf645cf75bc09be91d1a7d92b20ece53d',
    2020            'dev_requirement' => false,
    2121        ),
Note: See TracChangeset for help on using the changeset viewer.