functions/php_function.php
//this is to record log file for debugging purpose//afdzal
this is to record log file for debugging purpose//afdzal
this is to record log file for debugging purpose // afdzal
function createFiles()
{
	$sqlParam = mysqli_query($con,"SELECT * FROM buildConfigParam where bcId = '$ids' ORDER BY paramId ASC LIMIT 1");
	$rowParam = mysqli_fetch_array($sqlParam);
	$REV = $rowParam['value'];
	if($REV=="") {$REV="001";}  
     if(mkdir("../../project_build/".$familyName."/".$product_name."/".$buildConfigName."/".$product_name."-M0_".$REV))
	 {			unlink("GZIP.txt"); 
				file_put_contents("GZIP.txt","CREATED - "."../../project_build/".$familyName."/".$product_name."/".$buildConfigName."/".$buildConfigName."-M0-006", FILE_APPEND);	
				mkdir("../../project_build/".$familyName."/".$product_name."/".$buildConfigName."/".$product_name."-M0_".$REV." Test Logs");
				mkdir("../../project_build/".$familyName."/".$product_name."/".$buildConfigName."/".$product_name."-M0_".$REV." Test Logs/FCT");
				mkdir("../../project_build/".$familyName."/".$product_name."/".$buildConfigName."/".$product_name."-M0_".$REV." Test Logs/OBA"); 
				}
custom_copy($folder_path_products."/".$file, "../../project_build/".$familyName."/".$product_name."/".$buildConfigName."/Working Folder/support/"); 
$path = "../../project_build/".$familyName."/".$product_name."/".$buildConfigName."/Working Folder/support/";
$rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
$files = array(); 
foreach ($rii as $file) {
    if ($file->isDir()){ 
        continue;
    }
    $files[] = $file->getPathname(); 
}
foreach($files as $file) {   
   if (strpos($file, '.bin') !== false) {
	   $myFile = pathinfo($file); 
	   copy($file, $path."".$myFile['basename']);
   }
   if (strpos($file, '.txt') !== false) {
	   $myFile = pathinfo($file); 
	   copy($file, $path."".$myFile['basename']);} 
}
}
function createFiles ( ) { $ sqlParam = mysqli_query ( $ con , " SELECT * FROM buildConfigParam where bcId = ' $ ids ' ORDER BY paramId ASC LIMIT 1 " ) ; $ rowParam = mysqli_fetch_array ( $ sqlParam ) ; $ REV = $ rowParam [ 'value' ] ; if ( $ REV == " " ) { $ REV = " 001 " ; } if ( mkdir ( " ../../project_build/ " . $ familyName . " / " . $ product_name . " / " . $ buildConfigName . " / " . $ product_name . " -M0_ " . $ REV ) ) { unlink ( " GZIP.txt " ) ; file_put_contents ( " GZIP.txt " , " CREATED -  " . " ../../project_build/ " . $ familyName . " / " . $ product_name . " / " . $ buildConfigName . " / " . $ buildConfigName . " -M0-006 " , FILE_APPEND ) ; mkdir ( " ../../project_build/ " . $ familyName . " / " . $ product_name . " / " . $ buildConfigName . " / " . $ product_name . " -M0_ " . $ REV . "  Test Logs " ) ; mkdir ( " ../../project_build/ " . $ familyName . " / " . $ product_name . " / " . $ buildConfigName . " / " . $ product_name . " -M0_ " . $ REV . "  Test Logs/FCT " ) ; mkdir ( " ../../project_build/ " . $ familyName . " / " . $ product_name . " / " . $ buildConfigName . " / " . $ product_name . " -M0_ " . $ REV . "  Test Logs/OBA " ) ; } custom_copy ( $ folder_path_products . " / " . $ file , " ../../project_build/ " . $ familyName . " / " . $ product_name . " / " . $ buildConfigName . " /Working Folder/support/ " ) ; $ path = " ../../project_build/ " . $ familyName . " / " . $ product_name . " / " . $ buildConfigName . " /Working Folder/support/ " ; $ rii = new RecursiveIteratorIterator ( new RecursiveDirectoryIterator ( $ path ) ) ; $ files = array ( ) ; foreach ( $ rii as $ file ) { if ( $ file -> isDir ( ) ) { continue ; } $ files [ ] = $ file -> getPathname ( ) ; } foreach ( $ files as $ file ) { if ( strpos ( $ file , '.bin' ) !== false ) { $ myFile = pathinfo ( $ file ) ; copy ( $ file , $ path . " " . $ myFile [ 'basename' ] ) ; } if ( strpos ( $ file , '.txt' ) !== false ) { $ myFile = pathinfo ( $ file ) ; copy ( $ file , $ path . " " . $ myFile [ 'basename' ] ) ; } } }
this is to record log file for debugging purpose//afdzal
this is to record log file for debugging purpose // afdzal
//for andy folder //mkdir("../../project_build/".$product_name);	 //mkdir("../../project_build/".$familyName."/".$product_name."/".$buildConfigName); //mkdir("../../project_build/".$familyName."/".$product_name."/".$buildConfigName."/ANDY"); //mkdir("../../project_build/".$familyName."/".$product_name."/".$buildConfigName."/bc");  //mkdir("../../project_build/".$familyName."/".$product_name."/".$buildConfigName."/ALBERT");   //mkdir("../../project_build/".$familyName."/".$product_name."/".$buildConfigName."/Working Folder");	 //mkdir("../../project_build/".$familyName."/".$product_name."/".$buildConfigName."/Working Folder/support"); /*
	$files = scandir($folder_path_products);
		
		foreach($files as $file) 
		{ 
		
			if (strpos($file, 'img') !== false) { 
			
			copy($folder_path_products."/".$file, "../../project_build/".$familyName."/".$product_name."/".$buildConfigName."/Working Folder/support/".$file);
			
			}
		}
	*/ //file_put_contents("albert.txt", $path, FILE_APPEND); //print("<pre>".print_r($files,true)."</pre>"); //echo "<br><br><br>";