ahir/pathman

Laravel Directory Creator

This package's canonical repository appears to be gone and the package has been frozen as a result.

1.0.0 2014-06-13 08:32 UTC

This package is not auto-updated.

Last update: 2024-01-20 12:15:47 UTC


README

Pathman is a PHP 5.3+ simple directory management system for Laravel 4.

Installation

To install through composer, simply put the following in your composer.json file:

{
	"require-dev": {
		"ahir/pathman": "dev-master"
	}
}

Usage

After installing the package, open your Laravel config file app/config/app.php and add the following lines.

In the $providers array add the following service provider for this package.

'Ahir\Pathman\PathmanServiceProvider',

Add the Pathman facades to the aliases array in app/config/app.php:

'aliases' => array(
		'Pathman' => 'Ahir\Pathman\Facades\Pathman',
	),

Configuration

Library has got two different configuration parameters.

  • hashing: This parameter is using with time folders method. You can choose "false" value or any php hashing algorithm. (md5, adler32 etc.)

  • time-pattern: This parameter is setting time folders structure.

Examples

Create Folder and Set Writable
try {
	Pathman::set('new-folder-name');
} catch (Exception $e) {
	echo $e->getMessage();
}
Create Time Folders By Root
try {
	$path = Pathman::timeFolders('root-folder');
} catch (Exception $e) {
	echo $e->getMessage();
}

// root-folder/2014/05/12/18/56
echo $path;