Add backwards compatibility with node v4
parent
98d9d208f6
commit
bcfa7c061c
|
@ -21,7 +21,7 @@
|
|||
},
|
||||
|
||||
"scripts": {
|
||||
"postinstall": "./configure"
|
||||
"postinstall": "./configure && if [ $(@NODE@ --version | sed 's/^v//' | cut -d. -f1) -ge \"12\" ]; then ln -s php-serialize ./node_modules/php; else rm -f node_modules/php; fi"
|
||||
},
|
||||
|
||||
"dependencies": {
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
|
||||
// php compatibility
|
||||
var Class = require( 'easejs' ).Class,
|
||||
phpS = require('php-serialize');
|
||||
|
||||
php = require( 'php' );
|
||||
|
||||
/**
|
||||
* Stores/retrieves user PHP session data from memcached
|
||||
|
@ -235,7 +234,7 @@ module.exports = Class.extend( require( '../../events' ).EventEmitter,
|
|||
|
||||
for ( var key in data )
|
||||
{
|
||||
newdata += key + '|' + phpS.serialize( data[ key ] );
|
||||
newdata += key + '|' + php.serialize( data[ key ] );
|
||||
}
|
||||
|
||||
_self._memcache.set( _self._id, newdata, 0, function()
|
||||
|
@ -281,7 +280,7 @@ module.exports = Class.extend( require( '../../events' ).EventEmitter,
|
|||
val = splits[ ++i ];
|
||||
|
||||
// the values are serialized PHP data; unserialize them
|
||||
val = phpS.unserialize( val );
|
||||
val = php.unserialize( val );
|
||||
|
||||
// add to the session data
|
||||
session_data[ key ] = val;
|
||||
|
|
Loading…
Reference in New Issue