Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit d194ecf

Browse files
authored
Merge pull request #25 from pinepain/improve-api
Improve api
2 parents 1c3aef0 + fd538a9 commit d194ecf

File tree

175 files changed

+2737
-3203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+2737
-3203
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ project(php_v8)
33

44
# NOTE: This CMake file is just for syntax highlighting in CLion
55

6-
include_directories(/usr/local/opt/v8@5.9/include)
7-
include_directories(/usr/local/opt/v8@5.9/include/libplatform)
6+
include_directories(/usr/local/opt/v8@6.0/include)
7+
include_directories(/usr/local/opt/v8@6.0/include/libplatform)
88

99
include_directories(/usr/local/include/php)
1010
include_directories(/usr/local/include/php/TSRM)

config.m4

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ if test "$PHP_V8" != "no"; then
149149
PHP_NEW_EXTENSION(v8, [ \
150150
v8.cc \
151151
src/php_v8_a.cc \
152+
src/php_v8_enums.cc \
152153
src/php_v8_exception.cc \
153154
src/php_v8_ext_mem_interface.cc \
154155
src/php_v8_try_catch.cc \
@@ -169,7 +170,6 @@ if test "$PHP_V8" != "no"; then
169170
src/php_v8_script.cc \
170171
src/php_v8_unbound_script.cc \
171172
src/php_v8_cached_data.cc \
172-
src/php_v8_compile_options.cc \
173173
src/php_v8_script_compiler.cc \
174174
src/php_v8_source.cc \
175175
src/php_v8_data.cc \
@@ -184,7 +184,6 @@ if test "$PHP_V8" != "no"; then
184184
src/php_v8_integer.cc \
185185
src/php_v8_int32.cc \
186186
src/php_v8_uint32.cc \
187-
src/php_v8_integrity_level.cc \
188187
src/php_v8_object.cc \
189188
src/php_v8_function.cc \
190189
src/php_v8_array.cc \
@@ -196,17 +195,13 @@ if test "$PHP_V8" != "no"; then
196195
src/php_v8_boolean_object.cc \
197196
src/php_v8_string_object.cc \
198197
src/php_v8_symbol_object.cc \
199-
src/php_v8_property_attribute.cc \
200198
src/php_v8_template.cc \
201199
src/php_v8_return_value.cc \
202200
src/php_v8_callback_info.cc \
203201
src/php_v8_function_callback_info.cc \
204202
src/php_v8_property_callback_info.cc \
205-
src/php_v8_access_control.cc \
206-
src/php_v8_property_handler_flags.cc \
207203
src/php_v8_named_property_handler_configuration.cc \
208204
src/php_v8_indexed_property_handler_configuration.cc \
209-
src/php_v8_access_type.cc \
210205
], $ext_shared, , -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
211206

212207
PHP_ADD_BUILD_DIR($ext_builddir/src)

scripts/provision/.bashrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,7 @@ if [[ -e ~/.phpbrew/bashrc ]]; then
127127
fi
128128
fi
129129

130-
EDITOR=vim
130+
export EDITOR=vim
131+
132+
# To prevent a PHP test suite from asking to send results to the PHP QA team:
133+
export NO_INTERACTION=1

scripts/provision/provision.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ sudo add-apt-repository ppa:pinepain/libv8-6.0
1010
# Let's update packages list:
1111
sudo apt-get update
1212

13+
# Remove unused
14+
sudo apt-get remove -y liblxc1 lxc-common lxd lxcfs
15+
16+
1317
# Make sure this system tools installed:
1418
sudo apt-get install -y git htop curl pkgconf
1519

scripts/replace_expect.php

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,15 @@
1313
*/
1414

1515
$tests_dir = realpath(__DIR__ . '/../tests');
16-
$iterator = new GlobIterator($tests_dir . '/*.out', FilesystemIterator::KEY_AS_FILENAME);
16+
17+
18+
if ($argc == 2) {
19+
$mask = str_replace(['tests/', '.phpt', '.diff'], '', $argv[1]);
20+
} else {
21+
$mask = '*';
22+
}
23+
24+
$iterator = new GlobIterator($tests_dir . "/{$mask}.out", FilesystemIterator::KEY_AS_FILENAME);
1725

1826
foreach ($iterator as $item) {
1927
//var_dump($item);
@@ -35,7 +43,42 @@
3543
foreach (['.diff', '.exp', '.log', '.mem', '.out', '.php', '.sh'] as $ext) {
3644
@unlink($tests_dir. '/'.$base_name . $ext);
3745
}
38-
} else {
39-
printf("please, edit manually [%s]".PHP_EOL, $iterator->key());
46+
47+
continue;
48+
} elseif (false !== ($pos = strpos($test_content, '--EXPECTF--'))) {
49+
50+
printf("--EXPECTF-- [%s]".PHP_EOL, $iterator->key());
51+
52+
// get replacements
53+
54+
$tests = substr($test_content, 0, $pos);
55+
$result = file_get_contents($tests_dir . '/' . $out_file);
56+
57+
preg_match_all('#// EXPECTF: \-\-\-(.+)#', $tests, $expectf_search);
58+
preg_match_all('#// EXPECTF: \+\+\+(.+)#', $tests, $expectf_replace);
59+
60+
if (count($expectf_search) != count($expectf_replace)) {
61+
printf("please, edit manually [%s]: searches and replaces count doesn't match".PHP_EOL, $iterator->key());
62+
continue;
63+
}
64+
65+
foreach (array_combine($expectf_search[1], $expectf_replace[1]) as $search => $replace) {
66+
$result = preg_replace($search, $replace, $result);
67+
}
68+
69+
$test_content = $tests;
70+
$test_content .= '--EXPECTF--'.PHP_EOL;
71+
$test_content .= $result;
72+
$test_content .= PHP_EOL;
73+
74+
file_put_contents($tests_dir . '/' . $test_file, $test_content);
75+
76+
foreach (['.diff', '.exp', '.log', '.mem', '.out', '.php', '.sh'] as $ext) {
77+
@unlink($tests_dir. '/'.$base_name . $ext);
78+
}
79+
80+
continue;
4081
}
82+
83+
printf("please, edit manually [%s]".PHP_EOL, $iterator->key());
4184
}

src/php_v8_access_control.cc

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/php_v8_access_control.h

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/php_v8_access_type.cc

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/php_v8_access_type.h

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)