Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

Commit

Permalink
[cmf] update the way constants are handled in data/php_stdlib/
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pad committed Feb 13, 2014
1 parent 68ff7fe commit acd2e99
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 815 deletions.
5 changes: 2 additions & 3 deletions data/php_stdlib/Makefile
Expand Up @@ -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/
Expand Down
13 changes: 13 additions & 0 deletions data/php_stdlib/builtin_constants.php
@@ -0,0 +1,13 @@
<?php

$arr = get_defined_constants();
ksort($arr);

echo "<?php\n";
foreach ($arr as $k => $v) {
$v = $v ? $v : -1;
echo "define('$k', ";
var_export($v);
//echo "0";
echo ");\n";
}
3 changes: 1 addition & 2 deletions data/php_stdlib/extra/bad.php
@@ -1,9 +1,8 @@
<?php

// people should not abuse the case insensivity of PHP
// People should not abuse the case insensivity of PHP!

// used in phabricator

const True = 1;
const False = 0;

Expand Down
3 changes: 0 additions & 3 deletions data/php_stdlib/extra/classes.php
Expand Up @@ -2,9 +2,6 @@
// See the files coming from hphp/src/system/classes/ now, e.g.
// arrayaccess.php in this directory.

// ***************************************************************************
// Used by phabricator
// ***************************************************************************

// http://www.php.net/manual/en/class.com.php
class COM { }

0 comments on commit acd2e99

Please sign in to comment.