diff --git a/.circleci/config.yml b/.circleci/config.yml index 6bb4af0c1f..23dce4d88b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -91,6 +91,21 @@ jobs: - run: name: Running phpcs command: composer lint -- --report=junit | tee test-results/phpcs/results.xml + - run: + name: Install clang-format 6.0 + command: sudo apt -y install clang-format-6.0/testing + - run: + name: Run clang-format + command: | + find ./ -iname *.h -o -iname *.c | while read fname; do + changes=$(clang-format-6.0 -output-replacements-xml $fname | grep -c "= 70000 +/** + * Replacing zend_execute_ex with anything other than original + * changes some of the bevavior in PHP compilation and execution + * + * e.g. it changes compilation of function calls to produce ZEND_DO_FCALL + * opcode instead of ZEND_DO_UCALL for user defined functions + * + * While this extension could be developed by using zend_execute_ex to hook + * into every execution. However hooking into opcode processing has the + * advantage of not hooking into some executable things like generators which + * gives a slight performance advantage. + */ +#if PHP_VERSION_ID >= 70000 ddtrace_original_execute_ex = zend_execute_ex; zend_execute_ex = php_execute; - #endif +#endif ddtrace_old_fcall_handler = zend_get_user_opcode_handler(ZEND_DO_FCALL); zend_set_user_opcode_handler(ZEND_DO_FCALL, ddtrace_wrap_fcall);