Skip to content

Commit

Permalink
Rename library to Composed
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdifabio committed Jul 16, 2015
1 parent fbb9c67 commit ba6019e
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 25 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Composer Utils
# Composed

[![Code Quality](https://img.shields.io/scrutinizer/g/joshdifabio/composer-utils.svg?style=flat-square)](https://scrutinizer-ci.com/g/joshdifabio/composer-utils/)
[![Code Quality](https://img.shields.io/scrutinizer/g/joshdifabio/composed.svg?style=flat-square)](https://scrutinizer-ci.com/g/joshdifabio/composed/)

This library provides a set of utility functions designed to help you parse your project's Composer configuration, and those of its dependencies, at runtime.

Expand All @@ -13,21 +13,21 @@ The API combines functional and object-oriented approaches.
(Chicken and egg...)

```php
$absoluteVendorPath = ComposerUtils\VENDOR_DIR;
$absoluteVendorPath = Composed\VENDOR_DIR;
```

### Locate the project's base directory

```php
$absoluteProjectPath = ComposerUtils\BASE_DIR;
$absoluteProjectPath = Composed\BASE_DIR;
```

### Get the authors of a specific package

You can fetch data from the `composer.json` file of a specific package.

```php
$authors = ComposerUtils\package_config('phpunit/phpunit', 'authors');
$authors = Composed\package_config('phpunit/phpunit', 'authors');

assert($authors === [
[
Expand All @@ -43,10 +43,10 @@ assert($authors === [
You can fetch data from all `composer.json` files in your project in one go.

```php
$licenses = ComposerUtils\package_configs('license');
$licenses = Composed\package_configs('license');

assert($licenses === [
'joshdifabio/composer-utils' => "MIT",
'joshdifabio/composed' => "MIT",
'doctrine/instantiator' => "MIT",
'phpunit/php-code-coverage' => "BSD-3-Clause",
]);
Expand All @@ -55,13 +55,13 @@ assert($licenses === [
### Get the absolute path to a file in a package

```php
$path = ComposerUtils\package('phpunit/phpunit')->getPath('composer.json');
$path = Composed\package('phpunit/phpunit')->getPath('composer.json');
```

### Get all packages installed on your project

```php
foreach (ComposerUtils\packages() as $packageName => $package) {
foreach (Composed\packages() as $packageName => $package) {
$pathToPackageConfig = $package->getPath('composer.json');
// ...
}
Expand All @@ -72,7 +72,7 @@ foreach (ComposerUtils\packages() as $packageName => $package) {
You can also fetch data from the `composer.json` file located in your project root.

```php
$projectAuthors = ComposerUtils\project_config('authors');
$projectAuthors = Composed\project_config('authors');

assert($projectAuthors === [
[
Expand All @@ -84,16 +84,16 @@ assert($projectAuthors === [

## Installation

Install Composer Utils using [composer](https://getcomposer.org/).
Install Composed using [composer](https://getcomposer.org/).

```
composer require joshdifabio/composer-utils
composer require joshdifabio/composed
```

## Credits

Credit goes to @igorw whose [get-in](https://github.com/igorw/get-in) library is partially copied into this library. Unfortunately, `igorw/get-in` requires PHP 5.4 while Composer Utils aims for PHP 5.3 compatibility.
Credit goes to @igorw whose [get-in](https://github.com/igorw/get-in) library is partially copied into this library. Unfortunately, `igorw/get-in` requires PHP 5.4 while Composed aims for PHP 5.3 compatibility.

## License

Composer Utils is released under the [MIT](https://github.com/joshdifabio/composer-utils/blob/master/LICENSE) license.
Composed is released under the [MIT](https://github.com/joshdifabio/composed/blob/master/LICENSE) license.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "joshdifabio/composer-utils",
"name": "joshdifabio/composed",
"description": "Easily parse your project's Composer configuration, and those of its dependencies, at runtime.",
"keywords": [ "composer", "dependency", "package" ],
"license": "MIT",
Expand All @@ -14,7 +14,7 @@
},
"autoload": {
"psr-4": {
"ComposerUtils\\": "src"
"Composed\\": "src"
},
"files": [
"src/functions_include.php"
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractPackage.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace ComposerUtils;
namespace Composed;

/**
* @author Josh Di Fabio <joshdifabio@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/JsonObject.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace ComposerUtils;
namespace Composed;

/**
* @author Josh Di Fabio <joshdifabio@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/LockFile.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace ComposerUtils;
namespace Composed;

/**
* @author Josh Di Fabio <joshdifabio@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/Package.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace ComposerUtils;
namespace Composed;

/**
* @author Josh Di Fabio <joshdifabio@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/PackageCollection.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace ComposerUtils;
namespace Composed;

class PackageCollection implements \IteratorAggregate
{
Expand Down
2 changes: 1 addition & 1 deletion src/RootPackage.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace ComposerUtils;
namespace Composed;

/**
* @author Josh Di Fabio <joshdifabio@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/functions.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace ComposerUtils;
namespace Composed;

define(__NAMESPACE__ . '\VENDOR_DIR', Internal\findVendorDir());
define(__NAMESPACE__ . '\BASE_DIR', Internal\findBaseDir(VENDOR_DIR));
Expand Down
2 changes: 1 addition & 1 deletion src/functions_include.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

if (!function_exists('ComposerUtils\getPackages')) {
if (!function_exists('Composed\getPackages')) {
require __DIR__ . '/functions_internal.php';
require __DIR__ . '/functions.php';
}
2 changes: 1 addition & 1 deletion src/functions_internal.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace ComposerUtils\Internal;
namespace Composed\Internal;

function findVendorDir()
{
Expand Down

0 comments on commit ba6019e

Please sign in to comment.