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

[BUG] Volt compiled options not working #13968

Closed
ghost opened this issue Apr 12, 2019 · 3 comments
Closed

[BUG] Volt compiled options not working #13968

ghost opened this issue Apr 12, 2019 · 3 comments
Labels
bug A bug report status: medium Medium
Milestone

Comments

@ghost
Copy link

ghost commented Apr 12, 2019

In phalcon version 4.0.0-alpha.3 all compiled options in volt not working properly.

$di->set('view', function() {
  $view = new View();
  $view->setViewsDir('../app/views/');
  $view->registerEngines([
    '.volt' => function($view) {
      $volt = new Volt($view, $this);
      $volt->setOptions([
        'compiledPath' => '../app/cache/',  /* NO LONGER WORKS */
        'compiledExtension' => '.html',  /* NO LONGER WORKS */
        'compiledSeparator' => '_',  /* NO LONGER WORKS */
        'stat' => true,
        'compileAlways' => true,
      ]); #options
      return $volt;
    } #volt
  ]); #engines
  return $view;
}); #view 
  • Update-1: Looks like 4.0.0-alpha.4 is out now, will try it and report back - if it has same issue.
  • Update-2: Same issue with 4.0.0-alpha.4 did something change again in volt?
  • Update-3: My bad, it looks like it has changed per my request LOL NFR Rename Volt "compiled" #13815
@ghost ghost changed the title [BUG] Volt compiledPath Not Working [BUG] Volt compiled options not working Apr 12, 2019
@ghost ghost closed this as completed Apr 12, 2019
@ghost ghost reopened this Apr 12, 2019
@ghost
Copy link
Author

ghost commented Apr 12, 2019

Re-opening this bug, looks like this new changes and old options not working for me in 4.0.0-alpha.4. Here is the code I used to test it. All it does is place all the cached files in my /project/public/ directory were my index.php file is. This is very bad for security. This code should of place all my cached volt files in /project/app/cache/ directory. It looks like its related to this changes https://github.com/dschissler/cphalcon/commit/7d3f2062cb78f3746e42b9b55e1a5110f91a9d4c

$di->set('view', function() {
  $view = new View();
  $view->setViewsDir('../app/views/');
  $view->registerEngines([
    '.volt' => function($view) {
      $volt = new Volt($view, $this);
      $volt->setOptions([
        'path' => '../app/cache/',  /* NOT WORKING */
        'extension' => '.html',  /* NOT WORKING */
        'separator' => '_',  /* NOT WORKING */
        'stat' => true,  /* NOT WORKING */
        'always' => true,  /* NOT WORKING */
      ]); #options
      return $volt;
    } #volt
  ]); #engines
  return $view;
}); #view 

@ghost
Copy link
Author

ghost commented Apr 12, 2019

Okay, I done more tests and only thing works properly is when one path option set.

  • path or compiledPath -- works only if no other option is set.
  • extension or compiledExtension -- dosn't work at all.
  • seperator or compiledSeperator -- dosn't work at all.
  • stat -- dosn't work at all.
  • always or compileAlways -- dosn't work at all.

Is it something I'm doing wrong in my code or something has changed again? A little help is appreciated.

@niden
Copy link
Sponsor Member

niden commented Apr 14, 2019

Resolved

@niden niden closed this as completed Apr 14, 2019
4.0.0 Release automation moved this from To do to Done Apr 14, 2019
@niden niden added the 4.0 label Jun 21, 2019
@niden niden added bug A bug report status: medium Medium and removed Bug - Medium labels Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: medium Medium
Projects
No open projects
4.0.0 Release
  
Done
Development

No branches or pull requests

2 participants