|
Posted by .:[ ikciu ]:. on 10/03/06 15:17
Zebrawszy mysli CptDondo <yan@NsOeSiPnAeMr.com> wyklepal:
> $oldConfFile = $confFile . ".bak";
> $newConfFile = $confFile . ".new";
> $fp = fopen($newConfFile, "w");
> // FIXME error message here
> if ($fp == false ) return array();
> fputs($fp, $newConfig);
> fclose($fp);
> rename($confFile,$oldConfFile);
> rename($newConfFile,$confFile);
if (!$fp = fopen($newConfFile, 'w')) {
return array();
}
if (fwrite($fp, $newConfig) === FALSE) {
return array();
}
fclose($fp);
//ofc if you have rights to rename files
rename($confFile,$oldConfFile);
rename($newConfFile,$confFile);
or / and you can use try{
... your code...
}catch(Exception e){
return array();
}
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ikciu | gg: 718845 | www: www.e-irsa.pl
2be || !2be $this => mysql_query();
Navigation:
[Reply to this message]
|