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

Assetic and yui_css generating empty files #99

Closed
ajfranzoia opened this issue Aug 11, 2011 · 4 comments
Closed

Assetic and yui_css generating empty files #99

ajfranzoia opened this issue Aug 11, 2011 · 4 comments
Labels

Comments

@ajfranzoia
Copy link

Hi. I'm using Assetic with yui_css and I'm having some trouble.

Assetic ver.: 1.0.1 (Commit: 3e45781 - aug 10)
yuicompressor ver: 2.4.6

config.yml

assetic:
    debug:          %kernel.debug%
    use_controller: false
    filters:
        cssrewrite: ~
        yui_css:
            jar: "%kernel.root_dir%/Resources/java/yuicompressor.jar"

config_dev.yml

assetic:
    use_controller: true

base.html.twig

{% stylesheets 'bundles/miapp/css/layout.css' filter='yui_css' %}
    <link href="{{ asset_url }}" type="text/css" rel="stylesheet" />
{% endstylesheets %}

The generated css ("XXXXXX_layout_1.css") is fetched OK by the browser, but it is empty. The file generated under web/css is empty as well.
Proccessing the css wfile ith "java -jar yuicompressor layout.css" produces the right result.

Am I missing any configuration?

@ajfranzoia
Copy link
Author

After some hours of debugging and struggling, I´ve found that this problem is related to this PHP bug ocurring under windows: https://bugs.php.net/bug.php?id=50503. Seems it has not been fixed yet. (my os is XP 32bit, my phpinfo is available here: http://tararira.hostei.com/)

The problem is related to the proc_open function and the $env parameter.

File assetic\src\Assetic\Util\Proccess.php - Line 124

$process = proc_open($this->commandline, $descriptors, $pipes, $this->cwd, $this->env, $this->options);

It produces and empty output...
It must be changed to this to get it to work...

$process = proc_open($this->commandline, $descriptors, $pipes, $this->cwd, null, $this->options);

Apparently this isn´t harmful to modify using the yuicompressor filter because it seems it does not direct make use of the $env variable, but Compass, Less and Stylus seems to do...

Too bad there is very little information about this bug... Is there any possible workaround to this problem?

kriswallsmith added a commit that referenced this issue Aug 22, 2011
@kriswallsmith
Copy link
Owner

Please try v1.0.2.

@kriswallsmith
Copy link
Owner

I haven't heard back so I'm closing this issue. Please reopen if the issue persists.

@jakzal
Copy link

jakzal commented Feb 10, 2012

I experienced the same issue with PHP 5.3.3. It looks like it's a problem with how regular expressions work (PCRE was updated since 5.3.3). Everything works fine with PHP>=5.3.8. I didn't verify other versions.

In PHP 5.3.3 BaseCssFilter::filterUrls() and BaseCssFilter::filterImports() methods return null.

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

No branches or pull requests

3 participants