Last active
June 20, 2021 22:18
-
-
Save horaciod/ef7c1f28fa1d3a4fc59c5b582f5a87fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // obtener el listado de funciones que llama un objeto llamado conn | |
| // grep -or "conn->.*.(" >/tmp/llamadas.txt | |
| $f = file_get_contents('/tmp/llamadas.txt'); | |
| $lineas = explode("\n" , $f) ; | |
| $aux = [ ]; | |
| foreach($lineas as $l){ | |
| if (strstr($l, 'vendor')===false) | |
| $aux[] = firstStringBetween($l,'->', '(').PHP_EOL ; | |
| } | |
| sort($aux) ; | |
| foreach(array_count_values($aux ) as $K=>$V){ | |
| echo trim($K) .'|'. trim($V).PHP_EOL ; | |
| } | |
| function firstStringBetween($haystack, $start, $end) | |
| { | |
| return trim(strstr(strstr($haystack, $start), $end, true), $start . $end); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment