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

Sacy not working after manual install #23

Open
LucusWebsites opened this issue Nov 20, 2014 · 0 comments
Open

Sacy not working after manual install #23

LucusWebsites opened this issue Nov 20, 2014 · 0 comments

Comments

@LucusWebsites
Copy link

First of all I would really love this piece of code once I get it working.

Buf for some reason I can't get it to work, I am using PHP 5.4.26
I installed sacy this way:

Files:
/lib/smarty/plugins/block.asset_compile.php
/lib/smarty/plugins/sacy/coffeescript.php
/lib/smarty/plugins/sacy/cssmin.php
/lib/smarty/plugins/sacy/ext-translators.php
/lib/smarty/plugins/sacy/fragment-cache.php
/lib/smarty/plugins/sacy/jsmin.php
/lib/smarty/plugins/sacy/phpsass.php
/lib/smarty/plugins/sacy/sacy.php

And defined the two required contanst.

I added a couple of line in block.assect_compile.php:

<?php

if (!defined("____SACY_BUNDLED"))
    include_once(implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'sacy', 'sacy.php')));

if (!defined("____SACY_BUNDLED"))
    include_once(implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'sacy', 'phpsass.php')));

if (!defined("____SACY_BUNDLED"))
    include_once(implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'sacy', 'fragment-cache.php')));

if (!defined("____SACY_BUNDLED"))
    include_once(implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'sacy', 'cssmin.php')));

if (!defined("____SACY_BUNDLED"))
    include_once(implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'sacy', 'coffeescript.php')));

if (!defined("____SACY_BUNDLED"))
    include_once(implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'sacy', 'ext-translators.php')));

if (!defined("____SACY_BUNDLED"))
    include_once(implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'sacy', 'jsmin.php')));


if (!(defined("ASSET_COMPILE_OUTPUT_DIR") && defined("ASSET_COMPILE_URL_ROOT"))){
    throw new sacy\Exception("Failed to initialize because path configuration is not set (ASSET_COMPILE_OUTPUT_DIR and ASSET_COMPILE_URL_ROOT)");
}

function smarty_block_asset_compile($params, $content, &$template, &$repeat){
    if (!$repeat){
...

In my smarty base.tpl I wrapped the CSS and JS-files with the {asset_compile} tags, but the files are not merged and the websites throws a lot of notices:

Notice: Undefined index: merge_tags in /var/www/html/--hidden--/htdocs/site/lib/smarty/plugins/sacy/sacy.php on line 246 
Notice: Uninitialized string offset: 0 in /var/www/html/--hidden--/htdocs/site/lib/smarty/plugins/block.asset_compile.php on line 62 
Notice: Uninitialized string offset: 0 in /var/www/html/--hidden--/htdocs/site/lib/smarty/plugins/block.asset_compile.php on line 62 
Notice: Uninitialized string offset: 0 in /var/www/html/--hidden--/htdocs/site/lib/smarty/plugins/block.asset_compile.php on line 62 
Notice: Uninitialized string offset: 0 in /var/www/html/--hidden--/htdocs/site/lib/smarty/plugins/block.asset_compile.php on line 62 
Notice: Uninitialized string offset: 0 in /var/www/html/--hidden--/htdocs/site/lib/smarty/plugins/block.asset_compile.php on line 62 
Notice: Uninitialized string offset: 0 in /var/www/html/--hidden--/htdocs/site/lib/smarty/plugins/block.asset_compile.php on line 62 
Notice: Undefined offset: 0 in /var/www/html/--hidden--/htdocs/site/lib/smarty/plugins/block.asset_compile.php on line 84 
Notice: Undefined variable: res in /var/www/html/--hidden--/htdocs/site/lib/smarty/plugins/block.asset_compile.php on line 133 
Notice: Undefined index: block_ref in /var/www/html/--hidden--/htdocs/site/lib/smarty/plugins/sacy/sacy.php on line 213

Any idea what can be the issue?

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

1 participant