2017 © Pedro Peláez
 

library publisher

Publisher for assets/configs

image

dubpub/publisher

Publisher for assets/configs

  • Saturday, February 27, 2016
  • by dubpub
  • Repository
  • 1 Watchers
  • 0 Stars
  • 53 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

.publisher

Package for publishing or linking files from composer's dependencies., (*1)

Latest Stable Version Total Downloads Latest Unstable Version Build Status Coverage Status Code Climate, (*2)

Install

.publisher can be installed from composer:, (*3)

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

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

$> 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., (*5)

  • package name
    • file group name
      • file notation

File notation examples:, (*6)

Notation Description
assets Will copy assets/ folder, from package's directory and copy it into configured publish folder.
assets/styles.css Will copy assets/styles.css, that's located on package's folder and publish it into configured publish folder.
assets/ -> public/ Will copy assets/ folder, from package's directory and copy it into public/ directory configured publish folder.
assets -> {public,web}/ Will look up for public/ or web/ path. If neither are available, first from the list will be created. And assets/ folder, from package's directory will be copied into resulting directory.
assets/styles/* -> {public,web}/css/ Will look up for public/" or web/ path. If neither are available, first from the list will be created. And all files from folder assets/styles/ of package's directory will be copied into `{resulting directory}/css/`.
@path/to/my/link Will create link of package's path/to/my/link and place it in configured publish path.
@path/to/my/* -> bin/ Will create links of package's every file from path/to/my/ folder and place it in bin/ of configured publish path.

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., (*7)

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:, (*8)

$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., (*9)

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

$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., (*11)

After your .publisher file is generated it's ready to use:, (*12)

For publishing every .publisher dependency:, (*13)

$MyProject> vendor/bin/publisher publish

or:, (*14)

$> vendor/bin/publisher publish "*"

For publishing specific package:, (*15)

$> vendor/bin/publisher publish acmevendor/acmepackage

For publishing specific package's group:, (*16)

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

For publishing specific packages' groups:, (*17)

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

The Versions

27/02 2016

1.1.1

1.1.1.0

Publisher for assets/configs

  Sources   Download

The Requires

 

The Development Requires

by Andrey Volynov

27/02 2016

1.1

1.1.0.0

Publisher for assets/configs

  Sources   Download

The Requires

 

The Development Requires

by Andrey Volynov

27/02 2016

dev-master

9999999-dev

Publisher for assets/configs

  Sources   Download

The Requires

 

The Development Requires

by Andrey Volynov

29/11 2015

1.0

1.0.0.0

Publisher for assets/configs

  Sources   Download

The Requires

 

The Development Requires

by Andrey Volynov