Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /var/www/html/plugins/system/falangdriver/falangdriver.php on line 534

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/plugins/system/t4/src/t4/MVC/Router/T4.php on line 388
创建正确格式的压缩包 - Bluetooth forum - bluetooth蓝牙技术

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/components/com_comprofiler/plugin/user/plug_cbjdownloads/cbjdownloads.php on line 49

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/components/com_comprofiler/plugin/user/plug_cbblogs/cbblogs.php on line 48

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/components/com_comprofiler/plugin/user/plug_cbarticles/cbarticles.php on line 47

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 217

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 219

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 227

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 231

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 234

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239
Technical discuss

创建正确格式的压缩包


Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

  • Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 189

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239
    service
  • [
    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 189

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239
    service]

  • Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 189

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239
    Topic Author

  • Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 189

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239
    Offline
  • Administrator
  • Administrator
More
07 Jan 2026 17:31 #998
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 189

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239
by service
New Topic
方法 A:如果扩展文件在文件夹中# 假设您的扩展文件在文件夹 /var/www/html/pkg_evcharging_files/
Code:
cd /var/www/html/pkg_evcharging_files/

# 创建压缩包,包含文件夹内的所有内容
Code:
sudo zip -r ../pkg_evcharging_correct.zip .

# 检查新压缩包
Code:
cd .. unzip -l pkg_evcharging_correct.zip | head -10
方法 B:如果您已经解压了扩展# 创建临时工作目录
Code:
mkdir -p /tmp/repack cd /tmp/repack

# 解压原始压缩包
Code:
unzip /var/www/html/pkg_evcharging.zip

# 查看解压后的结构
Code:
find . -type f -name "*.xml" | head -5 ls -la

# 如果是错误的嵌套结构,进入内层文件夹
# 假设解压后有一个文件夹,进入它
Code:
cd pkg_evcharging  # 如果有这个文件夹

# 重新压缩,确保在正确的目录层级
Code:
sudo zip -r /var/www/html/pkg_evcharging_correct.zip .
方法 C:一步到位的命令# 假设原始压缩包解压后有一个文件夹
Code:
cd /tmp mkdir -p repack_temp cd repack_temp unzip /var/www/html/pkg_evcharging.zip

# 查找 xml 文件确定结构
Code:
XML_FILE=$(find . -name "*.xml" -type f | head -1) echo "找到 XML 文件: $XML_FILE"

# 进入包含 XML 文件的目录
# 如果 XML 文件在子目录,进入该目录
Code:
cd $(dirname "$XML_FILE")

# 创建新的正确压缩包
Code:
sudo zip -r /var/www/html/pkg_evcharging_fixed.zip .
Code:
echo "新压缩包已创建: /var/www/html/pkg_evcharging_fixed.zip"
4. 验证压缩包结构
# 查看新压缩包的结构
Code:
unzip -l /var/www/html/pkg_evcharging_fixed.zip | head -20

# 检查是否有 XML 文件在根目录
Code:
unzip -l /var/www/html/pkg_evcharging_fixed.zip | grep "\.xml$" | head -5

# 临时解压查看结构
Code:
mkdir -p /tmp/verify cd /tmp/verify unzip /var/www/html/pkg_evcharging_fixed.zip ls -la  find . -maxdepth 1 -name "*.xml"
6. 如果扩展包是多个扩展的组合包有些 Joomla 扩展包包含多个扩展(组件、模块、插件等)。需要确保压缩包根目录有 
Code:
pkg_*.xml
 文件。
# 检查是否为包类型扩展
Code:
unzip -p /var/www/html/pkg_evcharging_fixed.zip pkg_*.xml 2>/dev/null | head -20

# 或者列出所有可能的 manifest
Code:
unzip -l /var/www/html/pkg_evcharging_fixed.zip | grep -E "(pkg_|com_|mod_|plg_|tpl_)" | grep "\.xml$"
7. 修复脚本:自动检测和修复压缩包#!/bin/bash
echo "=== Joomla 扩展包修复脚本 ==="

# 原始压缩包
SOURCE_ZIP="/var/www/html/pkg_evcharging.zip"
# 修复后的压缩包
FIXED_ZIP="/var/www/html/pkg_evcharging_fixed.zip"

# 1. 创建临时目录
TEMP_DIR=$(mktemp -d)
cd "$TEMP_DIR"

# 2. 解压原始压缩包
echo "解压原始压缩包..."
unzip -q "$SOURCE_ZIP"

# 3. 查找 XML manifest 文件
echo "查找 XML manifest 文件..."
XML_FILES=$(find . -name "*.xml" -type f)
if [ -z "$XML_FILES" ]; then
    echo "❌ 错误: 未找到 XML manifest 文件"
    exit 1
fi

echo "找到 XML 文件:"
echo "$XML_FILES"

# 4. 确定根目录
# 获取第一个 XML 文件的目录
FIRST_XML=$(echo "$XML_FILES" | head -1)
XML_DIR=$(dirname "$FIRST_XML")

echo "XML 文件目录: $XML_DIR"

# 5. 进入包含 XML 文件的目录
cd "$XML_DIR"

# 6. 检查当前目录是否包含 XML 文件(应该在根目录)
CURRENT_XML=$(find . -maxdepth 1 -name "*.xml")
if [ -n "$CURRENT_XML" ]; then
    echo "✅ XML 文件在根目录,正在创建正确格式的压缩包..."
    
    # 7. 创建新压缩包
    sudo zip -r "$FIXED_ZIP" .
    
    echo "✅ 新压缩包已创建: $FIXED_ZIP"
    
    # 8. 显示新压缩包结构
    echo "新压缩包结构:"
    unzip -l "$FIXED_ZIP" | head -20
    
    # 9. 尝试安装
    echo "尝试安装..."
    cd /var/www/html
    sudo php cli/joomla.php extension:install --path=./pkg_evcharging_fixed.zip
else
    echo "❌ XML 文件不在当前目录根目录,请手动检查结构"
    echo "当前目录内容:"
    ls -la
fi

# 10. 清理
cd /
rm -rf "$TEMP_DIR"

echo "=== 脚本执行完成 ==="

保存并运行:
Code:
chmod +x /tmp/fix_joomla_package.sh sudo /tmp/fix_joomla_package.sh
8. 手动创建压缩包的完整示例假设您的扩展文件在 
Code:
/var/www/html/evcharging_extension/
 目录中:
# 进入扩展目录
Code:
cd /var/www/html/evcharging_extension/

# 查看目录结构
Code:
ls -la

# 应该有类似这样的结构:
# pkg_evcharging.xml
# admin/
# site/
# media/

# 创建正确的压缩包(注意最后的点表示当前目录所有文件)
Code:
sudo zip -r ../pkg_evcharging_correct.zip .

# 或者使用 tar 命令创建(Joomla 也支持 tar.gz)
Code:
sudo tar -czf ../pkg_evcharging_correct.tar.gz .

# 检查创建的文件
Code:
ls -la ../pkg_evcharging_correct.*
 9. 如果扩展是多个独立部分有些扩展包含多个独立安装包,需要分别打包:# 假设目录结构:
# evcharging/
#   ├── com_evcharging/      # 组件
#   ├── mod_evcharging/      # 模块
#   ├── plg_evcharging/      # 插件
#   └── pkg_evcharging.xml   # 包定义文件

# 进入目录
Code:
cd /var/www/html/evcharging/

# 创建包含所有内容的压缩包
Code:
sudo zip -r ../pkg_evcharging_full.zip .
 10. 验证和安装# 验证新压缩包
Code:
cd /var/www/html unzip -l pkg_evcharging_fixed.zip | grep -E "(\.xml$|pkg_|com_|mod_|plg_)" | head -10

# 列出压缩包根目录
Code:
unzip -l pkg_evcharging_fixed.zip | awk '{print $4}' | grep -v "/$" | head -10

# 安装
Code:
sudo php cli/joomla.php extension:install --path=./pkg_evcharging_fixed.zip

 

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 234

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 189

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
FaLang translation system by Faboba

Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /var/www/html/plugins/system/falangdriver/falangdriver.php on line 100

Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /var/www/html/plugins/system/falangdriver/falangdriver.php on line 100
mysqli object is already closed (500 Whoops, looks like something went wrong.)

Error

HTTP 500 Whoops, looks like something went wrong.

mysqli object is already closed

Exception

Error

  1. */
  2. public function disconnect()
  3. {
  4. // Close the connection.
  5. if (\is_callable([$this->connection, 'close'])) {
  6. $this->connection->close();
  7. }
  8. parent::disconnect();
  9. }
  1. */
  2. public function disconnect()
  3. {
  4. // Close the connection.
  5. if (\is_callable([$this->connection, 'close'])) {
  6. $this->connection->close();
  7. }
  8. parent::disconnect();
  9. }
  1. *
  2. * @since 2.0.0
  3. */
  4. public function __destruct()
  5. {
  6. $this->disconnect();
  7. }
  8. /**
  9. * Alter database's character set.
  10. *
DatabaseDriver->__destruct()

Stack Trace

Error
Error:
mysqli object is already closed

  at /var/www/html/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:318
  at mysqli->close()
     (/var/www/html/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:318)
  at Joomla\Database\Mysqli\MysqliDriver->disconnect()
     (/var/www/html/libraries/vendor/joomla/database/src/DatabaseDriver.php:496)
  at Joomla\Database\DatabaseDriver->__destruct()                

Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /var/www/html/plugins/system/falangdriver/falangdriver.php on line 100

Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /var/www/html/plugins/system/falangdriver/falangdriver.php on line 100