array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to 2 => array("pipe", "w") // stderr is a file to write to ); $process = proc_open("mysqldump -u $DB_USER --password=$DB_PASS $DB_NAME > $name", $descriptorspec, $pipes); if (is_resource($process)) { proc_close($process); $fp = fopen("$name","a"); while(!feof($pipes[1])) { $str = fgets($pipes[1]); if ($str == false) break; fputs($fp, $str); } fclose($fp); } else { echo "Error opening mysqldump"; } } function fs_exec($cmd) { $descriptorspec = array( 0 => array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to 2 => array("pipe", "w") // stderr is a file to write to ); $process = proc_open($cmd, $descriptorspec, $pipes); if (is_resource($process)) { proc_close($process); while(!feof($pipes[2])) { $str = fgets($pipes[2]); if ($str == false) break; echo $str; } } else { echo "Error opening mysqldump"; } } function fs_test_dummy_auth() { $user = new stdClass(); $user->dummy = true; $user->name = "Dummy admin"; $user->security_level = SEC_ADMIN; $res = fs_start_user_session($user); if ($res) fs_store_session(); } ?>