From acd2e99d27fa6bb36ac073f383cc122394037dea Mon Sep 17 00:00:00 2001 From: pad Date: Thu, 13 Feb 2014 13:00:47 -0800 Subject: [PATCH] [cmf] update the way constants are handled in data/php_stdlib/ Summary: Hphp people have changed (again) the way builtins are handled. Test Plan: cd pfff/data/php_stdlib make update make check see no dupes also some recent builtins mentioned in phabricator lint errors such as JSON_PRETTY_PRINT are in the generate system/constants.php file Reviewers: jwatzman, pieter Reviewed By: jwatzman CC: sgolemon, neal, bryano, ps, erling Differential Revision: https://phabricator.fb.com/D1174028 --- data/php_stdlib/Makefile | 5 +- data/php_stdlib/builtin_constants.php | 13 + data/php_stdlib/extra/bad.php | 3 +- data/php_stdlib/extra/classes.php | 3 - data/php_stdlib/extra/constants.php | 712 -------------------- data/php_stdlib/extra/facebook.php | 55 -- data/php_stdlib/extra/functions.php | 28 - data/php_stdlib/extra/hphp_builtins.php | 4 - data/php_stdlib/extra/pfff.php | 1 - data/php_stdlib/extra/php53_not_hiphop.php | 6 - lang_php/analyze/foundation/builtins_php.ml | 7 +- 11 files changed, 22 insertions(+), 815 deletions(-) create mode 100644 data/php_stdlib/builtin_constants.php delete mode 100644 data/php_stdlib/extra/php53_not_hiphop.php diff --git a/data/php_stdlib/Makefile b/data/php_stdlib/Makefile index fc95be024..3af4660c3 100644 --- a/data/php_stdlib/Makefile +++ b/data/php_stdlib/Makefile @@ -9,9 +9,8 @@ update: ./stdlib_from_hni.sh ~/local/fbcode/hphp hni cp -rf ~/local/fbcode/hphp/system/php/* system/ cp -rf ~/local/fbcode/hphp/facebook/system/php/* system/facebook/ - cp -f ~/local/fbcode/hphp/system/idl/constants.idl.json /tmp/ - perl -p -i -e 's/9223372036854775807/0/g;' /tmp/constants.idl.json - ~/pfff/pfff_test -builtins_of_idl /tmp/constants.idl.json > idl/builtins_constants.idl.php + rm -rf system/code_model # too many errors for now + php builtin_constants.php > system/constants.php stdlib: update rm -rf stdlib/ diff --git a/data/php_stdlib/builtin_constants.php b/data/php_stdlib/builtin_constants.php new file mode 100644 index 000000000..1085194fa --- /dev/null +++ b/data/php_stdlib/builtin_constants.php @@ -0,0 +1,13 @@ + $v) { + $v = $v ? $v : -1; + echo "define('$k', "; + var_export($v); + //echo "0"; + echo ");\n"; +} diff --git a/data/php_stdlib/extra/bad.php b/data/php_stdlib/extra/bad.php index db40d90e2..27639cdf4 100644 --- a/data/php_stdlib/extra/bad.php +++ b/data/php_stdlib/extra/bad.php @@ -1,9 +1,8 @@ failwith "wrong json format" );