2017 © Pedro Peláez
 

composer-plugin path-composer-plugin-lib

Publish vendor_dir and base_dir as constants

image

hostnet/path-composer-plugin-lib

Publish vendor_dir and base_dir as constants

  • Thursday, June 1, 2017
  • by hboomsma
  • Repository
  • 7 Watchers
  • 0 Stars
  • 61,400 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 5 Versions
  • 12 % Grown

The README.md

README

When do I need this?

If you are developing a composer package, and you want to know the location of the project root and/or the vendor directory., (*1)

Can I do without?

Sometimes you will work on your package stand alone, for instance on the unit tests. In that case your vendor directory can be determined relatively to a file., (*2)

You of course want your package to function when included via composer. Usually you can determine the vendor directory by going up a couple of directories. But don't forget to take the [vendor-dir] (https://getcomposer.org/doc/06-config.md#vendor-dir) config option into account., (*3)

This package takes care of that. Even better: it calculates the directory during composer install. So it's faster., (*4)

How do I use it?

<?php
namespace MyVendor\MyApp;

use Hostnet\Component\Path\Path;

class ClassInNeed
{
    public function doSomethingWithPaths()
    {
        $vendor_dir = Path::VENDOR_DIR
        $base_dir   = Path::BASE_DIR
        // ...
    }
}

Installation

Install using composer by using the command line interface or adding the package name hostnet/path-composer-plugin-lib to composer.json, (*5)

{
    "require": {
        "hostnet/path-composer-plugin-lib": "^1.0.0"
    }
}

The Versions

01/06 2017

dev-master

9999999-dev

Publish vendor_dir and base_dir as constants

  Sources   Download

MIT

The Requires

  • php >=5.6
  • composer-plugin-api ^1.0

 

The Development Requires

17/10 2016

1.0.2

1.0.2.0

Publish vendor_dir and base_dir as constants

  Sources   Download

MIT

The Requires

  • php >=5.6
  • composer-plugin-api ^1.0

 

The Development Requires

14/10 2016

1.0.1

1.0.1.0

Publish vendor_dir and base_dir as constants

  Sources   Download

MIT

The Requires

  • php >=5.6
  • composer-plugin-api ^1.0

 

The Development Requires

14/10 2016

dev-iltar-patch-1

dev-iltar-patch-1

Publish vendor_dir and base_dir as constants

  Sources   Download

MIT

The Requires

  • php >=5.6
  • composer-plugin-api ^1.0

 

The Development Requires

22/02 2016

1.0.0

1.0.0.0

Publish vendor_dir and base_dir as constants

  Sources   Download

MIT

The Requires

  • php >=5.6
  • composer-plugin-api ^1.0

 

The Development Requires