Re: register_shutdown_function() not working ?
| From: | Andrew Sitnikov | Date: | Sat, 27 Jan 2001 20:58:31 +0000 |
| Subject: | Re: register_shutdown_function() not working ? | ||
| References: | 1 | Groups: | php.dev php.general |
| Request: | Send a blank email to php-general+get-37019@lists.php.net to get a copy of this message | ||
Hello Andrew,
Sorry, but i forget what I have Zend Debuger :)
Problem in file path, when i use absolute path
/home/user/tmp/tmp/text.txt all works.
It appears, that in shutdown_function getcwd () == '/',
but in script getcwd () == '/home/user/public_html/'
Only not clearly why.
AS> Hello php-general,
AS> Why this not working (php.4.0.4pl1_Linux)?
AS> <?
AS> error_reporting(E_ALL);
AS> $file_name = '../tmp/text.txt';
AS> function funct1(){
AS> global $file_name;
AS> if ($fd = fopen($file_name,'a+')){
AS> fwrite($fd,"Funct1\n");
AS> fclose($fd);
AS> }else{
AS> die("Can not open output file");
AS> }
AS> }
AS> function funct2(){
AS> global $file_name;
AS> if ($fd = fopen($file_name,'a+')){
AS> fwrite($fd,"Funct2\n");
AS> fclose($fd);
AS> }
AS> }
AS> $i = register_shutdown_function('funct2');
AS> funct1();
?>>
AS> file have only "Funct1" ?
AS> Best regards,
AS> Andrew Sitnikov
AS> e-mail : sitnikov@infonet.ee
AS> GSM: (+372) 56491109
Best regards,
Andrew Sitnikov
e-mail : sitnikov@infonet.ee
GSM : (+372) 56491109