Releases: ytake/Laravel-Aspect
Releases · ytake/Laravel-Aspect
Release list
1.3.1: Merge pull request #32 from ytake/feature-supported-recursive-array-keys
updated
changed configuration
configuration
laravel-ytake-aop.php in aspect
append modules key
<?php
return [
'aspect' => [
/**
* choose aop library
* "ray"(Ray.Aop), "none"(for testing)
*/
'default' => env('ASPECT_DRIVER', 'ray'),
/**
* for aspect driver options
*/
'drivers' => [
'ray' => [
// string Path to the compiled directory where compiled classes will be stored
'compile_dir' => storage_path('framework/aop/compile'),
// aspect kernel cacheable
'cache' => env('ASPECT_CACHEABLE', false),
// string Path to the cache file directory where cache classes will be stored
'cache_dir' => storage_path('framework/aop/cache'),
],
'none' => [
// for testing driver
// no use aspect
]
],
'modules' => [
// append modules
// \App\Modules\CacheableModule::class,
],
],
'annotation' => [
/**
* choose annotation reader
* 'array'(default), 'file'(file cache), apcu
*/
'default' => env('ASPECT_ANNOTATION_DRIVER', 'array'),
'debug' => env('ASPECT_ANNOTATION_DEBUG', false),
'drivers' => [
'file' => [
'cache_dir' => storage_path('framework/annotation'),
],
],
'ignores' => [
// global Ignored Annotations
'Hears',
'Get',
'Post',
'Put',
'Patch',
'Options',
'Delete',
'Any',
'Middleware',
'Resource',
'Controller'
],
],
];supported annotation driver for apcu
Merge pull request #30 from ytake/feature-support-apc-cache for update
bugfix
added @Async
@async
Methods annotated with @async will return immediately to its caller while its operation executes asynchronously.
Methods annotated with @async must strictly have a void
required pcntl extension
PHP:PCNTL - Process Control
use Ytake\LaravelAspect\Annotation\Async;
class AspectAsync
{
/**
* @Async
* @param null $id
*/
public function asyncProcess()
{
sleep(10);
}
}bug fixed / supported ignore annotations
Merge pull request #26 from ytake/feature-ignore-annotations Feature ignore annotations
bug fixed
added LogExceptions
/**
* @LogExceptions
* @param null $id
* @return null
* @throws \Exception
*/
public function normalLog($id = null)
{
return $id;
}
/**
* @LogExceptions(expect="\LogicException")
*/
public function expectException()
{
throw new \LogicException;
}
/**
* @LogExceptions(expect="\LogicException")
*/
public function expectNoException()
{
throw new FileNotFoundException(__DIR__);
}1.1.0: Merge pull request #23 from ytake/develop
merged
added Loggable
@loggable
for logger(illuminate/log, monolog)
- option
| params | description |
|---|---|
| value | log level (default: \Monolog\Logger::INFO) should Monolog Constants |
| skipResult | method result output to log |
| name | log name prefix(default: Loggable) |
use Ytake\LaravelAspect\Annotation\Loggable;
class AspectLoggable
{
/**
* @Loggable
* @param null $id
* @return null
*/
public function normalLog($id = null)
{
return $id;
}
}sample)
[2015-12-23 08:15:30] testing.INFO: Loggable:__Test\AspectLoggable.normalLog {"args":{"id":1},"result":1,"time":0.000259876251221}