Skip to content

Commit

Permalink
Merge branch 'php70_improvements' of https://github.com/Wikia/sassphp
Browse files Browse the repository at this point in the history
…into Wikia-php70_improvements

# Conflicts:
#	src/sass.c
  • Loading branch information
absalomedia committed May 11, 2016
2 parents f9ea8ae + 9c8988f commit e89298a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
8 changes: 4 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
environment:
PHP_VERSION: 5.6.16
PHP_VERSION: 5.6.21

configuration: Release

Expand All @@ -17,12 +17,12 @@ install:
- echo Preparing Windows build...
- echo Downloading PHP source code [%PHP_VERSION%]
- cd C:\php-src
- appveyor DownloadFile http://windows.php.net/downloads/releases/php-5.6.16-src.zip -FileName php-src.zip
- appveyor DownloadFile http://windows.php.net/downloads/releases/php-5.6.21-src.zip -FileName php-src.zip
- 7z x -y php-src.zip > nul
- '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64'

build_script:
- cd C:\php-src\php-5.6.16-src
build_script:
- cd C:\php-src\php-5.6.21-src
- buildconf.bat --add-modules-dir=C:\projects
- configure --disable-all --enable-cli --enable-sass
- nmake php_sass.dll
Expand Down
2 changes: 1 addition & 1 deletion install.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
system('cd lib/libsass && make && cd ../..');
system('phpize');
system('./configure');
system('make');
system('make');
41 changes: 20 additions & 21 deletions src/sass.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void sass_free_storage(void *object TSRMLS_DC)
if (obj->map_root != NULL)
efree(obj->map_root);
zend_hash_destroy(obj->zo.properties);
FREE_HASHTABLE(obj->zo.properties);
FREE_HASHTABLE(obj->zo.properties);
efree(obj);
}
#endif
Expand Down Expand Up @@ -102,8 +102,8 @@ zend_object_value sass_create_handler(zend_class_entry *type TSRMLS_DC) {

#if ZEND_MODULE_API_NO > 20131226
zend_object * sass_create_handler(zend_class_entry *type TSRMLS_DC) {
struct sass_object *obj = ecalloc(1,
sizeof(struct sass_object) +
struct sass_object *obj = ecalloc(1,
sizeof(struct sass_object) +
zend_object_properties_size(type));

zend_object_std_init(&obj->zo, type TSRMLS_CC);
Expand Down Expand Up @@ -273,7 +273,7 @@ PHP_METHOD(Sass, compileFile)
zend_throw_exception_ex(sass_exception_ce, 0 TSRMLS_CC, "File %s could not be found", file);
RETURN_FALSE;
}

struct Sass_File_Context* file_ctx = sass_make_file_context(file);

struct Sass_Context* ctx = sass_file_context_get_context(file_ctx);
Expand All @@ -289,7 +289,7 @@ PHP_METHOD(Sass, compileFile)
}
else
{

#if ZEND_MODULE_API_NO <= 20131226
if (this->map_path != NULL ) {
// Send it over to PHP.
Expand Down Expand Up @@ -339,7 +339,7 @@ PHP_METHOD(Sass, getStyle)
#endif
#if ZEND_MODULE_API_NO <= 20131226
sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC);
#endif
#endif

RETURN_LONG(obj->style);
}
Expand All @@ -359,7 +359,7 @@ PHP_METHOD(Sass, setStyle)
#endif
#if ZEND_MODULE_API_NO <= 20131226
sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC);
#endif
#endif
obj->style = new_style;

RETURN_NULL();
Expand All @@ -378,7 +378,7 @@ PHP_METHOD(Sass, getIncludePath)
#endif
#if ZEND_MODULE_API_NO <= 20131226
sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC);
#endif
#endif

#if ZEND_MODULE_API_NO <= 20131226
if (obj->include_paths == NULL) RETURN_STRING("", 1);
Expand All @@ -403,7 +403,6 @@ PHP_METHOD(Sass, setIncludePath)
size_t path_len;
#endif


if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &path_len) == FAILURE)
RETURN_FALSE;

Expand All @@ -412,7 +411,7 @@ PHP_METHOD(Sass, setIncludePath)
#endif
#if ZEND_MODULE_API_NO <= 20131226
sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC);
#endif
#endif

if (obj->include_paths != NULL)
efree(obj->include_paths);
Expand All @@ -434,7 +433,7 @@ PHP_METHOD(Sass, getMapPath)
#endif
#if ZEND_MODULE_API_NO <= 20131226
sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC);
#endif
#endif

#if ZEND_MODULE_API_NO <= 20131226
if (obj->map_path == NULL) RETURN_STRING("", 1);
Expand Down Expand Up @@ -467,7 +466,7 @@ PHP_METHOD(Sass, setMapPath)
#endif
#if ZEND_MODULE_API_NO <= 20131226
sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC);
#endif
#endif

if (obj->map_path != NULL)
efree(obj->map_path);
Expand All @@ -490,7 +489,7 @@ PHP_METHOD(Sass, getPrecision)
#endif
#if ZEND_MODULE_API_NO <= 20131226
sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC);
#endif
#endif

RETURN_LONG(obj->precision);
}
Expand All @@ -510,7 +509,7 @@ PHP_METHOD(Sass, setPrecision)
#endif
#if ZEND_MODULE_API_NO <= 20131226
sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC);
#endif
#endif

obj->precision = new_precision;

Expand All @@ -530,7 +529,7 @@ PHP_METHOD(Sass, getEmbed)
#endif
#if ZEND_MODULE_API_NO <= 20131226
sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC);
#endif
#endif

RETURN_LONG(obj->map_embed);
}
Expand All @@ -550,7 +549,7 @@ PHP_METHOD(Sass, setEmbed)
#endif
#if ZEND_MODULE_API_NO <= 20131226
sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC);
#endif
#endif

obj->map_embed = new_map_embed;

Expand All @@ -571,7 +570,7 @@ PHP_METHOD(Sass, getComments)
#endif
#if ZEND_MODULE_API_NO <= 20131226
sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC);
#endif
#endif

RETURN_LONG(obj->comments);
}
Expand All @@ -591,7 +590,7 @@ PHP_METHOD(Sass, setComments)
#endif
#if ZEND_MODULE_API_NO <= 20131226
sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC);
#endif
#endif

obj->comments = new_comments;

Expand All @@ -612,7 +611,7 @@ PHP_METHOD(Sass, getIndent)
#endif
#if ZEND_MODULE_API_NO <= 20131226
sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC);
#endif
#endif

RETURN_LONG(obj->indent);
}
Expand All @@ -632,7 +631,7 @@ PHP_METHOD(Sass, setIndent)
#endif
#if ZEND_MODULE_API_NO <= 20131226
sass_object *obj = (sass_object *)zend_object_store_get_object(this TSRMLS_CC);
#endif
#endif

obj->indent = new_indent;

Expand All @@ -653,7 +652,7 @@ PHP_METHOD(Sass, getLibraryVersion)
#if ZEND_MODULE_API_NO > 20131226
RETURN_STRING(libsass_version());
#endif

}
/* --------------------------------------------------------------
* EXCEPTION HANDLING
Expand Down

0 comments on commit e89298a

Please sign in to comment.