Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzatron committed Jul 27, 2013
2 parents 0a797fc + b2e4e52 commit b5b48f1
Show file tree
Hide file tree
Showing 58 changed files with 5,051 additions and 205 deletions.
1 change: 1 addition & 0 deletions .travis.install
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ if ($token = getenv('ARCHER_TOKEN')) {
'github.com' => $token
);
$composerFlags = '--prefer-dist';
passthru('curl -s -i -H "Authorization: token $ARCHER_TOKEN" https://api.github.com | grep "^X-RateLimit"');
} else {
$composerFlags = '--prefer-source';
}
Expand Down
10 changes: 1 addition & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
#
language: php

php:
- 5.3
- 5.4
- 5.5
php: ["5.3", "5.4", "5.5"]

env:
global:
Expand All @@ -22,8 +19,3 @@ install:
- ./.travis.install
script:
- ./vendor/bin/archer travis:build

matrix:
# PHP 5.5 is still in alpha, so ignore build failures.
allow_failures:
- php: 5.5
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Pathogen changelog

### 0.2.0 (2013-07-27)

* **[NEW]** All paths can now be normalized by calling `normalize()`, which
takes an optional normalizer to use.
* **[NEW]** Unix paths now have first-class representations, and their own
factory.
* **[IMPROVED]** File system paths will automatically normalize the result of
the `parent()` method ([#21]).
* **[NEW]** Implemented dependency consumer traits ([#22]).
* **[NEW]** Implemented simple methods for matching strings and patterns in
paths and path names ([#19]).

### 0.1.2 (2013-07-18)

* **[FIXED]** AbsolutePath::relativeTo() now works for paths with common
Expand All @@ -16,4 +28,7 @@
<!-- References -->

[#18]: https://github.com/eloquent/pathogen/issues/18
[#19]: https://github.com/eloquent/pathogen/issues/19
[#20]: https://github.com/eloquent/pathogen/issues/20
[#21]: https://github.com/eloquent/pathogen/issues/21
[#22]: https://github.com/eloquent/pathogen/issues/22
46 changes: 42 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ structures while providing a comprehensive API.
- [File system paths](#file-system-paths)
- [Immutability of paths](#immutability-of-paths)
- [Windows path support](#windows-path-support)
- [Dependency consumer traits](#dependency-consumer-traits)
- [Available dependency consumer traits](#available-dependency-consumer-traits)
- [Usage examples](#usage-examples)
- [Resolving a user-provided path against the current working directory](#resolving-a-user-provided-path-against-the-current-working-directory)
- [Determining whether one path exists inside another](#determining-whether-one-path-exists-inside-another)
Expand Down Expand Up @@ -234,14 +236,12 @@ required for some reason, this is left to the developer to handle:

```php
use Eloquent\Pathogen\FileSystem\Factory\FileSystemPathFactory;
use Eloquent\Pathogen\FileSystem\Normalizer\FileSystemPathNormalizer;

$factory = new FileSystemPathFactory;
$normalizer = new FileSystemPathNormalizer;

$path = $factory->create('/path/./to/foo/../bar');

$normalizedPath = $normalizer->normalize($path);
$normalizedPath = $path->normalize();
echo $normalizedPath->string(); // outputs '/path/to/bar'
```

Expand Down Expand Up @@ -299,6 +299,38 @@ $drive = $path->drive(); // returns a single-character string, or null
It is worth noting that *Pathogen* does *not* support drive specifiers for
relative Windows paths, only for absolute Windows paths.

### Dependency consumer traits

*Pathogen* provides some [traits] to make consuming its services extremely
simple for systems code targeting PHP 5.4 and higher.

The concept of a dependency consumer trait is simple. If a class requires, for
example, a path factory, it can simply use a `PathFactoryTrait`. This gives the
class `setPathFactory()` and `pathFactory()` methods for managing the path
factory dependency.

This example demonstrates how to use the file system path factory trait:

```php
use Eloquent\Pathogen\FileSystem\Factory\Consumer\FileSystemPathFactoryTrait;

class ExampleConsumer
{
use FileSystemPathFactoryTrait;
}

$consumer = new ExampleConsumer;
echo get_class($consumer->pathFactory()); // outputs 'Eloquent\Pathogen\FileSystem\Factory\FileSystemPathFactory'
```

#### Available dependency consumer traits

- [PlatformFileSystemPathFactoryTrait]
- [FileSystemPathFactoryTrait]
- [PathFactoryTrait]
- [PathResolverTrait]
- [NormalizingPathResolverTrait]

## Usage examples

### Resolving a user-provided path against the current working directory
Expand Down Expand Up @@ -390,14 +422,20 @@ echo $pathWithReplacement->string(); // outputs '/path/for/baz/bar'

[AbsolutePathInterface]: http://lqnt.co/pathogen/artifacts/documentation/api/Eloquent/Pathogen/AbsolutePathInterface.html
[API documentation]: http://lqnt.co/pathogen/artifacts/documentation/api/
[Build Status]: https://api.travis-ci.org/eloquent/pathogen.png
[Build Status]: https://api.travis-ci.org/eloquent/pathogen.png?branch=master
[Composer]: http://getcomposer.org/
[eloquent/pathogen]: https://packagist.org/packages/eloquent/pathogen
[FileSystemPathFactory]: http://lqnt.co/pathogen/artifacts/documentation/api/Eloquent/Pathogen/FileSystem/Factory/FileSystemPathFactory.html
[FileSystemPathFactoryTrait]: src/Eloquent/Pathogen/FileSystem/Factory/Consumer/FileSystemPathFactoryTrait.php
[Latest build]: http://travis-ci.org/eloquent/pathogen
[NormalizingPathResolverTrait]: src/Eloquent/Pathogen/Resolver/Consumer/NormalizingPathResolverTrait.php
[PathFactoryInterface]: http://lqnt.co/pathogen/artifacts/documentation/api/Eloquent/Pathogen/Factory/PathFactoryInterface.html
[PathFactoryTrait]: src/Eloquent/Pathogen/Factory/Consumer/PathFactoryTrait.php
[PathInterface]: http://lqnt.co/pathogen/artifacts/documentation/api/Eloquent/Pathogen/PathInterface.html
[PathResolverTrait]: src/Eloquent/Pathogen/Resolver/Consumer/PathResolverTrait.php
[PlatformFileSystemPathFactory]: http://lqnt.co/pathogen/artifacts/documentation/api/Eloquent/Pathogen/FileSystem/Factory/PlatformFileSystemPathFactory.html
[PlatformFileSystemPathFactoryTrait]: src/Eloquent/Pathogen/FileSystem/Factory/Consumer/PlatformFileSystemPathFactoryTrait.php
[RelativePathInterface]: http://lqnt.co/pathogen/artifacts/documentation/api/Eloquent/Pathogen/RelativePathInterface.html
[Test coverage report]: http://lqnt.co/pathogen/artifacts/tests/coverage/
[Test Coverage]: https://coveralls.io/repos/eloquent/pathogen/badge.png
[traits]: http://php.net/traits
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
],
"require": {
"php": ">=5.3.3",
"ext-mbstring": "*",
"icecave/isolator": "~2"
},
"require-dev": {
Expand Down
85 changes: 43 additions & 42 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b5b48f1

Please sign in to comment.