Skip to content

Commit

Permalink
Updated PHP-JS to be compatible with latest v8
Browse files Browse the repository at this point in the history
  • Loading branch information
Martijn Otto committed Jun 14, 2016
1 parent 81cf121 commit 4012902
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .clang_complete
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-std=c++11
-Wno-pragma-once-outside-header
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,23 @@ NAME = php-js
# PHP installations use a conf.d directory that holds a set of config files,
# one for each extension. Use this variable to specify this directory.
#
# In Ubuntu 14.04 Apache 2.4 is used, which uses the mods-available directory
# instead of a conf.d directory. In 16.04 the directory changed yet again.
# This has to be checked.
#

UBUNTU_MAJOR := $(shell /usr/bin/lsb_release -r -s | cut -f1 -d.)
OVER_SIXTEEN := $(shell echo "${UBUNTU_MAJOR} >= 16" | bc)
OVER_FOURTEEN := $(shell echo "${UBUNTU_MAJOR} >= 14" | bc)

ifeq (${OVER_SIXTEEN}, 1)
INI_DIR = /etc/php/7.0/mods-available/
else ifeq (${OVER_FOURTEEN}, 1)
INI_DIR = /etc/php5/mods-available/
else
INI_DIR = /etc/php5/conf.d/
endif

INI_DIR = /etc/php5/mods-available/


#
Expand Down
4 changes: 2 additions & 2 deletions external.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class External
*
* @param data callback data
*/
static void destructor(const v8::WeakCallbackData<v8::Value, External> &data)
static void destructor(const v8::WeakCallbackInfo<External> &data)
{
// stop tracking the external reference
Context::current()->untrack(data.GetParameter());
Expand Down Expand Up @@ -92,7 +92,7 @@ class External
{
// create the persistent handle and make it weak
_persistent.Reset(Isolate::get(), handle);
_persistent.SetWeak<External>(this, &destructor);
_persistent.SetWeak<External>(this, &destructor, v8::WeakCallbackType::kParameter);
}

/**
Expand Down
11 changes: 0 additions & 11 deletions handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@ class Handle
* @var v8::Handle<v8::External>
*/
v8::Local<v8::External> _handle;

/**
* The destructor callback to clean up the object
*
* @param data callback data
*/
static void destructor(const v8::WeakCallbackData<v8::Value, External> &data)
{
// delete the object
delete data.GetParameter();
}
public:
/**
* Constructor
Expand Down

0 comments on commit 4012902

Please sign in to comment.