ketwaroo/package-info

Sort of a reflection tool for composer packages.

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/ketwaroo/package-info

dev-master 2015-10-04 00:00 UTC

This package is not auto-updated.

Last update: 2025-12-25 01:15:42 UTC


README

This is sort of a reflection tool for the composer package we're working in.

Most common usage would be if you need to determine the base path of your package. Or if you have a project that spans multiple sub packages.

Usage. Of sorts.

namespace Vendor/Package;

use Ketwaroo/PackageInfo

class SomeClass{

    public function readStaticCsvData(){

        // say you need to read some data located in /vendor/package/data/mydata.csv;
        // instead of mucking about with relative paths,

        $root = PackageInfo::whereAmI($this);

        $csv = file($root.'/data/mydata.csv');

        // ..etc

    }
}

TODO.

unit tests. maybe. figure out what else this could be useful for.