2017 © Pedro Peláez
 

assets-installer libra-assets-installer

Makes accessible vendor assets (js, css, images) by creating/updating symlink to public/vendor/vendor-name folder

image

libra/libra-assets-installer

Makes accessible vendor assets (js, css, images) by creating/updating symlink to public/vendor/vendor-name folder

  • Monday, January 22, 2018
  • by duke
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3,445 Installations
  • PHP
  • 10 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

Vendor Package Assets installer for Composer packages

Description

This package will help you to develop your vendor package with comfortable structure of public assets in public directory at root folder of your package. It will create symlink to this folder in public/vendor/vendor-name/package-name. So file public/css/screen.css will be accessible in view by:, (*1)

$this->basePath() . '/vendor/vendor-name/package-name/css/screen.css';

At version 2.0.0 was changed logic of installing to use custom installer and rely on package type., (*2)

  • If your package is some assets like jquery, jquery-ui or twitter-bootsrap etc., you should set up type of package to asset. Then add to require list this package like, (*3)

    {
        "name":         "vendor-name/asset-package-name",
        "type":         "asset"
        "require": {
            "libra/libra-assets-installer":     "~2.0"
        }
    }
    

    After installing assets will be in public/vendor/vendor-name/asset-package-name., (*4)

  • If you create standard ZF2 module that contains public assets into public directory
    then use "type": "asset-aware":, (*5)

    {
        "name":         "vendor-name/package-with-assets-name",
        "type":         "asset-aware"
        "require": {
            "libra/libra-assets-installer":     "~2.0"
        }
    }
    

    Then contents of package-with-assets-name/public folder will be symlinked or on failure copied to public/vendor/vendor-name/package-with-assets-name, (*6)

So URL will be the same in both cases., (*7)

Options

There available options (in format "type default"):, (*8)

  • public-dir (only in root package)
    • if you wish put asset into another folder - put its name above
  • package-asset-dir (not available for type = asset)
    • if your asset dir has another name - put it above
  • add-target-dir: bool false/true (may be suitable for symfony bundles)
    • if enabled add target dir path to public asset path
    • Since v3.0 always true, DEPRECATED.

Some example:, (*9)

    "extra": {
        "package-asset-dir": "assets"
    }

In root package:, (*10)

    {
        "config": {
            "public-dir": "httdocs",
        }
    }

Note! For Zend Framework 2 modules it don't need to set up any configurations as usually., (*11)


Instructions for ver. 1.*

Despite of its working even in version 2.* you should'n rely on it feature in late version. This feature can be removed in any time in higher version but will be present in ver. 1.*. I encourage to use ver, 2.*., (*12)

Note
For working this module you should set it first in required list in composer.json. Also supports Windows Vista/Windows Server 2008 or greater by [php documentation][1]. But really tested only under Linux. It uses symlink function hence behaviour at Windows unknown for me.

Using:

In root composer.json add this packages to required list as first item. Add this lines in root composer:, (*13)

    "scripts": {
        "post-package-install":  "LibraAssetsInstaller\\Installer::postPackageInstall",
        "pre-package-uninstall": "LibraAssetsInstaller\\Installer::prePackageUninstall",
        "post-package-update":   "LibraAssetsInstaller\\Installer::postPackageUpdate"
    }

At first It was created for Libra CMS., (*14)

The Versions

22/01 2018

dev-master

9999999-dev https://github.com/libracms/libra-assets-installer

Makes accessible vendor assets (js, css, images) by creating/updating symlink to public/vendor/vendor-name folder

  Sources   Download

BSD-3-Clause

The Development Requires

by Vitalii Nagara

zf2 installer asset

20/01 2018

2.3.0

2.3.0.0 https://github.com/libracms/libra-assets-installer

Makes accessible vendor assets (js, css, images) by creating/updating symlink to public/vendor/vendor-name folder

  Sources   Download

BSD-3-Clause

The Development Requires

by Vitalii Nagara

zf2 installer asset

15/01 2018

2.2.0

2.2.0.0 https://github.com/libracms/libra-assets-installer

Makes accessible vendor assets (js, css, images) by creating/updating symlink to public/vendor/vendor-name folder

  Sources   Download

BSD-3-Clause

The Development Requires

by Vitalii Nagara

zf2 installer asset

17/08 2015

2.1.0

2.1.0.0 https://github.com/libracms/libra-assets-installer

Makes accessible vendor assets (js, css, images) by creating/updating symlink to public/vendor/vendor-name folder

  Sources   Download

BSD-3-Clause

The Development Requires

by Vitalii Nagara

zf2 installer asset

01/05 2015

2.0.1

2.0.1.0 https://github.com/libracms/libra-assets-installer

Makes accessible vendor assets (js, css, images) by creating/updating symlink to public/vendor/vendor-name folder

  Sources   Download

BSD-3-Clause

The Development Requires

by Vitalii Nagara

zf2 installer asset

06/08 2013

dev-dev

dev-dev https://github.com/libracms/libra-assets-installer

Makes accessible vendor assets (js, css, images) by creating/updating symlink to public/vendor/vendor-name folder

  Sources   Download

BSD-3-Clause

The Development Requires

by Vitalii Nagara

zf2 installer asset

06/08 2013

2.0.0

2.0.0.0 https://github.com/libracms/libra-assets-installer

Makes accessible vendor assets (js, css, images) by creating/updating symlink to public/vendor/vendor-name folder

  Sources   Download

BSD-3-Clause

The Development Requires

by Vitalii Nagara

zf2 installer asset

11/07 2013

dev-feature/virtual-box-aware-copying

dev-feature/virtual-box-aware-copying http://www.ejoom.com/libra-cms/

Makes accessible vendor assets (js, css, images) by creating/updating symlink to public/vendor/vendor-name folder

  Sources   Download

BSD-3-Clause

by Vitalii Nagara

zf2 cms zendframework zf libra

11/07 2013

1.0.1

1.0.1.0 http://www.ejoom.com/libra-cms/

Makes accessible vendor assets (js, css, images) by creating/updating symlink to public/vendor/vendor-name folder

  Sources   Download

BSD-3-Clause

by Vitalii Nagara

zf2 cms zendframework zf libra

08/06 2013

1.0.0

1.0.0.0 http://www.ejoom.com/libra-cms/

Copies public module files (assets) to public/vendor. Used in Libra CMS

  Sources   Download

BSD-3-Clause

by Vitalii Nagara

zf2 cms zendframework zf libra