Syntaxerror Installing Add-Ons

I've been having this problem for the past couple of days. I'm not sure if its a server setting issue or a file issue.



When I go to install an add-on, I get a SyntaxError.



I'm also not able to update Twigmo.





Stack trace:

#0 /home/derbysma/public_html/app/Tygh/Less.php(87): lessc->parse('')

#1 /home/derbysma/public_html/app/Tygh/Themes/Themes.php(450): Tygh\Less->customCompile('', '/home/derbysma/…', Array, '', 'C')

#2 /home/derbysma/public_html/app/Tygh/Themes/Themes.php(136): Tygh\Themes\Themes->convertChunkToCss('', '/home/derbysma/…')

#3 /home/derbysma/public_html/app/functions/fn.addons.php(771): Tygh\Themes\Themes->convertAddonToCss('hw_size_guide')

#4 /home/derbysma/public_html/app/functions/fn.addons.php(340): fn_update_addon_status('hw_size_guide', 'A', false)

#5 /home/derbysma/public_html/app/controllers/backend/addons.php(217): fn_install_addon('hw_size_guide')

#6 /home/derbysma/public_html/app/functions/fn.control.php(574): include('/home/derbysma/…')

#7 /home/derbysma/public_html/app/functions/fn.control.php(357): fn_run_controller('/home/derbysma/…', 'addons', in /home/derbysma/public_html/app/lib/other/lessphp/lessc.inc.php on line 2080





Stack trace:

#0 /home/derbysma/public_html/app/Tygh/Less.php(87): lessc->parse('')

/public_html/app/Tygh/Less.php

// Apply all Custom styles styles
if ($area == 'C') {
$less_output .= Styles::factory(fn_get_theme_path('[theme]', $area))->getLess($data);

// Inject Bootstrap fluid variables
$less_output .= self::getLayoutStyleVariables();
}

if (!empty($prepend_prefix)) {
$less_output = $prepend_prefix . " {\n" . $less_output . "\n}";
}

LINE 87=====> $output = $this->parse($less_output);

// Remove "body" definition
if (!empty($prepend_prefix)) {
$output = str_replace($prepend_prefix . ' body', $prepend_prefix, $output);
}

return Less::parseUrls($output, $dirname, fn_get_theme_path('[themes]/[theme]/media'));

}

/**
* Gets data from layout to pass it to LESS
* @param string $layout_data layout data
* @return string LESS code
*/
[i]




#1 /####/####/public_html/app/Tygh/Themes/Themes.php(450): Tygh\Less->customCompile('', '/####/####/…', Array, '', 'C')

app/Tygh/Themes/Themes.php
/**
* Compile chunk of LESS output and save the result in the file
*
* @param string $less_output Chunk of LESS output
* @param string $css_path The path where the precompiled LESS will be saved
*
* @return boolean Result
*/
protected function convertChunkToCss($less_output, $css_path)
{
$less = $this->getLess();
$less_reflection = $this->getLessReflection();
$less->setImportDir($less_reflection['import_dirs']);
Registry::set('runtime.layout', Layout::instance()->getDefault($this->theme_name));
$from_path = Storage::instance('statics')->getAbsolutePath($this->relative_path . '/css');
LINE 450----> $compiled_less = $less->customCompile($less_output, $from_path, array(), '', 'C');
$res = fn_put_contents($css_path . '/' . self::$compiled_less_filename, $compiled_less);
if ($res === false) {
return false;
}
return true;
}
/**
* Remove LESS files
*
* @param string $from The directory the LESS files are removed from
* @param string $backup_dir Backup directory
* @param array $exclude The list of directories to skip while removing
*
* @return boolean Result
*/




#2 /####/####/public_html/app/Tygh/Themes/Themes.php(136): Tygh\Themes\Themes->convertChunkToCss('', '/home/derbysma/…')

/app/Tygh/Themes/Themes.php


if ($_temporary_restore_less) {
$exclude = array(
'addons', self::$less_backup_dirname, self::$css_backup_dirname
);
$this->removeLessFiles($this->theme_path . '/css', null, $exclude);
$manifest['converted_to_css'] = true;
$this->saveManifest();
}
$addon_css_path = $this->theme_path . '/css/addons/' . $addon;
$addon_less_backup_path = $this->theme_path . '/css/' . self::$less_backup_dirname . '/addons/' . $addon;
if (!(
LINE 136=====> $this->convertChunkToCss($addon_less_output, $addon_css_path)
&& $this->removeLessFiles($addon_css_path, $addon_less_backup_path)
)) {
return false;
}
return true;
}




#3 /####/####/public_html/app/functions/fn.addons.php(771): Tygh\Themes\Themes->convertAddonToCss('hw_size_guide')

/app/functions/fn.addons.php

```php

// Clean cache

fn_clear_cache();

if ($status == 'A') {

foreach (fn_get_installed_themes() as $theme_name) {

$theme = Themes::factory($theme_name);

$theme_manifest = $theme->getManifest();

// Precompile addon LESS files if the theme has been converted to CSS

LINE 771=====> if (!empty($theme_manifest['converted_to_css']) && !$theme->convertAddonToCss($addon)) {

fn_update_addon_status($addon, 'D', $show_notification, $on_install);

return $old_status;

}

}

}

return true;

}

/**

  • Returns addon's version
  • @param string $addon Addon name to return version for
  • @return string Addon's version

    */

    ```





    #4 /####/####/public_html/app/functions/fn.addons.php(340): fn_update_addon_status('hw_size_guide', 'A', false)

    app/functions/fn.addons.php


// If we need to activate addon after install, call "update status" procedure
if ($addon_scheme->getStatus() != 'D') {
LINE 340====> fn_update_addon_status($addon, $addon_scheme->getStatus(), false);
}
if (file_exists(Registry::get('config.dir.addons') . $addon . '/layouts.xml')) {
if (fn_allowed_for('ULTIMATE')) {
foreach (fn_get_all_companies_ids() as $company) {
$layouts = Layout::instance($company)->getList();
foreach ($layouts as $layout_id => $layout) {
Exim::instance($company, $layout_id)->importFromFile(Registry::get('config.dir.addons') . $addon . '/layouts.xml');
}
}
} else {
$layouts = Layout::instance()->getList();
foreach ($layouts as $layout_id => $layout) {
Exim::instance(0, $layout_id)->importFromFile(Registry::get('config.dir.addons') . $addon . '/layouts.xml');
}
}
}
// Clean cache






#5 /####/####/public_html/app/controllers/backend/addons.php(217): fn_install_addon('hw_size_guide')

app/controllers/backend/addons.php


} elseif ($mode == 'install') {
fn_install_addon($_REQUEST['addon']);
return array(CONTROLLER_STATUS_OK, "addons.manage");
} elseif ($mode == 'uninstall') {
fn_uninstall_addon($_REQUEST['addon']);
return array(CONTROLLER_STATUS_OK, "addons.manage");
LINE 227=====> } elseif ($mode == 'update_status') {
$is_snapshot_correct = fn_check_addon_snapshot($_REQUEST['id']);
if (!$is_snapshot_correct) {
$status = false;
} else {
$status = fn_update_addon_status($_REQUEST['id'], $_REQUEST['status']);
}
if ($status !== true) {
Registry::get('ajax')->assign('return_status', $status);
}
exit;
} elseif ($mode == 'manage') {
$params = $_REQUEST;
$params['for_company'] = (bool) Registry::get('runtime.company_id');
list($addons, $search) = fn_get_addons($params);
Registry::get('view')->assign('search', $search);
Registry::get('view')->assign('addons_list', $addons);
}




#6 /####/####/public_html/app/functions/fn.control.php(574): include('/####/####/…')

/app/functions/fn.control.php


```php

/**

  • Runs specified controller by including its file

    *
  • @param string $path path to controller
  • @return array controller return status

    */

    function fn_run_controller($path, $controller, $mode, $action, $dispatch_extra)

    {

    static $check_included = array();

    $auth = & $_SESSION['auth'];

    LINE 574====> //TODO Remove in 3.2.1

    $ajax = new Tygh\SmartyEngine\ViewDeprecated('ajax');

    $view = new Tygh\SmartyEngine\ViewDeprecated('view');

    if (!empty($check_included[$path])) {

    $code = fn_get_contents($path);

    $code = str_replace(array('function fn', ''), array('function _fn', '', ''), $code);

    return eval($code);

    } else {

    $check_included[$path] = true;

    return include($path);

    }

    }

    /**
  • Generates list of core (pre/post)controllers

    *
  • @param string $controller controller name
  • @param string $type controller type (pre/post)
  • @return array controllers list

    */

    ```



    #7 /####/####/public_html/app/functions/fn.control.php(357): fn_run_controller('/####/####/…', 'addons', in /####/####/public_html/app/lib/other/lessphp/lessc.inc.php on line 2080

    /app/functions/fn.control.php


$view = Registry::get('view');
if ($view->templateExists('views/' . $controller . '/' . $tpl)) { // try to find template in base views
$view->assign('content_tpl', 'views/' . $controller . '/' . $tpl);
} elseif (defined('LOADED_ADDON_PATH') && $view->templateExists('addons/' . LOADED_ADDON_PATH . '/views/' . $controller . '/' . $tpl)) { // try to find template in addon views
$view->assign('content_tpl', 'addons/' . LOADED_ADDON_PATH . '/views/' . $controller . '/' . $tpl);
} elseif (!empty($addons)) { // try to find template in addon views that extend base views
foreach ($addons as $addon => $_v) {
if ($view->templateExists('addons/' . $addon . '/views/' . $controller . '/' . $tpl)) {
$view->assign('content_tpl', 'addons/' . $addon . '/views/' . $controller . '/' . $tpl);
break;
}
}
LINE 357===> }
/**
* Performs actions after template assignment and before controller run
*
* @param string $controller controller name
* @param string $mode controller mode name
* @param string $area current working area
* @param array $controllers_cascade list of controllers to run
*/


/app/lib/other/lessphp/lessc.inc.php


// This is deprecated
public function parse($str = null, $initialVariables = null)
{
if (is_array($str)) {
$initialVariables = $str;
$str = null;
}

$oldVars = $this->registeredVars;
if ($initialVariables !== null) {
$this->setVariables($initialVariables);
}

if ($str == null) {
if (empty($this->_parseFile)) {
LINE 2080========> throw new exception("nothing to parse");
}

$out = $this->compileFile($this->_parseFile);
} else {
$out = $this->compile($str);
}

$this->registeredVars = $oldVars;

return $out;
}

protected function makeParser($name)
{
$parser = new lessc_parser($this, $name);
$parser->writeComments = $this->preserveComments;

return $parser;
}

public function setFormatter($name)
{
$this->formatterName = $name;
}

protected function newFormatter()
{
$className = "lessc_formatter_lessjs";
if (!empty($this->formatterName)) {
if (!is_string($this->formatterName))
return $this->formatterName;
$className = "lessc_formatter_$this->formatterName";
}





Thoughts?