goaop / goaop-symfony-bundle

[Outdated!] Integration bridge for Go! AOP framework and Symfony
55 stars 16 forks source link

Symfony 4. Problem with cache and source file editing. #24

Open klimick opened 6 years ago

klimick commented 6 years ago

Hello! I have problems with editing source files. Aspects stop working after any change in the source file that works under the aspect. After running the cache:clear command, all aspects continue to work until a new change is made to the source file. I'm using symfony 4.0.5 with autowiring.

The aspects that I use:

/**
     * @Before("execution(public **\Application\**\*Service->*(*)) && !execution(public **\Application\**\*Service->__construct(*))")
     */
    public function beginTransaction()
    {
        $this->entityManager->getConnection()->beginTransaction();
        $this->entityManager->getConnection()->setAutoCommit(false);
    }

    /**
     * @After("execution(public **\Application\**\*Service->*(*)) && !execution(public **\Application\**\*Service->__construct(*))")
     */
    public function commitTransaction()
    {
        $this->entityManager->flush();
        $this->entityManager->getConnection()->commit();
    }

    /**
     * @AfterThrowing("execution(public **\Application\**\*Service->*(*)) && !execution(public **\Application\**\*Service->__construct(*))")
     */
    public function rollbackTransaction()
    {
        if ($this->entityManager->getConnection()->isTransactionActive()) {
            $this->entityManager->rollback();
        }
    }
lisachenko commented 6 years ago

Hi, unfortunately a lot of things have changed in SF4, so need to update this bundle accordingly. Current bundle version couldn't handle new symfony. Sorry for that.

lisachenko commented 6 years ago

Related to #22