Skip to content

Conversation

@mvriel
Copy link
Member

@mvriel mvriel commented Sep 4, 2018

Prior to this change the Twig cache files were stored in the system's temp
directory. Although this works in many cases, it may lead to issues when
different projects have different twig files.

This change includes two things:

  1. Change pipelines to read stages using tags
  2. Introduce a new stage that sets the Twig cache folder to use a subfolder
    of the configured cache folder.

By changing the pipelines we can dynamically introduce a new stage in the
pipeline with a specific priority. This new stage reads the configuration
and preconfigures the twig service.

Prior to this change the Twig cache files were stored in the system's temp
directory. Although this works in many cases, it may lead to issues when
different projects have different twig files.

This change includes two things:

1. Change pipelines to read stages using tags
2. Introduce a new stage that sets the Twig cache folder to use a subfolder
   of the configured cache folder.

By changing the pipelines we can dynamically introduce a new stage in the
pipeline with a specific priority. This new stage reads the configuration
and preconfigures the twig service.
@mvriel mvriel requested review from ashnazg and jaapio September 4, 2018 06:09
@mvriel mvriel self-assigned this Sep 4, 2018
@mvriel
Copy link
Member Author

mvriel commented Sep 4, 2018

Fixes #1605

Copy link
Member

@jaapio jaapio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a simple thing to check.
I really like the much cleaner approach of creating the pipelines. and stages.

If you just check the twig env types. This one looks good to me.


namespace phpDocumentor\Plugin\Twig\Stage;

use Twig\Environment;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the right type? Since the twig writer expects a twig_environment?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Twig_Environment and Twig\Environment are the same classes :) One is an alias

@jaapio jaapio merged commit ee8783c into develop Sep 4, 2018
@jaapio jaapio deleted the feature/use-project-cacehe-folder-for-twig-instead-of-system-folder branch September 4, 2018 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants