Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

print("End of fake process.
\n");


//write message to log
$statusMessage = date("Y-m-d H:i:s"). " Fake
process $name completed\n";
error_log($statusMessage, 3, "status.log");
}


//finish script even if user
//aborts execution
ignore_user_abort(TRUE);


fakeProcess("one");


//allow aborts again
ignore_user_abort(FALSE);


fakeProcess("two");
?>


string ini_alter(string directive, string value)


Use ini_alter to override the value of one of the directives in the php.ini file. The
setting is for your script only. The file itself is not changed.


string ini_get(string directive)


The ini_get function returns the value of one of the directives in the php.ini file.


<?
//see what SMTP is now
print(ini_get("SMTP"). "
\n");


//change to bogus value
ini_alter("SMTP", "mail.corephp.com");
print(ini_get("SMTP"). "
\n");


//return to original
ini_restore("SMTP");
print(ini_get("SMTP"). "
\n");
?>


ini_restore(string directive)


The ini_restore function returns the named directive to the value in the php.ini file.
See ini_get for an example of use.


magic_quotes_runtime

Free download pdf