Skip to content

Commit

Permalink
README, CHANGELOG update
Browse files Browse the repository at this point in the history
  • Loading branch information
m1 committed Dec 19, 2015
1 parent 8a54340 commit 6584c5c
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 11 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

All Notable changes to `Vars` will be documented in this file

## 0.3.0 - 2015-12-19

### Added
- Add recursive dir toggle flag
- Add suppression flag
- Add if else flag
- Add path trait

### Altered
- Moved path logic to path trait

### Fixed
- README format

## 0.2.0 - 2015-12-16

### Added
Expand Down
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,21 @@ test_key_1:
imports: sub/
```

Importing directories is by default recursive and will search folders within folders, you can change this by adding a recursive toggle:
Importing directories is by default not recursive and will not search folders within folders, you can change this by adding a recursive toggle:
``` yml
test_key_1:
imports:
resource: sub/
recursive: false
recursive: true
```

or by adding a recursive flag:
``` yml
test_key_1:
imports:
resource: sub/*
```

As with the loading files, you can bulk import dirs with one recursive toggle:
``` yml
test_key_1:
Expand Down Expand Up @@ -238,7 +246,13 @@ The suppress exceptions flag `@` -- suppresses files not found exceptions. eg:
imports: @file_does_not_exist.yml
```

You can also combine the above two flags, so if the else file option does not exist, it won't throw an exception, eg:
The recursive flag makes it so directories within directories are searched for files. eg:
``` yml
imports:
resource: sub/*
```

You can also combine the above flags, so if the else file option does not exist, it won't throw an exception, eg:

```yml
imports: example_1.yml ?: @example_2.yml
Expand Down
30 changes: 23 additions & 7 deletions src/Traits/PathTrait.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
<?php

/**
* Created by PhpStorm.
* User: miles
* Date: 19/12/15
* Time: 11:32
* This file is part of the m1\vars library
*
* (c) m1 <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package m1/vars
* @version 0.3.0
* @author Miles Croxford <[email protected]>
* @copyright Copyright (c) Miles Croxford <[email protected]>
* @license http://github.com/m1/vars/blob/master/LICENSE
* @link http://github.com/m1/vars/blob/master/README.MD Documentation
*/

namespace M1\Vars\Traits;

/**
* Path trait gives common operation functions needed for Paths in Vars
*
* @since 0.1.0
*/
trait PathTrait
{
/**
Expand All @@ -30,8 +45,9 @@ public function getPath()
/**
* Set the Vars base path
*
* @param string $path The path to set
*
* @param string $path The path to set
* @param boolean $check_writeable Check whether dir is writeable
* @throws \InvalidArgumentException If the path does not exist or is not writable
*
* @return \M1\Vars\Vars
Expand All @@ -52,4 +68,4 @@ public function setPath($path, $check_writeable = false)
$this->path = realpath($path);
return $this;
}
}
}
1 change: 0 additions & 1 deletion src/Vars.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ private function makePaths($options)
$this->setPath($options['path']);

if (is_null($options['cache_path']) && !is_null($options['path'])) {

$this->cache->setPath($options['path']);
$this->paths_loaded = true;
}
Expand Down

0 comments on commit 6584c5c

Please sign in to comment.