1010
1111namespace arty \scss \acp ;
1212
13+ require_once ( __DIR__ . '/scssphp/scss.inc.php ' );
14+ use ScssPhp \ScssPhp \Compiler ;
15+
1316class scss_module
1417{
1518 /** @var string */
@@ -180,6 +183,7 @@ protected function compile($style, $path)
180183 'files ' => array (),
181184 );
182185
186+ /*
183187 foreach ($scss as $file)
184188 {
185189 if ($file == 'stylesheet.scss')
@@ -188,7 +192,14 @@ protected function compile($style, $path)
188192 }
189193 $post['files'][$file] = @file_get_contents($path . $file);
190194 }
191-
195+ */
196+
197+ $ compiler = new Compiler ();
198+ $ compiler ->setOutputStyle = \ScssPhp \ScssPhp \OutputStyle::EXPANDED ;
199+ $ cssResult = $ compiler ->compileString ( $ data , $ path . 'stylesheet.scss ' )->getCss ();
200+ $ result = json_encode ( array ('css ' => $ cssResult ) );
201+
202+ /*
192203 // Send data to server
193204 $url = 'http://phpbb31.artodia.com/scss.php';
194205
@@ -202,6 +213,7 @@ protected function compile($style, $path)
202213 'Content-Length: ' . strlen($encoded))
203214 );
204215 $result = curl_exec($ch);
216+ */
205217
206218 if (!strlen ($ result ))
207219 {
@@ -323,10 +335,12 @@ protected function find_scss_files($path, $prefix = '')
323335 */
324336 protected function assert_required_modules ()
325337 {
338+ /*
326339 if (!function_exists('curl_init'))
327340 {
328341 trigger_error($this->user->lang['ACP_SCSS_MISSING_CURL'] . adm_back_link($this->u_action), E_USER_WARNING);
329342 }
343+ */
330344 if (!function_exists ('json_encode ' ))
331345 {
332346 trigger_error ($ this ->user ->lang ['ACP_SCSS_MISSING_JSON ' ] . adm_back_link ($ this ->u_action ), E_USER_WARNING );
0 commit comments