Last active
October 23, 2015 21:12
-
-
Save bgarrison25/fa58a8301a050532514f to your computer and use it in GitHub Desktop.
seriously??? WTF
This file contains 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 | |
$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