@@ -678,10 +678,26 @@ int zend_file_cache_script_store(zend_persistent_script *script, int in_shm)
678
678
len = strlen (ZCG (accel_directives ).file_cache );
679
679
filename = emalloc (len + 33 + ZSTR_LEN (script -> full_path ) + sizeof (SUFFIX ));
680
680
memcpy (filename , ZCG (accel_directives ).file_cache , len );
681
+ #ifndef ZEND_WIN32
681
682
filename [len ] = '/' ;
682
683
memcpy (filename + len + 1 , ZCG (system_id ), 32 );
683
684
memcpy (filename + len + 33 , ZSTR_VAL (script -> full_path ), ZSTR_LEN (script -> full_path ));
684
685
memcpy (filename + len + 33 + ZSTR_LEN (script -> full_path ), SUFFIX , sizeof (SUFFIX ));
686
+ #else
687
+ filename [len ] = '\\' ;
688
+ memcpy (filename + len + 1 , ZCG (system_id ), 32 );
689
+ if (ZSTR_LEN (script -> full_path ) >= 2 && ':' == ZSTR_VAL (script -> full_path )[1 ]) {
690
+ /* local fs */
691
+ * (filename + len + 33 ) = '\\' ;
692
+ * (filename + len + 34 ) = ZSTR_VAL (script -> full_path )[0 ];
693
+ memcpy (filename + len + 35 , ZSTR_VAL (script -> full_path ) + 2 , ZSTR_LEN (script -> full_path ) - 2 );
694
+ memcpy (filename + len + 35 + ZSTR_LEN (script -> full_path ) - 2 , SUFFIX , sizeof (SUFFIX ));
695
+ } else {
696
+ /* network path */
697
+ memcpy (filename + len + 33 , ZSTR_VAL (script -> full_path ), ZSTR_LEN (script -> full_path ));
698
+ memcpy (filename + len + 33 + ZSTR_LEN (script -> full_path ), SUFFIX , sizeof (SUFFIX ));
699
+ }
700
+ #endif
685
701
686
702
if (zend_file_cache_mkdir (filename , len ) != SUCCESS ) {
687
703
zend_accel_error (ACCEL_LOG_WARNING , "opcache cannot create directory for file '%s'\n" , filename );
0 commit comments