2017 © Pedro Peláez
 

composer-plugin zf-asset-manager

Composer plugin for copying module assets into application document roots.

image

zfcampus/zf-asset-manager

Composer plugin for copying module assets into application document roots.

  • Thursday, November 2, 2017
  • by zendframework
  • Repository
  • 7 Watchers
  • 9 Stars
  • 86,071 Installations
  • PHP
  • 4 Dependents
  • 2 Suggesters
  • 6 Forks
  • 1 Open issues
  • 7 Versions
  • 18 % Grown

The README.md

zf-asset-manager

Repository abandoned 2019-12-31

This repository has moved to laminas-api-tools/api-tools-asset-manager., (*1)

Build Status, (*2)

zf-asset-manager is a composer plugin that will copy configured web-accessible assets into the public document root of your Zend Framework application. It uses the configuration format of rwoverdijk/AssetManager, and specifically the subset:, (*3)

'asset_manager' => [
    'resolver_configs' => [
        'paths' => [
            /* paths containing asset directories */
        ],
    ],
],

Each configured path is iterated, and every path under it is then copied into the public tree., (*4)

Installation

$ composer require --dev zfcampus/zf-asset-manager

We recommend usage of this module primarily for development purposes. In most cases, assets from third-party modules should be overridden with project-specific assets when preparing for production. To emphasize this, the assets are excluded from your git repository by default. (You may add them manually later, as explained below.), (*5)

Example

As an example, given the following directory structure inside a package:, (*6)

./
- asset/
  - README.md
  - gruntfile.js
  - package.json
  - zf-apigility/
    - css/
      - bootstrap.min.css
    - img/
      - logo.png
    - js/
      - bootstrap.min.js
      - jquery.min.js
  - zf-apigility-welcome/
    - css/
      - main.min.css
    - img/
      - ag-hero.png
- config/
  - module.config.php

where module.config.php defines (minimally) the following:, (*7)

return [
    'asset_manager' => [
        'resolver_configs' => [
            'paths' => [
                __DIR__ . '/../asset/'
            ],
        ],
    ],
]

When you install the package, the asset manager will copy each of the asset/zf-apigility/ and asset/zf-apigility-welcome/ trees to the project's public/ path. The individual files asset/README.md, asset/gruntfile.js, and asset/package.json are omitted from the install, as they are not directories., (*8)

Additionally, during installation, the plugin adds a .gitignore file to the public/ path, listing each of the new directories:, (*9)

# public/.gitignore
zf-apigility/
zf-apigility-welcome/

After installation, you may access any of the assets installed relative to the public root., (*10)

Uninstallation

When you remove the module, the plugin will:, (*11)

  • Remove any asset trees configured for the module from the public tree.
  • Remove the .gitignore entries associated with those asset trees from the public/.gitignore file.

Keeping assets

Assets are marked by Git to ignore by default. The intention of this module is primarily for development purposes; it was developed to allow installation of assets related to the Apiglity admin UI, welcome screen, and documentation, most of which are relevant in development mode only., (*12)

However, if you wish to keep the assets in your public tree, you can do so as follows:, (*13)

  • Edit the public/.gitignore file to remove the entry for the asset tree(s) you wish to keep.
  • Add the asset tree(s) to your repository (git add public/{tree}).

Removing the entry from public/.gitignore is enough to prevent the uninstaller from removing the assets when you remove a module., (*14)

The Versions

02/11 2017

dev-develop

dev-develop

Composer plugin for copying module assets into application document roots.

  Sources   Download

BSD-3-Clause

The Requires

  • php ^5.6 || ^7.0
  • composer-plugin-api ^1.1

 

The Development Requires

02/11 2017

dev-master

9999999-dev

Composer plugin for copying module assets into application document roots.

  Sources   Download

BSD-3-Clause

The Requires

  • php ^5.6 || ^7.0
  • composer-plugin-api ^1.1

 

The Development Requires

02/11 2017

1.2.0

1.2.0.0

Composer plugin for copying module assets into application document roots.

  Sources   Download

BSD-3-Clause

The Requires

  • php ^5.6 || ^7.0
  • composer-plugin-api ^1.1

 

The Development Requires

12/08 2016

1.1.1

1.1.1.0

Composer plugin for copying module assets into application document roots.

  Sources   Download

BSD-3-Clause

The Requires

  • php ^5.6 || ^7.0
  • composer-plugin-api ^1.0

 

The Development Requires

12/08 2016

1.1.0

1.1.0.0

Composer plugin for copying module assets into application document roots.

  Sources   Download

BSD-3-Clause

The Requires

  • php ^5.6 || ^7.0
  • composer-plugin-api ^1.0

 

The Development Requires

10/08 2016

1.0.1

1.0.1.0

Composer plugin for copying module assets into application document roots.

  Sources   Download

BSD-3-Clause

The Requires

  • php ^5.6 || ^7.0
  • composer-plugin-api ^1.0

 

The Development Requires

26/07 2016

1.0.0

1.0.0.0

Composer plugin for copying module assets into application document roots.

  Sources   Download

BSD-3-Clause

The Requires

  • php ^5.6 || ^7.0
  • composer-plugin-api ^1.0

 

The Development Requires