Re: About resources.xml

From: Date: Tue, 20 Mar 2001 10:20:20 +0000
Subject: Re: About resources.xml
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969334761@lists.php.net to get a copy of this message
Hi Jesus, > I crufted together a simple script to pull possible > resources, which may help you: This is interesting : it didn't find out the same resources. Here is the one I used : (Note : displays are in French, but code should be simple enough). Just add script in the php source root, and answers will go in restypes.txt file. I rely on "zend_register_list_destructors_ex" call. I'll gather all those resources together. I'm still working on the initial release. Thanks a lot :-) #!/usr/bin/perl @tous = (); $dir = "/usr/local/src/php-4.0.4"; traite_dir($dir); open ERREURS, ">restypes.txt"; foreach $t ( @tous) { $t =~ s/^$dir//isg; $t =~ s/\\n//isg; print ERREURS "$t\t0\t0\t\n"; } close ERREURS; print "total : $total\n"; print "total erreur : $total_erreur\n"; sub traite_dir(){ my $dir = @_[0]; opendir(DIR, $dir); my @files; @files = readdir(DIR); closedir(DIR); my $d; foreach $d (@files){ if (($d ne '.') && ($d ne '..')){ if (-d "$dir/$d"){ print "dossier : $dir/$d\n"; traite_dir("$dir/$d"); } else { if ($d =~ /\.c$/is){ print "fichier : $dir/$d\n"; traite_fichier("$dir/$d"); } } } } } sub traite_fichier(){ my $nom_fichier = @_[0]; open FICHIER, "<$nom_fichier"; @fichier = <FICHIER>; close FICHIER; $fichier = join("", @fichier); while($fichier =~ s/(zend_register_list_destructors_ex\(.*?\);)//is){ print $totale = $1; $totale =~ s/\s+/ /isg; push(@tous, "$nom_fichier\t$totale\n"); $total++; } }

« previous php.doc (#969334761) next »