Skip to content

Instantly share code, notes, and snippets.

@bgarrison25
Last active October 23, 2015 21:12
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 bgarrison25/fa58a8301a050532514f to your computer and use it in GitHub Desktop.
Save bgarrison25/fa58a8301a050532514f to your computer and use it in GitHub Desktop.
seriously??? WTF
<?php
$d = dir($directory);
$files = array();
while (($entry = $d->read()) !== false)
{
if ($entry !== '.' && $entry !== '..' && preg_match('/\.swp$/', $entry) !== 1)
{
$files[] = $entry;
}
}
$found_app = null;
foreach ($files as $file)
{
$parts = explode('.', $file);
if (count($parts) > 0)
{
unset($parts[count($parts) - 1]);
}
$parts = join('.', $parts);
if ($angular_app === $parts)
{
$found_app = $parts;
break;
}
}
if (is_null($found_app))
{
echo 'App "' . $angular_app . '" was not found, exiting';
exit;
}
$d = dir($directory);
$components = array();
while (($entry = $d->read()) !== false)
{
if ($entry !== '.' && $entry !== '..' && preg_match('/\.swp$/', $entry) !== 1)
{
$components[] = $entry;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment