#! /usr/bin/php getUnixName(); $cmd="/bin/mkdir $newdirlocation"; //echo "\n$cmd"; if (!is_dir($newdirlocation)){ exec($cmd,$out); } $frsps =& get_frs_packages($groups[$g]); //echo count($frsps); for ($p=0; $pGroup->getUnixName().'/'.$frsps[$p]->getFileName(); $cmd="/bin/mkdir $newdirlocation"; //echo "\n$cmd"; if (!is_dir($newdirlocation)){ exec($cmd,$out); } $frsrs =& $frsps[$p]->getReleases(); for ($r=0; $rFRSPackage->Group->getUnixName().'/'.$frsrs[$r]->FRSPackage->getFileName().'/'.$frsrs[$r]->getFileName(); $cmd="/bin/mkdir $newdirlocation"; //echo "\n$cmd"; if (!is_dir($newdirlocation)){ exec($cmd,$out); } $frsfs =& $frsrs[$r]->getFiles(); for ($f=0; $fFRSRelease->FRSPackage->Group->getUnixName().'/'.$frsfs[$f]->getName(); $newdirlocation = forge_get_config('upload_dir').'/'.$frsfs[$f]->FRSRelease->FRSPackage->Group->getUnixName().'/'.$frsfs[$f]->FRSRelease->FRSPackage->getFileName().'/'.$frsfs[$f]->FRSRelease->getFileName().'/'; if (!is_file($newdirlocation.'/'.$frsfs[$f]->getName())) { $cmd="/bin/mv $olddirlocation $newdirlocation"; //echo "\n$cmd"; exec($cmd,$out); } else { //echo "Already Exists"; } } } } } $cmd = '/bin/chown -R '.forge_get_config('apache_user').':'.forge_get_config('apache_group').' '.forge_get_config('upload_dir'); exec($cmd,$out); echo "SUCCESS"; ?>