From bcbe47423b968a5567328583281ae5d043db280c Mon Sep 17 00:00:00 2001 From: Chris Reid Date: Mon, 16 Mar 2015 10:23:52 -0600 Subject: [PATCH 1/7] updating libsass 3.2.0-beta.1 --- lib/libsass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libsass b/lib/libsass index 5f3558d..e2ee39c 160000 --- a/lib/libsass +++ b/lib/libsass @@ -1 +1 @@ -Subproject commit 5f3558d7ce36bb61202f1585ed8e32a52209e940 +Subproject commit e2ee39cb708a46d6d9ce803d3dec977ba782af03 From 2390401bfe80bddbb79819d481af60ed5d712343 Mon Sep 17 00:00:00 2001 From: Chris Reid Date: Tue, 17 Mar 2015 09:13:11 -0600 Subject: [PATCH 2/7] removing image_path references, removing STYLE_FORMATTED as per enum Sass_Output_Style in sass.h --- src/php_sass.h | 2 -- src/sass.c | 41 ----------------------------------------- 2 files changed, 43 deletions(-) diff --git a/src/php_sass.h b/src/php_sass.h index 544f4bb..8ee6157 100644 --- a/src/php_sass.h +++ b/src/php_sass.h @@ -35,7 +35,5 @@ PHP_METHOD(Sass, getStyle); PHP_METHOD(Sass, setStyle); PHP_METHOD(Sass, getIncludePath); PHP_METHOD(Sass, setIncludePath); -PHP_METHOD(Sass, getImagePath); -PHP_METHOD(Sass, setImagePath); #endif diff --git a/src/sass.c b/src/sass.c index fbb2c94..e1c9db1 100644 --- a/src/sass.c +++ b/src/sass.c @@ -23,7 +23,6 @@ typedef struct sass_object { zend_object zo; int style; char* include_paths; - char* image_path; } sass_object; zend_class_entry *sass_ce; @@ -33,8 +32,6 @@ void sass_free_storage(void *object TSRMLS_DC) sass_object *obj = (sass_object *)object; if (obj->include_paths != NULL) efree(obj->include_paths); - if (obj->image_path != NULL) - efree(obj->image_path); zend_hash_destroy(obj->zo.properties); FREE_HASHTABLE(obj->zo.properties); @@ -76,7 +73,6 @@ PHP_METHOD(Sass, __construct) sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC); obj->style = SASS_STYLE_NESTED; obj->include_paths = NULL; - obj->image_path = NULL; } @@ -103,7 +99,6 @@ PHP_METHOD(Sass, compile) struct sass_context* context = sass_new_context(); context->options.include_paths = this->include_paths != NULL ? this->include_paths : ""; - context->options.image_path = this->include_paths != NULL ? this->image_path : ""; context->options.output_style = this->style; // "Hand over the source, buddy!" @@ -169,7 +164,6 @@ PHP_METHOD(Sass, compile_file) struct sass_file_context* context = sass_new_file_context(); context->options.include_paths = this->include_paths != NULL ? this->include_paths : ""; - context->options.image_path = this->include_paths != NULL ? this->image_path : ""; context->options.output_style = this->style; context->input_path = file; @@ -259,38 +253,6 @@ PHP_METHOD(Sass, setIncludePath) RETURN_NULL(); } -PHP_METHOD(Sass, getImagePath) -{ - zval *this = getThis(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "", NULL) == FAILURE) { - RETURN_FALSE; - } - - sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC); - if (obj->image_path == NULL) RETURN_STRING("", 1) - RETURN_STRING(obj->image_path, 1) -} - -PHP_METHOD(Sass, setImagePath) -{ - zval *this = getThis(); - - char *path; - int path_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &path_len) == FAILURE) - RETURN_FALSE; - - sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC); - if (obj->image_path != NULL) - efree(obj->image_path); - obj->image_path = estrndup(path, path_len); - - RETURN_NULL(); -} - - /* -------------------------------------------------------------- * EXCEPTION HANDLING * ------------------------------------------------------------ */ @@ -312,8 +274,6 @@ zend_function_entry sass_methods[] = { PHP_ME(Sass, setStyle, NULL, ZEND_ACC_PUBLIC) PHP_ME(Sass, getIncludePath, NULL, ZEND_ACC_PUBLIC) PHP_ME(Sass, setIncludePath, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Sass, getImagePath, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Sass, setImagePath, NULL, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} }; @@ -340,7 +300,6 @@ static PHP_MINIT_FUNCTION(sass) REGISTER_SASS_CLASS_CONST_LONG(STYLE_EXPANDED, SASS_STYLE_EXPANDED); REGISTER_SASS_CLASS_CONST_LONG(STYLE_COMPACT, SASS_STYLE_COMPACT); REGISTER_SASS_CLASS_CONST_LONG(STYLE_COMPRESSED, SASS_STYLE_COMPRESSED); - REGISTER_SASS_CLASS_CONST_LONG(STYLE_FORMATTED, SASS_OUTPUT_FORMATTED); REGISTER_STRING_CONSTANT("SASS_FLAVOR", SASS_FLAVOR, CONST_CS | CONST_PERSISTENT); From b4862bfdb2bb1332544c6652c3657edf8c170111 Mon Sep 17 00:00:00 2001 From: Chris Reid Date: Tue, 17 Mar 2015 14:55:04 -0600 Subject: [PATCH 3/7] adjusting handles_style to accommodate removal of STYLE_FORMATTED --- tests/handles_style.phpt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/handles_style.phpt b/tests/handles_style.phpt index 3d9f744..f8f5cd2 100644 --- a/tests/handles_style.phpt +++ b/tests/handles_style.phpt @@ -25,10 +25,6 @@ echo $sass->getStyle(); $sass->setStyle(Sass::STYLE_COMPRESSED); echo $sass->getStyle(); -// test SASS_OUTPUT_FORMATTED -$sass->setStyle(Sass::STYLE_FORMATTED); -echo $sass->getStyle(); - ?> --EXPECT-- -001234 \ No newline at end of file +00123 \ No newline at end of file From 3dd728c28c29d9ffa3e345ef6fe7de1cb97aae9c Mon Sep 17 00:00:00 2001 From: Chris Reid Date: Wed, 18 Mar 2015 09:16:51 -0600 Subject: [PATCH 4/7] updating libsass to 3.2.0-beta.2 --- lib/libsass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libsass b/lib/libsass index e2ee39c..62314f6 160000 --- a/lib/libsass +++ b/lib/libsass @@ -1 +1 @@ -Subproject commit e2ee39cb708a46d6d9ce803d3dec977ba782af03 +Subproject commit 62314f6a3cbc7dbed3878884504847edd7fecb7b From 5e732d475a5aad719d8ed2473803278d12cfa2fd Mon Sep 17 00:00:00 2001 From: Chris Reid Date: Wed, 18 Mar 2015 10:47:33 -0600 Subject: [PATCH 5/7] adding strdup() call around source before passing to libsass API --- src/sass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sass.c b/src/sass.c index e1c9db1..c523216 100644 --- a/src/sass.c +++ b/src/sass.c @@ -103,7 +103,7 @@ PHP_METHOD(Sass, compile) // "Hand over the source, buddy!" // "Which one, béchamel or arrabbiata?" - context->source_string = source; + context->source_string = strdup(source); // Compile it! sass_compile(context); From 327a4e2a7e59766c953c53b855a8988229d8fe38 Mon Sep 17 00:00:00 2001 From: Chris Reid Date: Mon, 6 Apr 2015 07:48:01 -0600 Subject: [PATCH 6/7] updating to libsass 3.2.0-beta.5 --- lib/libsass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libsass b/lib/libsass index 62314f6..f82a41b 160000 --- a/lib/libsass +++ b/lib/libsass @@ -1 +1 @@ -Subproject commit 62314f6a3cbc7dbed3878884504847edd7fecb7b +Subproject commit f82a41ba56094e586dd33b7d2451d84abf5a4f55 From 5379c0ec28c1c737f2f7b69f1c2b3cf171a6e911 Mon Sep 17 00:00:00 2001 From: Chris Reid Date: Tue, 7 Apr 2015 08:48:49 -0600 Subject: [PATCH 7/7] updating tests to match correct output based on ruby sass output tests --- tests/parse_file_parses_file.phpt | 2 +- tests/support/test.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/parse_file_parses_file.phpt b/tests/parse_file_parses_file.phpt index 52332ec..bc9a088 100644 --- a/tests/parse_file_parses_file.phpt +++ b/tests/parse_file_parses_file.phpt @@ -13,7 +13,7 @@ echo $css; --EXPECT-- @import url(../blahblah/blah.blah); div { - blah: "hello 4 world px bloo\n blah"; } + blah: "hello 4 world px bloo blah"; } div { blah: "foo iphone"; } diff --git a/tests/support/test.scss b/tests/support/test.scss index c4ddb20..72feefb 100644 --- a/tests/support/test.scss +++ b/tests/support/test.scss @@ -1,7 +1,7 @@ @import url(../blahblah/blah.blah); div { - blah: "hello #{2+2} world #{unit(23px)} #{'bloo\n'} blah"; + blah: "hello #{2+2} world #{unit(23px)} #{'bloo'} blah"; } $foo: iphone;