dubpub/publisher

There is no license information available for the latest version (1.1.1) of this package.

Publisher for assets/configs

1.1.1 2016-02-27 21:45 UTC

This package is not auto-updated.

Last update: 2024-11-23 20:20:29 UTC


README

#.publisher

Package for publishing or linking files from composer's dependencies.

Latest Stable Version Total Downloads Latest Unstable Version Build Status Coverage Status Code Climate

##Install

.publisher can be installed from composer:

{
    "require": {
        "dubpub/publisher": "1.*"
    }
}

Once .publisher is installed, it's executable is available from vendor/bin folder, simply run command to check the installation:

$> vendor/bin/publisher

##Schemas and syntax

By default publisher supports following formats: *.php, *.json, *.yaml, *.yml. Schema must consists of 3 levels - package names, which contains group names, which contains file notations.

  • package name
    • file group name
      • file notation

File notation examples:

####PHP example

<?php // .publisher.php
return [
    "myvendor/mypackage" => [
        "assets" => [
            "assets/css/* -> {public/web}/assets/styles/"
        ],
        "bin" => [
          "@bin/executableFile -> bin/"
        ]
    ]
];

####JSON example

{
  "myvendor/mypackage": {
    "assets": [
      "assets/css/* -> {public/web}/assets/styles/"
    ],
    "bin": [
      "@bin/executableFile -> bin/"
    ]
  }
}

####INI example

[myvendor/mypackage]
assets[] = "assets/css/* -> {public/web}/assets/styles"
bin[] = "@bin/executableFile -> bin/"

####YML,YAML example

myvendor/mypackage:
    assets:
        - 'assets/css/* ->  {public/web}/assets/styles/'
    bin:
        - '@bin/executableFile -> bin/'

##Usage in package Simply initiate .publisher file an fill it with contents you need, according to examples above and place it into folder where your project's composer.json is located. Note, that .publisher will not work if composer.json file or vendor/ folder don't exists.

##Usage in project After installing .publisher into your project you need to generate .publisher file or create it manually. Use init command to generate .publisher file:

$MyProject> vendor/bin/publisher init

init command will generate .publisher file and perform scanning vendor/ folder for other .publisher files to merge them into new generated one.

If you want to generate .publisher file with specific format(default is php), you need to specify it:

$MyProject> vendor/bin/publisher init

Note, that every init call does not recreate or overwrite your (project/package)'s file section, .publisher simply merges and updates other sections.

After your .publisher file is generated it's ready to use:

For publishing every .publisher dependency:

$MyProject> vendor/bin/publisher publish

or:

$> vendor/bin/publisher publish "*"

For publishing specific package:

$> vendor/bin/publisher publish acmevendor/acmepackage

For publishing specific package's group:

$> vendor/bin/publisher publish acmevendor/acmepackage assets

For publishing specific packages' groups:

$> vendor/bin/publisher publish acmevendor/acmepackage,acmevendor1/acmepackage1 assets,configs