Skip to content

Commit 0ff5931

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Use regedit to register event source
2 parents ba72a13 + f34db7f commit 0ff5931

File tree

4 files changed

+3
-30
lines changed

4 files changed

+3
-30
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ php
214214
/win32/*.positions
215215
/win32/*.suo
216216
/win32/ext
217+
/win32/syslog.reg
217218
/win32/wsyslog.h
218219

219220
# Standard object files generated by Visual Studio

win32/build/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,4 @@ really-install:
264264
@echo Registering event source with syslog (requires admin rights)
265265
@echo It's okay for this step to fail:
266266
-$(PHP_PREFIX)\php.exe -n -dextension_dir=$(PHP_PREFIX) win32/build/registersyslog.php $(PHP_PREFIX)\$(PHPDLL)
267+
-regedit /s win32\syslog.reg

win32/build/registersyslog.php

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,10 @@
11
<?php
22

3-
/* This script sets up an event source for use by the php syslog() function. */
4-
5-
if (!extension_loaded("win32std")) {
6-
@dl("php_win32std.dll");
7-
}
3+
/* This script generates the .reg file to set up an event source for use by the php syslog() function. */
84

95
$PATH = "SYSTEM\\CurrentControlSet\\Services\\Eventlog\\Application\\PHP-" . phpversion();
106

117
$dll = $argv[1];
12-
13-
if (extension_loaded("win32std")) {
14-
$key = @reg_create_key(HKEY_LOCAL_MACHINE, $PATH, KEY_ALL_ACCESS);
15-
16-
if (!$key)
17-
$key = reg_open_key(HKEY_LOCAL_MACHINE, $PATH, KEY_ALL_ACCESS);
18-
19-
if ($key) {
20-
reg_set_value($key, "TypesSupported", REG_DWORD, 7) or die("Types");
21-
reg_set_value($key, "EventMessageFile", REG_SZ, $dll) or die("EventMessageFile");
22-
23-
syslog(LOG_NOTICE, "Registered PHP Event source");
24-
} else {
25-
echo "Could not register event source\n";
26-
}
27-
}
28-
29-
/* let's also generate/update the bundled .reg file */
30-
318
$dll = addslashes($dll);
329

3310
file_put_contents("win32/syslog.reg", <<<REG
@@ -40,5 +17,4 @@
4017
REG
4118
);
4219

43-
4420
?>

win32/syslog.reg

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)