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

$root calculation blows up if config_path is relative #8

Open
glensc opened this issue May 13, 2017 · 1 comment
Open

$root calculation blows up if config_path is relative #8

glensc opened this issue May 13, 2017 · 1 comment

Comments

@glensc
Copy link
Contributor

glensc commented May 13, 2017

i don't know what that $root is supposed to be, no comments in code but that place really deserves it.

but it calculates wrong

  {assetic
    assets="css/main.css,css/page.css"
    output="css"
    config_path="../config"
    build_path="style/build"
    debug=false
    filters="yui_css,less"
    asset_url=asset_url}
    <link rel="stylesheet" href="{$asset_url}">
  {/assetic}

and with given debug:

    dump('config_path='.$params['config_path']);
    $realpath = realpath($params['config_path']);
    dump('realpath='.$realpath);
    $root = mb_substr($realpath, 0, mb_strlen($realpath, $charset) - mb_strlen($params['config_path'], $charset), $charset);
    dump('root='.$root);

it results:

"config_path=../config"
"realpath=/home/glen/scm/eventum/eventum/config"
"root=/home/glen/scm/eventum/event"

that's definately wrong, whatever $root should be, it looks truncated!

@pjparra
Copy link
Owner

pjparra commented May 15, 2017

I'll have to check, but if I remember correctly, I had to get rid of it on a project where I used this plugin. If so, I'll probably commit the modification.

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

No branches or pull requests

2 participants