Skip to content

Commit

Permalink
Merge branch 'zfcuser_acl' of https://github.com/Mohit-Singh/ZF2-Auth…
Browse files Browse the repository at this point in the history
…-ACL into zfcuser_acl
  • Loading branch information
Mohit-Singh committed Jul 2, 2014
2 parents 22c2199 + fa77bb9 commit 88aee63
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ using composer add
```
"require" : {
...
"mohit-singh/zf2auth-acl": "V1.0.0"
"mohit-singh/zf2auth-acl": "V1.0.1"
}
```
Enable the module in application.config.php

```php
'modules' => array(
...
'ZF2AuthAcl'
),
```

then copy and rename the following,
```
copy vendor/mohit-singh/zf2auth-acl/config/aclAuth.local.php.dist to config/autoload/aclAuth.local.php
Expand Down Expand Up @@ -131,4 +140,38 @@ $roleAtuth->getUserValidRole();
$roleAtuth->switchRole('ADMIN');
```

It Also provide cache mechanism to store role, resource and permission in cache.
you can configure the caching here

```php
/**
* This cache is used the disk file system to store date with the following options.
*/
'fileCache' => array(
'cache_dir' => './data/cache',
'namespace' => 'systemCache',
'dir_level' => 2,
'filePermission' => 0666,
'dirPermission' => 0755
),
```
you can also access file system cache in your project like this

```php

// store item in filesystem cache
$this->getServiceLocator()->get('Zend\Cache\Storage\Filesystem')->setItem('foo', 'taxi');


// get item from filesystem cache
echo 'Cached Item is:- '.$this->getServiceLocator()->get('Zend\Cache\Storage\Filesystem')->getItem('foo');

```

you are using file system cache so you have to give permission to the cache folder

```
> sudo chmod -R 0777 data/cache
```


0 comments on commit 88aee63

Please sign in to comment.