azt3k/non-destructive-archive-installer 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

azt3k/non-destructive-archive-installer

Composer 安装命令:

composer require azt3k/non-destructive-archive-installer

包简介

A composer installer type that allows you to unpack archives to a specific location in a non destructive way - it is very useful when some packages need to be installed inside another package folder - e.g. drupal and modules

README 文档

README

What's in this thing Anyway?

This really only does something very simple which is to manually handle the decompression of manually defined packages so as to not disrupt nested package installs. This is basically a straight rip of mouf/archive-installer (http://mouf-php.com), the only difference is that it's made to be slightly more flexible in terms of configuration.

Notes:

"always-install": "true" - This bypasses the version look up and does a full install every time useful for deployments where depenedencies are rebuilt each deploy - the default is true.

"omit-first-directory": "true" - This omits the first directory of the zip

Usage

{
    "name": "namespace/package-name",
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "drupal/drupal",
                "type": "non-destructive-archive-installer",
                "version": "7.28",
                "dist": {
                    "url": "http://ftp.drupal.org/files/projects/drupal-7.28.zip",
                    "type": "zip"
                },
                "require": {
                    "azt3k/non-destructive-archive-installer" : "*"
                },
                "extra": {
                    "always-install": "true",
                    "omit-first-directory": "true",
                    "debug": "false"
                }
            }
        }
    ],
    "require": {
        "php"                                       : ">=5.4.0",
        "composer/installers"                       : ">=1.0",
        "azt3k/non-destructive-archive-installer"   : "dev-master",
        "drupal/drupal"                             : "7.28"
    },
    "extra": {
        "installer-paths": {
            "public": [
                "drupal/drupal"
            ]
        }
    }
}

Or:

{
    "name": "namespace/package-name",
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "drupal/drupal",
                "type": "non-destructive-archive-installer",
                "version": "7.28",
                "dist": {
                    "url": "http://ftp.drupal.org/files/projects/drupal-7.28.zip",
                    "type": "zip"
                },
                "require": {
                    "azt3k/non-destructive-archive-installer" : "*"
                }
            },
            "extra": {
                "target-dir": "public",
                "omit-first-directory": "true"
            }
        }
    ],
    "require": {
        "php"                                       : ">=5.4.0",
        "composer/installers"                       : ">=1.0",
        "azt3k/non-destructive-archive-installer"   : "dev-master",
        "drupal/drupal"                             : "7.28"
    }
}

A practical example of why you might want to do this is for managing drupal depenedencies, e.g.

{
    "name": "namespace/package-name",
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "drupal/drupal",
                "type": "non-destructive-archive-installer",
                "version": "7.28",
                "dist": {
                    "url": "http://ftp.drupal.org/files/projects/drupal-7.28.zip",
                    "type": "zip"
                },
                "require": {
                    "azt3k/non-destructive-archive-installer" : "*"
                },
                "extra": {
                    "omit-first-directory": "true"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "drupal/drupal-ckeditor",
                "type": "drupal-module",
                "version": "7.1.14",
                "dist": {
                    "url": "http://ftp.drupal.org/files/projects/ckeditor-7.x-1.14.zip",
                    "type": "zip"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "ckeditor/ckeditor",
                "type": "drupal-module",
                "version": "4.2.2",
                "dist": {
                    "url": "http://download.cksource.com/CKEditor/CKEditor/CKEditor%204.2.2/ckeditor_4.2.2_full.zip",
                    "type": "zip"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "drupal/entity",
                "type": "drupal-module",
                "version": "7.1.5",
                "dist": {
                    "url": "http://ftp.drupal.org/files/projects/entity-7.x-1.5.zip",
                    "type": "zip"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "drupal/jquery-update",
                "type": "drupal-module",
                "version": "7.2.4",
                "dist": {
                    "url": "http://ftp.drupal.org/files/projects/jquery_update-7.x-2.4.zip",
                    "type": "zip"
                }
            }
        }
    ],
    "require": {
        "php"                                       : ">=5.4.0",
        "composer/installers"                       : ">=1.0.9",
        "azt3k/non-destructive-archive-installer"   : "dev-master",
        "symfony/yaml"                              : "dev-master",
        "drush/drush"                               : "6.2.0",
        "drupal/drupal"                             : "7.28",
        "drupal/entity"                             : "7.1.5",
        "drupal/drupal-ckeditor"                    : "7.1.14",
        "drupal/jquery-update"                      : "7.2.4",
        "ckeditor/ckeditor"                         : "4.2.2",
        "d11wtq/boris"                              : "dev-master"
    },
    "extra": {
        "installer-paths": {
            "public/sites/all/modules/{$name}": [
                "drupal/drupal-ckeditor",
                "drupal/entity",
                "drupal/jquery-update"
            ],
            "public/sites/all/libraries/{$name}" : [
                "ckeditor/ckeditor"
            ],
            "public": [
                "drupal/drupal"
            ]
        }
    },
    "scripts": {
        "post-update-cmd": [
            "rm -f public/.gitignore",
            "rm -f public/CHANGELOG.txt public/COPYRIGHT.txt public/INSTALL.mysql.txt public/INSTALL.pgsql.txt public/INSTALL.sqlite.txt public/INSTALL.txt public/LICENSE.txt public/MAINTAINERS.txt public/README.txt public/UPGRADE.txt public/download-status.txt public/web.config public/modules/README.txt"
        ],
        "post-install-cmd": [
            "rm -f public/.gitignore",
            "rm -f public/CHANGELOG.txt public/COPYRIGHT.txt public/INSTALL.mysql.txt public/INSTALL.pgsql.txt public/INSTALL.sqlite.txt public/INSTALL.txt public/LICENSE.txt public/MAINTAINERS.txt public/README.txt public/UPGRADE.txt public/download-status.txt public/web.config public/modules/README.txt"
        ]
    }
}

Gotchas

You need to make sure the target install directory exists first or the unpack will fail.

统计信息

  • 总下载量: 4.22k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-11-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固