Git Product home page Git Product logo

composer-plugin-filecopier's Introduction

Composer Plugin Files Copier

This is a very simple Composer plugin working on the post-install-cmd and post-update-cmd events for copying from a source path to a distination folder.

I created this to avoid copying manualy the bootstrap less files into a temporary folder and overriding the variables.less for generating a custom bootstrap.css file using the less filter from the symfony/assetic-bundle.

Installation / Usage

  1. In your composer.json project's file add the requirements

    {
        "require": {
            "sasedev/composer-plugin-filecopier": ">=1.1.0"
        }
    }
  2. In your composer.json project's file add the config in the extra element

    {
        "extra": {
            "filescopier" : {
                "source" : "vendor/twbs/bootstrap/less",
                "destination" : "var/less/bootstrap",
                "debug": "true"
            }
        }
    }

    or

    {
        "extra": {
            "filescopier" : [
                {
                    "source" : "vendor/twbs/bootstrap/less",
                    "destination" : "var/less/bootstrap",
                    "debug": "true"
                }, {
                    "source" : "src/Sasedev/ResBundle/Resources/less/bootstrap/*.less",
                    "destination" : "var/less/bootstrap"
                }, {
                    "source" : "/home/sasedev/Documents/*.pdf",
                    "destination" : "var/test"
                }
            ]
        }
    }

    Note: The destination element must be a folder. if the destination folder does not exists, it is recursively created using mkdir($destination, 0755, true).

    Note: If the destination folder is not an absolute path, the relative path is calculated using the vendorDir path ($project_path = \realpath($this->composer->getConfig()->get('vendor-dir').'/../').'/';)

    Note: The source element is evaluated using the php function \glob($source, GLOB_MARK) and a recursive copy is made for every result of this function into the destination folder

  3. Run Composer: php composer.phar update.

Requirements

PHP 5.5 or above (at least 5.5.9 recommended to avoid potential bugs)

Authors

Abdelkadeur Seifeddine Salah - [email protected] - http://sasedev.net

License

Composer is licensed under the MIT License - see the LICENSE file for details

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.