Fixed `xfw build` + added statistics + log

This commit is contained in:
xdrm-brackets 2016-12-07 12:51:13 +01:00
parent 93653d8680
commit b98a8419d4
36 changed files with 89 additions and 74 deletions

View File

@ -33,25 +33,40 @@
/* [1] Builds project's base file structure
=========================================================*/
/* (1) Copy from src/files */
echo "(1) Building file structure\n";
shell_exec("cp -r ".__ROOT__."/src/files/* ".$this->root);
/* [2] Browse each package to load
=========================================================*/
foreach($this->packages as $package=>$version){
$path = "/$package/$version";
echo "(2) Building packages\n";
$count = 1;
foreach($this->packages as $package=>$version){
$path = "$package/$version";
echo " ($count) $package:$version\n";
/* (1) Copy package folder if it exists */
if( file_exists(__ROOT__."/src/packages$path/") && is_dir(__ROOT__."/src/packages$path/") && count(scandir(__ROOT__."/src/packages$path/")) > 2 )
shell_exec("cp -r ".__ROOT__."/src/packages$path ".$this->root."/build/$package");
if( file_exists(__ROOT__."/src/packages/$path") && is_dir(__ROOT__."/src/packages/$path") && count(scandir(__ROOT__."/src/packages/$path")) > 2 )
shell_exec("cp -r ".__ROOT__."/src/packages/$path ".$this->root."/build/$package");
/* (2) Copy package config if it exists */
if( file_exists(__ROOT__."/src/config$path/") && is_dir(__ROOT__."/src/config$path/") && count(scandir(__ROOT__."/src/config$path/")) > 2 )
shell_exec("cp -r ".__ROOT__."/src/config$path/* ".$this->root."/config/");
if( file_exists(__ROOT__."/src/config/$path") && is_dir(__ROOT__."/src/config/$path") && count(scandir(__ROOT__."/src/config/$path")) > 2 )
shell_exec("cp -r ".__ROOT__."/src/config/$path/* ".$this->root."/config/");
$count++;
}
echo "(*) Build finished\n";
/* [3] Start stats
=========================================================*/
echo "\n\nStatistics:\n";
echo shell_exec("du -hs ".$this->root."/*;");
echo "--\n";
echo shell_exec("du -hs ".$this->root."/;");
}

View File

@ -1,69 +1,69 @@
{
"available": {
"error": {
"1.0": [],
"2.0": []
},
"http": {
"1.0": []
},
"api": {
"1.0": {
"error": [
"1.0"
]
},
"2.0": {
"error": [
"2.0"
]
},
"2.1": {
"error": [
"2.0"
],
"http": [
"1.0"
]
}
},
"orm": {
"0.8.1": {
"database": [
"1.0"
]
},
"0.8.2": {
"database": [
"2.0"
]
}
},
"database": {
"1.0": {
"error": [
"1.0"
]
},
"2.0": {
"error": [
"2.0"
]
}
},
"lightdb": {
"1.0": []
},
"router": {
"1.0": []
}
},
"installed": {
"api": "2.1",
"error": "2.0",
"http": "1.0",
"orm": "0.8.2",
"database": "2.0",
"router": "1.0"
}
}
"available": {
"error": {
"1.0": [],
"2.0": []
},
"http": {
"1.0": []
},
"api": {
"1.0": {
"error": [
"1.0"
]
},
"2.0": {
"error": [
"2.0"
]
},
"2.2": {
"error": [
"2.0"
],
"http": [
"1.0"
]
}
},
"orm": {
"0.8.1": {
"database": [
"1.0"
]
},
"0.8.2": {
"database": [
"2.0"
]
}
},
"database": {
"1.0": {
"error": [
"1.0"
]
},
"2.0": {
"error": [
"2.0"
]
}
},
"lightdb": {
"1.0": []
},
"router": {
"1.0": []
}
},
"installed": {
"api": "2.2",
"error": "2.0",
"http": "1.0",
"orm": "0.8.2",
"database": "2.0",
"router": "1.0"
}
}