File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Check permissions for created errorlog file
3
+ --SKIPIF--
4
+ <?php
5
+ if (strtoupper (substr (PHP_OS , 0 , 3 )) === 'WIN ' ) {
6
+ die ("skip this test on windows " );
7
+ }
8
+ ?>
9
+ --INI--
10
+ error_log=error_permissions_test.log
11
+ error_log_mode=0600
12
+ --FILE--
13
+ <?php
14
+
15
+ const LOG_FILENAME ='error_permissions_test.log ' ;
16
+
17
+ try {
18
+ if (file_exists (LOG_FILENAME )) {
19
+ unlink (LOG_FILENAME );
20
+ }
21
+ $ oldMask = umask (0000 );
22
+
23
+ error_log ("hello world " );
24
+
25
+ assert (file_exists (LOG_FILENAME ));
26
+
27
+ printf ("got permissions=%o \n" , fileperms (LOG_FILENAME ) & 0777 );
28
+ printf ("errorlog contents \n%s " , file_get_contents (LOG_FILENAME ));
29
+
30
+ umask ($ oldMask );
31
+ } finally {
32
+ unlink (LOG_FILENAME );
33
+ }
34
+ ?>
35
+ --EXPECTF--
36
+ got permissions=600
37
+ errorlog contents
38
+ [%d-%s-%d %d:%d:%d %s] hello world
You can’t perform that action at this time.
0 commit comments