mirror of
https://github.com/php/php-gtk-src.git
synced 2026-03-24 17:22:10 +01:00
functions now. If you want to compile them, add #define ENABLE_REFLECTION 1 to config.h (Andrei, could you add a configure switch?) The time difference between a build with and without reflection is minimal (0.4s), so I vote for enabling it by default. The reflection.php is a small helper script if you want to write reflection code by hand (e.g. for phpg_object.c or so), and reflection_class_checker.php checks the generated .c files for unsupported classes which might cause php5 to behave weird when reflection is used.
37 lines
1009 B
PHP
37 lines
1009 B
PHP
<?php
|
|
/**
|
|
* PHP has real problems if a method requires a parameter of a certain
|
|
* class and the class doesn't exist...
|
|
*
|
|
* here we check that
|
|
*
|
|
* The classes spit out by this script have to be entered in
|
|
* generator.php function is_in_php()
|
|
*/
|
|
|
|
$arFiles = array(
|
|
'gen_atk.c',
|
|
'gen_gdk.c',
|
|
'gen_gtk.c',
|
|
'gen_pango.c'
|
|
);
|
|
$strRelPath = '../ext/gtk+/';
|
|
|
|
|
|
chdir(dirname(__FILE__));
|
|
$arDeclClasses = get_declared_classes();
|
|
$arFoundClasses = array();
|
|
foreach ($arFiles as $strFile) {
|
|
$arLines = file($strRelPath . $strFile);
|
|
|
|
foreach ($arLines as $strLine) {
|
|
if (strpos($strLine, 'ZEND_ARG_OBJ_INFO') && preg_match_all('/ZEND_ARG_OBJ_INFO\\(.+,.+,\\s*([^,]+)\\s*,.+\\)/', $strLine, $arMatches)) {
|
|
$strClass = $arMatches[1][0];
|
|
if (!in_array($strClass,$arDeclClasses) && !in_array($strClass, $arFoundClasses)) {
|
|
echo "'" . $strClass . "' => 'int',\r\n";
|
|
$arFoundClasses[] = $strClass;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
?>
|