less module modification, dont know if i have to keep it
This commit is contained in:
@@ -48,14 +48,17 @@ class LessAutoprefixer {
|
||||
|
||||
$version = NULL;
|
||||
|
||||
try {
|
||||
if (function_exists('proc_open')) {
|
||||
|
||||
$version_response = self::create(NULL)->proc_open(array('--version'));
|
||||
try {
|
||||
|
||||
$version = preg_replace('/.*?([\d\.]+).*/', '$1', $version_response);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$version_response = self::create(NULL)->proc_open(array('--version'));
|
||||
|
||||
$version = preg_replace('/.*?([\d\.]+).*/', '$1', $version_response);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return $version;
|
||||
|
@@ -80,14 +80,17 @@ class Lessjs {
|
||||
|
||||
$version = NULL;
|
||||
|
||||
try {
|
||||
if (function_exists('proc_open')) {
|
||||
|
||||
$version_response = self::create(NULL)->proc_open(array('--version'));
|
||||
try {
|
||||
|
||||
$version = preg_replace('/.*?([\d\.]+).*/', '$1', $version_response);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$version_response = self::create(NULL)->proc_open(array('--version'));
|
||||
|
||||
$version = preg_replace('/.*?([\d\.]+).*/', '$1', $version_response);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return $version;
|
||||
|
@@ -98,9 +98,4 @@ abstract class LessEngine implements LessEngineInterface {
|
||||
|
||||
return $this->dependencies;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
abstract public function compile();
|
||||
}
|
||||
|
@@ -10,6 +10,16 @@
|
||||
*/
|
||||
function less_settings_form($form, &$form_state) {
|
||||
|
||||
if (!function_exists('proc_open')) {
|
||||
|
||||
$message_vars = array(
|
||||
'@proc_open_url' => url('http://php.net/manual/en/function.proc-open.php'),
|
||||
'@disable_functions_url' => url('http://php.net/manual/en/ini.core.php#ini.disable-functions'),
|
||||
);
|
||||
|
||||
drupal_set_message(t('PHP function <a href="@proc_open_url">proc_open()</a> is currently <a href="@disable_functions_url">disabled</a>. You will be unable to less.js or Autoprefixer.', $message_vars), 'warning');
|
||||
}
|
||||
|
||||
$form['less_flush'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#collapsible' => FALSE,
|
||||
@@ -66,7 +76,7 @@ function less_settings_form($form, &$form_state) {
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Use @name - <a href="@vendor_url">@vendor_url</a>', array('@name' => $lessautoprefixer_library['name'], '@vendor_url' => $lessautoprefixer_library['vendor url'])),
|
||||
'#description' => t('Enable automatic prefixing of vendor CSS extensions.'),
|
||||
'#default_value' => variable_get(LESS_AUTOPREFIXER, FALSE),
|
||||
'#default_value' => variable_get(LESS_AUTOPREFIXER, FALSE) && !empty($lessautoprefixer_library['installed']),
|
||||
'#disabled' => empty($lessautoprefixer_library['installed']),
|
||||
);
|
||||
|
||||
|
@@ -22,9 +22,9 @@ files[] = classes/class.lessautoprefixer.inc
|
||||
; Testing files
|
||||
files[] = tests/less.test
|
||||
|
||||
; Information added by Drupal.org packaging script on 2015-01-30
|
||||
version = "7.x-4.0"
|
||||
; Information added by Drupal.org packaging script on 2015-02-04
|
||||
version = "7.x-4.0+2-dev"
|
||||
core = "7.x"
|
||||
project = "less"
|
||||
datestamp = "1422653011"
|
||||
datestamp = "1423078338"
|
||||
|
||||
|
@@ -22,9 +22,9 @@ less[vars][@text_glow] = lighten(@gradient_start, 10%);
|
||||
; this module.
|
||||
less[sheets][] = styles/less_demo.drupal_add_css.css.less
|
||||
|
||||
; Information added by Drupal.org packaging script on 2015-01-30
|
||||
version = "7.x-4.0"
|
||||
; Information added by Drupal.org packaging script on 2015-02-04
|
||||
version = "7.x-4.0+2-dev"
|
||||
core = "7.x"
|
||||
project = "less"
|
||||
datestamp = "1422653011"
|
||||
datestamp = "1423078338"
|
||||
|
||||
|
Reference in New Issue
Block a user