Skip to content

Instantly share code, notes, and snippets.

@ciaranmcnulty
Created January 13, 2015 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ciaranmcnulty/7706c36bbc62ee858317 to your computer and use it in GitHub Desktop.
Save ciaranmcnulty/7706c36bbc62ee858317 to your computer and use it in GitHub Desktop.
Quick survey of extensions
<?php
$extensions = file_get_contents('https://raw.githubusercontent.com/phpspec/phpspec/master/docs/cookbook/extensions.rst');
$tmp = tempnam(sys_get_temp_dir(), 'extension-checker');
unlink($tmp); mkdir($tmp); chdir($tmp);
if (preg_match_all('/[<](?<url>http.*)[>]/', $extensions, $matches)) {
foreach ($matches['url'] as $url) {
passthru('git clone ' . escapeshellarg($url));
}
}
echo "ask:\n";
passthru('grep -R "ask(" . | wc -l');
echo "askAndValidate:\n";
passthru('grep -R "askAndValidate(" . | wc -l');
echo "askAndValidate:\n";
passthru('grep -R "askConfirmation(" . | wc -l');
exec('rm -rf '. escapeshellarg($tmp));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment