Commit 342d148a authored by Felix's avatar Felix

bugfixing: standard is not a module, console-bsd is now console-makefile,...

bugfixing: standard is not a module, console-bsd is now console-makefile, coneole-makefile makes now lowercase, console-makefile makes now 80 chars per row
parent 4a664c8e
# PHP Storm Directory
.idea
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -24,8 +24,8 @@ switch($argv[2]){
case "--console-full":
fullConsoleOutput($filesToCheck);
break;
case "--console-bsd":
bsdConsoleOutput($filesToCheck);
case "--console-makefile":
makefileConsoleOutput($filesToCheck);
break;
case "--testfile":
createTestfileFromTemplate($filesToCheck, $argv[3], $argv[4]);
......
......@@ -48,5 +48,5 @@ require_once __DIR__ . '/inc/func/getModulesInstalledStatus.func.php';
require_once __DIR__ . '/inc/output/basicConsoleOutput.func.php';
require_once __DIR__ . '/inc/output/fullConsoleOutput.func.php';
require_once __DIR__ . '/inc/output/bsdConsoleOutput.func.php';
require_once __DIR__ . '/inc/output/makefileConsoleOutput.func.php';
require_once __DIR__ . '/inc/output/createTestfileFromTemplate.func.php';
......@@ -18,13 +18,13 @@ function checkGivenArguments($argv) {
if(!is_array($argv))
throw new \Exception ("APHPBreakdown: Invalid parameter type! Must: array, Is: " . gettype($argv));
$acceptedOutputArguments = array("--console-basic","--console-full", "--console-bsd", "--testfile");
$acceptedOutputArguments = array("--console-basic","--console-full", "--console-makefile", "--testfile");
$acceptedTemplateArguments = array("--basic", "--advanced");
$path = realpath($argv[1]);
if(!isset($path) || !isset($argv[2]))
exitWithErrorMessage("APHPBreakdown: Not enough arguments given!\n\t\t aphpbreakdown <PATH> <OPTIONS> [--testfile <TEMPLATE>] [--testfile <EXPORT_FILENAME>]\n\t\t <PATH> /path/to/dir\n\t\t <OPTIONS> --console-basic | --console-full | --console-bsd | --testfile\n\t\t [--testfile <TEMPLATE>] --basic | --advanced\n\t\t [<EXPORT_FILENAME>] optional, no path, don't forget file extension\n");
exitWithErrorMessage("APHPBreakdown: Not enough arguments given!\n\t\t aphpbreakdown <PATH> <OPTIONS> [--testfile <TEMPLATE>] [--testfile <EXPORT_FILENAME>]\n\t\t <PATH> /path/to/dir\n\t\t <OPTIONS> --console-basic | --console-full | --console-makefile | --testfile\n\t\t [--testfile <TEMPLATE>] --basic | --advanced\n\t\t [<EXPORT_FILENAME>] optional, no path, don't forget file extension\n");
if(!is_dir($path))
exitWithErrorMessage("APHPBreakdown: There is no directory found on path \"$path\"\n");
......@@ -48,10 +48,10 @@ function checkGivenArguments($argv) {
exitWithErrorMessage("APHPBreakdown: There are sone or more Files which are not readable. Check the Output above for Details.\nChange the file Permissions. To do that use this command \"$ chmod u+r <FILE>\"\n");
if(!isset($argv[2]))
exitWithErrorMessage("APHPBreakdown: You have to give argument for output. ( aphpanalyse <PATH> <OUTPUT> [ --console-basic | --console-full | --console-bsd | --testfile ] ).\n");
exitWithErrorMessage("APHPBreakdown: You have to give argument for output. ( aphpbreakdown <PATH> <OUTPUT> [ --console-basic | --console-full | --console-makefile | --testfile ] ).\n");
if(!in_array($argv[2], $acceptedOutputArguments))
exitWithErrorMessage("APHPBreakdown: The Argument you have given is not valid. Avaible Options: <OUTPUT> [ --console-basic | --console-full | --console-bsd | --testfile ].\n");
exitWithErrorMessage("APHPBreakdown: The Argument you have given is not valid. Avaible Options: <OUTPUT> [ --console-basic | --console-full | --console-makefile | --testfile ].\n");
if($argv[2] == "--testfile" && !isset($argv[3]))
exitWithErrorMessage("APHPBreakdown: Missing Argument for --testfile. Avaible Options: [<TEMPLATE>] [ --basic | --advanced ].\n");
......
......@@ -24,7 +24,7 @@ function fullConsoleOutput($filesToCheck){
$neddedModulesInstallStatus = getModulesInstalledStatus($neededModules);
$countAllFiles = count($filesToCheck);
$countAllModules = count($neededModules);
$countAllModules = count($neededModules)-2;
$endTime = time();
$time = $endTime - $startTime;
......@@ -38,7 +38,7 @@ function fullConsoleOutput($filesToCheck){
echo " List of all Modules [ \033[0;31m missing \033[0m | \033[0;32m installed \033[0m ] :\n";
foreach($neddedModulesInstallStatus as $module => $moduleStatus){
if($module != "Core"){
if($module != "Core" && $module != "standard"){
if(!$moduleStatus){
echo " - \033[0;31m$module\033[0m\n";
} else {
......
......@@ -12,7 +12,7 @@ namespace APHPBreakdown;
*
**/
function bsdConsoleOutput($filesToCheck){
function makefileConsoleOutput($filesToCheck){
if(!is_array($filesToCheck))
throw new \Exception ("Invalid parameter type for \$filesToCheck! Must: array, Is: " . gettype($filesToCheck));
......@@ -24,7 +24,7 @@ function bsdConsoleOutput($filesToCheck){
$neddedModulesInstallStatus = getModulesInstalledStatus($neededModules);
$countAllFiles = count($filesToCheck);
$countAllModules = count($neededModules);
$countAllModules = count($neededModules)-2;
$endTime = time();
$time = $endTime - $startTime;
......@@ -37,23 +37,28 @@ function bsdConsoleOutput($filesToCheck){
echo " Needed Modules: $countAllModules\n\n";
echo " Modules for Makefile Dependencies:\n\n";
$i = 0;
$row = "";
echo "USE_PHP=\t";
foreach($neddedModulesInstallStatus as $module => $moduleStatus){
$module = strtoupper($module);
$module = strtolower($module);
$filter = array("ZEND ");
$filter = array("zend ");
$module = str_replace($filter, "", $module);
if($module != "CORE")
echo $module." ";
if($module != "core" && $module != "standard"){
$row = $row.$module." ";
$i++;
if(strlen($row) < 80){
echo $module." ";
} else {
echo $module." \\\n\t\t";
$row = "";
}
if($i == 5){
echo "\\\n";
$i = 0;
}
}
}
......
......@@ -42,10 +42,10 @@ here are some different examples for different results:
## Hot To install
# download the aphpbreakdown.phar
wget http://phar.code-mesa.com/aphpbreakdown-1.0.0.phar
wget http://phar.code-mesa.com/aphpbreakdown-2.0.0.phar
# alternativ download way
fetch http://phar.code-mesa.com/aphpbreakdown-1.0.0.phar
fetch http://phar.code-mesa.com/aphpbreakdown-2.0.0.phar
# make it executable
chmod +x aphpbreakdown.phar
......@@ -104,7 +104,7 @@ available options
you need for your project. For a better overview the list marks all results in green
and red. green it the module is installed and red if it't not.
--console-bsd
--console-makefile
this is special output to check your project required php modules for the makefile e.g.
used by FreeBSD Portstree
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment