* [misc] Add namespace by patch to avoid class conflict with the PclZip library.

This commit is contained in:
liugang
2025-10-27 09:08:21 +08:00
parent 9bceb21c8b
commit da5b6aaf2b
11 changed files with 40 additions and 7 deletions
+5 -1
View File
@@ -40,12 +40,16 @@
},
"gorhill/php-fine-diff": {
"Fix class reference to work with namespaces": "patches/finediff-fix-class-reference.patch"
},
"pclzip/pclzip": {
"Add namespace to PclZip class": "patches/pclzip-add-namespace.patch"
}
}
},
"autoload": {
"psr-4": {
"Vendor\\Parsedown\\": "vendor/erusev/parsedown/"
"Vendor\\Parsedown\\": "vendor/erusev/parsedown/",
"Vendor\\PclZip\\": "vendor/pclzip/pclzip/"
}
}
}
+1 -1
View File
@@ -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": "062e871a7ba56633ed9dffe989091156",
"content-hash": "83abc7ef74ef8728073b749391540ae6",
"packages": [
{
"name": "box/spout",
+9
View File
@@ -0,0 +1,9 @@
--- a/vendor/pclzip/pclzip/pclzip.lib.php
+++ b/vendor/pclzip/pclzip/pclzip.lib.php
@@ -1,4 +1,6 @@
<?php
+namespace Vendor\PclZip;
+
// --------------------------------------------------------------------------------
// PhpConcept Library - Zip Module 2.8.2
// --------------------------------------------------------------------------------
+1 -1
View File
@@ -3,7 +3,7 @@ require_once dirname(__FILE__, 2) . '/base/delegate/delegate.class.php';
class pclzip extends baseDelegate
{
protected static $className = 'PclZip';
protected static $className = 'Vendor\PclZip\PclZip';
public function __construct($p_zipname)
{
+1 -1
View File
@@ -8,6 +8,6 @@ $baseDir = dirname($vendorDir);
return array(
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'Mobile_Detect' => $vendorDir . '/mobiledetect/mobiledetectlib/Mobile_Detect.php',
'PclZip' => $vendorDir . '/pclzip/pclzip/pclzip.lib.php',
'Requests' => $vendorDir . '/rmccue/requests/library/Requests.php',
'Vendor\\PclZip\\PclZip' => $vendorDir . '/pclzip/pclzip/pclzip.lib.php',
);
+1
View File
@@ -9,6 +9,7 @@ return array(
'phpseclib3\\' => array($vendorDir . '/phpseclib/phpseclib/phpseclib'),
'cweagans\\Composer\\' => array($vendorDir . '/cweagans/composer-patches/src'),
'WpOrg\\Requests\\' => array($vendorDir . '/rmccue/requests/src'),
'Vendor\\PclZip\\' => array($vendorDir . '/pclzip/pclzip'),
'Vendor\\Parsedown\\' => array($vendorDir . '/erusev/parsedown'),
'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'),
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
+6 -1
View File
@@ -88,6 +88,7 @@ class ComposerStaticIniteb70fe9ec81c9f50588dedfb7a386792
),
'V' =>
array (
'Vendor\\PclZip\\' => 14,
'Vendor\\Parsedown\\' => 17,
),
'S' =>
@@ -144,6 +145,10 @@ class ComposerStaticIniteb70fe9ec81c9f50588dedfb7a386792
array (
0 => __DIR__ . '/..' . '/rmccue/requests/src',
),
'Vendor\\PclZip\\' =>
array (
0 => __DIR__ . '/..' . '/pclzip/pclzip',
),
'Vendor\\Parsedown\\' =>
array (
0 => __DIR__ . '/..' . '/erusev/parsedown',
@@ -245,8 +250,8 @@ class ComposerStaticIniteb70fe9ec81c9f50588dedfb7a386792
public static $classMap = array (
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'Mobile_Detect' => __DIR__ . '/..' . '/mobiledetect/mobiledetectlib/Mobile_Detect.php',
'PclZip' => __DIR__ . '/..' . '/pclzip/pclzip/pclzip.lib.php',
'Requests' => __DIR__ . '/..' . '/rmccue/requests/library/Requests.php',
'Vendor\\PclZip\\PclZip' => __DIR__ . '/..' . '/pclzip/pclzip/pclzip.lib.php',
);
public static function getInitializer(ClassLoader $loader)
+5
View File
@@ -1105,6 +1105,11 @@
},
"time": "2014-06-05T11:42:24+00:00",
"type": "library",
"extra": {
"patches_applied": {
"Add namespace to PclZip class": "patches/pclzip-add-namespace.patch"
}
},
"installation-source": "dist",
"autoload": {
"classmap": [
+2 -2
View File
@@ -5,7 +5,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => 'a25da45b71dd97cd376b604d92a798a231173c51',
'reference' => '11f502ebbcf959c37faa8ad3fc93cc6326e60acd',
'name' => '__root__',
'dev' => true,
),
@@ -16,7 +16,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => 'a25da45b71dd97cd376b604d92a798a231173c51',
'reference' => '11f502ebbcf959c37faa8ad3fc93cc6326e60acd',
'dev_requirement' => false,
),
'box/spout' => array(
+7
View File
@@ -0,0 +1,7 @@
This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches)
Patches applied to this directory:
Add namespace to PclZip class
Source: patches/pclzip-add-namespace.patch
+2
View File
@@ -1,4 +1,6 @@
<?php
namespace Vendor\PclZip;
// --------------------------------------------------------------------------------
// PhpConcept Library - Zip Module 2.8.2
// --------------------------------------------------------------------------------