File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,17 @@ public static function writeToFile($msg)
88 {
99 $ path = trim (ZCRMConfigUtil::getConfigValue (APIConstants::APPLICATION_LOGFILE_PATH ));
1010 if (!ZCRMConfigUtil::getConfigValue (APIConstants::APPLICATION_LOGFILE_PATH )) {
11- $ path =posix_getpwuid (posix_getuid ())["dir " ];
11+ $ dir_path = __DIR__ ;
12+ if (strpos ($ dir_path , "vendor " )!==false ){
13+ $ path = substr ($ dir_path ,0 , strpos ($ dir_path , "vendor " )-1 );
14+ }
15+ else {
16+ $ path = substr ($ dir_path ,0 , strpos ($ dir_path , "src " )-1 );
17+ }
1218 }
1319 $ filePointer = fopen ($ path . APIConstants::APPLICATION_LOGFILE_NAME , "a " );
1420 if (! $ filePointer ) {
15- return ;
21+ return ;
1622 }
1723 fwrite ($ filePointer , sprintf ("%s %s \n" , date ("Y-m-d H:i:s " ), $ msg ));
1824 fclose ($ filePointer );
You can’t perform that action at this time.
0 commit comments