|
| 1 | +/* |
| 2 | + * This file is part of the pinepain/php-v8 PHP extension. |
| 3 | + * |
| 4 | + * Copyright (c) 2015-2017 Bogdan Padalko <pinepain@gmail.com> |
| 5 | + * |
| 6 | + * Licensed under the MIT license: http://opensource.org/licenses/MIT |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the |
| 9 | + * LICENSE file that was distributed with this source or visit |
| 10 | + * http://opensource.org/licenses/MIT |
| 11 | + */ |
| 12 | + |
| 13 | +#ifdef HAVE_CONFIG_H |
| 14 | +#include "config.h" |
| 15 | +#endif |
| 16 | + |
| 17 | +#include "php_v8_compile_options.h" |
| 18 | +#include "php_v8.h" |
| 19 | + |
| 20 | +zend_class_entry* php_v8_compile_options_class_entry; |
| 21 | +#define this_ce php_v8_compile_options_class_entry |
| 22 | + |
| 23 | + |
| 24 | +static const zend_function_entry php_v8_compile_options_methods[] = { |
| 25 | + PHP_FE_END |
| 26 | +}; |
| 27 | + |
| 28 | +PHP_MINIT_FUNCTION(php_v8_compile_options) { |
| 29 | + zend_class_entry ce; |
| 30 | + INIT_NS_CLASS_ENTRY(ce, "V8\\ScriptCompiler", "CompileOptions", php_v8_compile_options_methods); |
| 31 | + this_ce = zend_register_internal_class(&ce); |
| 32 | + |
| 33 | + zend_declare_class_constant_long(this_ce, ZEND_STRL("kNoCompileOptions"), v8::ScriptCompiler::CompileOptions::kNoCompileOptions); |
| 34 | + zend_declare_class_constant_long(this_ce, ZEND_STRL("kProduceParserCache"), v8::ScriptCompiler::CompileOptions::kProduceParserCache); |
| 35 | + zend_declare_class_constant_long(this_ce, ZEND_STRL("kConsumeParserCache"), v8::ScriptCompiler::CompileOptions::kConsumeParserCache); |
| 36 | + zend_declare_class_constant_long(this_ce, ZEND_STRL("kProduceCodeCache"), v8::ScriptCompiler::CompileOptions::kProduceCodeCache); |
| 37 | + zend_declare_class_constant_long(this_ce, ZEND_STRL("kConsumeCodeCache"), v8::ScriptCompiler::CompileOptions::kConsumeCodeCache); |
| 38 | + |
| 39 | + return SUCCESS; |
| 40 | +} |
0 commit comments