Skip to content

Releases: ytake/Laravel-Aspect

1.3.1: Merge pull request #32 from ytake/feature-supported-recursive-array-keys

Choose a tag to compare

@ytake ytake released this 05 Oct 11:10
updated

changed configuration

Choose a tag to compare

@ytake ytake released this 20 Sep 05:44

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

Choose a tag to compare

@ytake ytake released this 19 Sep 13:41
Merge pull request #30 from ytake/feature-support-apc-cache

for update 

bugfix

Choose a tag to compare

@ytake ytake released this 04 Aug 18:55
Merge pull request #29 from ytake/feature-some-fixed

added rollback

added @Async

Choose a tag to compare

@ytake ytake released this 15 May 17:44

@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

Choose a tag to compare

@ytake ytake released this 27 Apr 18:07
Merge pull request #26 from ytake/feature-ignore-annotations

Feature ignore annotations

bug fixed

Choose a tag to compare

@ytake ytake released this 24 Apr 17:08
Merge pull request #25 from ytake/feature-supported-lumen

supported contextual bindings

added LogExceptions

Choose a tag to compare

@ytake ytake released this 17 Mar 17:26
    /**
     * @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

Choose a tag to compare

@ytake ytake released this 29 Feb 17:28
merged

added Loggable

Choose a tag to compare

@ytake ytake released this 23 Dec 12:46

@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}