Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed relative template path assumption #1513

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oojacoboo
Copy link
Contributor

As this is currently written, it's difficult to write behaviors and specify a template dir since it's using the DIR constant, effectively making it relative. The change keeps the same defaults, but expects a full absolute path, as it should be.

As this is currently written, it's difficult to write behaviors and specify a template dir since it's using the __DIR__ constant, effectively making it relative.  The change keeps the same defaults, but expects a full absolute path, as it should be.
@dereuromark
Copy link
Contributor

Is there a test case along with those changes maybe?
Please also rebase as current master is green.

Copy link
Contributor

@Incognito Incognito left a comment

Choose a reason for hiding this comment

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

It would be cool to get this released together with #1491 / #1492 because they're topically similar.

We should get a test case that proves the feature works as expected.

if (!$templateDir) {
$filePath = __DIR__ . '/templates/' . $filename;
} else {
$filePath = $templateDir . $filename;
Copy link
Contributor

Choose a reason for hiding this comment

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

I really like the style used in https://github.com/propelorm/Propel2/pull/1491/files where the code uses realpath which would be less error-prone. Can we do something like that in this method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants