File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ class Database
205205 *
206206 * @var string
207207 */
208- private const VERSION = '4.2.0 ' ;
208+ private const VERSION = '4.2.1 ' ;
209209
210210 /**
211211 * Include the IP address of the looked up IP address.
@@ -592,9 +592,11 @@ public function __construct($file = null, $mode = self::FILE_IO)
592592 shmop_write ($ shmId , $ buf , $ pointer );
593593 $ pointer += self ::SHM_CHUNK_SIZE ;
594594 }
595+
595596 if (PHP_MAJOR_VERSION < 8 ) {
596597 shmop_close ($ shmId );
597598 }
599+
598600 fclose ($ fp );
599601
600602 // now open the memory segment for readonly access
@@ -690,7 +692,9 @@ public function close()
690692 case self ::SHARED_MEMORY :
691693 // detach from the memory segment
692694 if ($ this ->resource !== false ) {
693- shmop_close ($ this ->resource );
695+ if (PHP_MAJOR_VERSION < 8 ) {
696+ shmop_close ($ this ->resource );
697+ }
694698 $ this ->resource = false ;
695699 }
696700 break ;
@@ -1027,7 +1031,10 @@ protected function shmTeardown($file)
10271031
10281032 // Delete and close the descriptor
10291033 shmop_delete ($ shmId );
1030- shmop_close ($ shmId );
1034+
1035+ if (PHP_MAJOR_VERSION < 8 ) {
1036+ shmop_close ($ shmId );
1037+ }
10311038 }
10321039
10331040 /**
You can’t perform that action at this time.
0 commit comments