cvs: php-src /win32 syslog.reg /win32/build registersyslog.php
| From: | Wez Furlong | Date: | Thu, 05 Aug 2004 12:15:17 +0000 |
| Subject: | cvs: php-src /win32 syslog.reg /win32/build registersyslog.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-28197@lists.php.net to get a copy of this message | ||
wez Thu Aug 5 08:15:17 2004 EDT
Added files:
/php-src/win32 syslog.reg
Modified files:
/php-src/win32/build registersyslog.php
Log:
Generate a .reg file for the syslog stuff
NB: still need a solution for zts and non-zts on the same machine.
http://cvs.php.net/diff.php/php-src/win32/build/registersyslog.php?r1=1.1&r2=1.2&ty=u
Index: php-src/win32/build/registersyslog.php
diff -u php-src/win32/build/registersyslog.php:1.1 php-src/win32/build/registersyslog.php:1.2
--- php-src/win32/build/registersyslog.php:1.1 Sat Jul 31 19:59:46 2004
+++ php-src/win32/build/registersyslog.php Thu Aug 5 08:15:17 2004
@@ -3,24 +3,43 @@
/* This script sets up an event source for use by the php syslog() function. */
if (!extension_loaded("win32std")) {
- dl("php_win32std.dll") or die("b0rk");
+ dl("php_win32std.dll");
}
$PATH = "SYSTEM\\CurrentControlSet\\Services\\Eventlog\\Application\\PHP-" .
phpversion();
-$key = @reg_create_key(HKEY_LOCAL_MACHINE, $PATH, KEY_ALL_ACCESS);
+$dll = $argv[1];
-if (!$key)
- $key = reg_open_key(HKEY_LOCAL_MACHINE, $PATH, KEY_ALL_ACCESS);
+if (extension_loaded("win32std")) {
+ $key = @reg_create_key(HKEY_LOCAL_MACHINE, $PATH, KEY_ALL_ACCESS);
-if ($key) {
- reg_set_value($key, "TypesSupported", REG_DWORD, 7) or die("Types");
- reg_set_value($key, "EventMessageFile", REG_SZ, $argv[1]) or
die("EventMessageFile");
-
- define_syslog_variables();
- syslog(LOG_NOTICE, "Registered PHP Event source");
-} else {
- echo "Could not register event source\n";
+ if (!$key)
+ $key = reg_open_key(HKEY_LOCAL_MACHINE, $PATH, KEY_ALL_ACCESS);
+
+ if ($key) {
+ reg_set_value($key, "TypesSupported", REG_DWORD, 7) or die("Types");
+ reg_set_value($key, "EventMessageFile", REG_SZ, $dll) or
die("EventMessageFile");
+
+ define_syslog_variables();
+ syslog(LOG_NOTICE, "Registered PHP Event source");
+ } else {
+ echo "Could not register event source\n";
+ }
}
+
+/* let's also generate/update the bundled .reg file */
+
+$dll = addslashes($dll);
+
+file_put_contents("win32/syslog.reg", <<<REG
+REGEDIT4
+
+[HKEY_LOCAL_MACHINE\\$PATH]
+"TypesSupported"=dword:00000007
+"EventMessageFile"="$dll"
+
+REG
+);
+
?>
http://cvs.php.net/co.php/php-src/win32/syslog.reg?r=1.1&p=1
Index: php-src/win32/syslog.reg
+++ php-src/win32/syslog.reg
REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PHP-5.1.0-dev]
"TypesSupported"=dword:00000007
"EventMessageFile"="C:\\php5\\php5ts.dll"