( ! ) Warning: SQLite3::query(): database is locked in /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php on line 63
Call Stack
#TimeMemoryFunctionLocation
10.0002396384{main}( ).../index.php:0
20.0065516520Miniframe\Core\Bootstrap->run( $projectFolder = '/var/www/html/public/../' ).../index.php:5
30.09821204496call_user_func:{/var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php:105}( $function_name = class Closure { virtual $closure = "$this->Miniframe\Statistics\Middleware\{closure}", public $this = class App\Middleware\Statistics { private array $countryIpCache = [...]; protected $CountryMmdbFile = '/var/www/html/cache/geoip//GeoLite2-Country.mmdb'; protected $browscap = class Miniframe\Statistics\Service\Browscap { ... }; protected $storage = class Miniframe\Statistics\Service\Storage { ... }; protected $statisticsPrefix = 'statistics'; protected $ignoreCollection = FALSE; protected $request = class Miniframe\Core\Request { ... }; protected $config = class Miniframe\Core\Config { ... } }; public $parameter = ['$response' => '<required>'] }, $parameters = class Miniframe\Response\PhpResponse { private $phpFile = '/var/www/html/src/Controller/../../templates/archive/vb6-functions-preview.html.php'; private $variables = ['baseHref' => '/', 'function' => class App\Model\Vb6Function { ... }, 'fullCode' => 'Attribute VB_Name = "modFileGetContents"\r\n\' This function is downloaded from:\r\n\' http://www.stefanthoolen.nl/archive/vb6-functions/\r\n\' \r\n\' You may freely distribute this file but please leave all comments, including this one, in it.\r\n\' \r\n\' @Author Stefan Thoolen <mail@stefanthoolen.nl>\r\n\r\nOption Explicit\r\n\r\n\'\'\n\' Reads entire file into a string\n\' Almost the same syntax as the PHP function \'file_get_contents\'\n\' See also: http://www.php.net/manual/en/function.file-get-contents.php\n\' @param String filename '..., 'filename' => 'FileGetContents.bas']; private ${Miniframe\Core\Response}text = NULL; private ${Miniframe\Core\Response}exitCode = 0; private ${Miniframe\Core\Response}responseCode = 200; private ${Miniframe\Core\Response}headers = []; protected $message = ''; private ${Exception}string = ''; protected $code = 0; protected $file = '/var/www/html/src/Controller/Archive.php'; protected $line = 82; private ${Exception}trace = [0 => [...], 1 => [...], 2 => [...], 3 => [...]]; private ${Exception}previous = NULL }, FALSE ).../Bootstrap.php:105
40.09821204576Miniframe\Statistics\Middleware\Statistics->Miniframe\Statistics\Middleware\{closure:/var/www/html/vendor/miniframe/statistics/src/Middleware/Statistics.php:143-163}( $response = class Miniframe\Response\PhpResponse { private $phpFile = '/var/www/html/src/Controller/../../templates/archive/vb6-functions-preview.html.php'; private $variables = ['baseHref' => '/', 'function' => class App\Model\Vb6Function { ... }, 'fullCode' => 'Attribute VB_Name = "modFileGetContents"\r\n\' This function is downloaded from:\r\n\' http://www.stefanthoolen.nl/archive/vb6-functions/\r\n\' \r\n\' You may freely distribute this file but please leave all comments, including this one, in it.\r\n\' \r\n\' @Author Stefan Thoolen <mail@stefanthoolen.nl>\r\n\r\nOption Explicit\r\n\r\n\'\'\n\' Reads entire file into a string\n\' Almost the same syntax as the PHP function \'file_get_contents\'\n\' See also: http://www.php.net/manual/en/function.file-get-contents.php\n\' @param String filename '..., 'filename' => 'FileGetContents.bas']; private ${Miniframe\Core\Response}text = NULL; private ${Miniframe\Core\Response}exitCode = 0; private ${Miniframe\Core\Response}responseCode = 200; private ${Miniframe\Core\Response}headers = []; protected $message = ''; private ${Exception}string = ''; protected $code = 0; protected $file = '/var/www/html/src/Controller/Archive.php'; protected $line = 82; private ${Exception}trace = [0 => [...], 1 => [...], 2 => [...], 3 => [...]]; private ${Exception}previous = NULL }, FALSE ).../Bootstrap.php:105
52.06913087632Miniframe\Statistics\Service\Storage->store( $pageHit = class Miniframe\Statistics\Model\PageHit { protected $dateTime = class DateTime { public $date = '2024-10-24 18:55:02.042767'; public $timezone_type = 3; public $timezone = 'UTC' }; protected $newVisitor = TRUE; protected $requestUri = '/archive/vb6-functions/preview/file_get_contents'; protected $country = 'US'; protected $browserBrand = 'Default Browser'; protected $browserVersion = '0.0'; protected $platform = 'unknown'; protected $deviceType = 'unknown' } ).../Statistics.php:152
62.06913087632Miniframe\Statistics\Service\Storage->tableHitsPerHour( $pageHit = class Miniframe\Statistics\Model\PageHit { protected $dateTime = class DateTime { public $date = '2024-10-24 18:55:02.042767'; public $timezone_type = 3; public $timezone = 'UTC' }; protected $newVisitor = TRUE; protected $requestUri = '/archive/vb6-functions/preview/file_get_contents'; protected $country = 'US'; protected $browserBrand = 'Default Browser'; protected $browserVersion = '0.0'; protected $platform = 'unknown'; protected $deviceType = 'unknown' } ).../Storage.php:41
72.06923088912query( $query = 'CREATE TABLE IF NOT EXISTS "hits_per_hour" (\n \t"year" INTEGER NOT NULL,\n \t"month" INTEGER NOT NULL,\n \t"day" INTEGER NOT NULL,\n \t"hour" INTEGER NOT NULL,\n \t"weekday" INTEGER NOT NULL,\n \t"hits" INTEGER NOT NULL,\n \t"visitors" INTEGER NOT NULL,\n \tCONSTRAINT "date" PRIMARY KEY("year","month","day","hour")\n )' ).../Storage.php:63

( ! ) Warning: SQLite3::query(): database is locked in /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php on line 76
Call Stack
#TimeMemoryFunctionLocation
10.0002396384{main}( ).../index.php:0
20.0065516520Miniframe\Core\Bootstrap->run( $projectFolder = '/var/www/html/public/../' ).../index.php:5
30.09821204496call_user_func:{/var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php:105}( $function_name = class Closure { virtual $closure = "$this->Miniframe\Statistics\Middleware\{closure}", public $this = class App\Middleware\Statistics { private array $countryIpCache = [...]; protected $CountryMmdbFile = '/var/www/html/cache/geoip//GeoLite2-Country.mmdb'; protected $browscap = class Miniframe\Statistics\Service\Browscap { ... }; protected $storage = class Miniframe\Statistics\Service\Storage { ... }; protected $statisticsPrefix = 'statistics'; protected $ignoreCollection = FALSE; protected $request = class Miniframe\Core\Request { ... }; protected $config = class Miniframe\Core\Config { ... } }; public $parameter = ['$response' => '<required>'] }, $parameters = class Miniframe\Response\PhpResponse { private $phpFile = '/var/www/html/src/Controller/../../templates/archive/vb6-functions-preview.html.php'; private $variables = ['baseHref' => '/', 'function' => class App\Model\Vb6Function { ... }, 'fullCode' => 'Attribute VB_Name = "modFileGetContents"\r\n\' This function is downloaded from:\r\n\' http://www.stefanthoolen.nl/archive/vb6-functions/\r\n\' \r\n\' You may freely distribute this file but please leave all comments, including this one, in it.\r\n\' \r\n\' @Author Stefan Thoolen <mail@stefanthoolen.nl>\r\n\r\nOption Explicit\r\n\r\n\'\'\n\' Reads entire file into a string\n\' Almost the same syntax as the PHP function \'file_get_contents\'\n\' See also: http://www.php.net/manual/en/function.file-get-contents.php\n\' @param String filename '..., 'filename' => 'FileGetContents.bas']; private ${Miniframe\Core\Response}text = NULL; private ${Miniframe\Core\Response}exitCode = 0; private ${Miniframe\Core\Response}responseCode = 200; private ${Miniframe\Core\Response}headers = []; protected $message = ''; private ${Exception}string = ''; protected $code = 0; protected $file = '/var/www/html/src/Controller/Archive.php'; protected $line = 82; private ${Exception}trace = [0 => [...], 1 => [...], 2 => [...], 3 => [...]]; private ${Exception}previous = NULL }, FALSE ).../Bootstrap.php:105
40.09821204576Miniframe\Statistics\Middleware\Statistics->Miniframe\Statistics\Middleware\{closure:/var/www/html/vendor/miniframe/statistics/src/Middleware/Statistics.php:143-163}( $response = class Miniframe\Response\PhpResponse { private $phpFile = '/var/www/html/src/Controller/../../templates/archive/vb6-functions-preview.html.php'; private $variables = ['baseHref' => '/', 'function' => class App\Model\Vb6Function { ... }, 'fullCode' => 'Attribute VB_Name = "modFileGetContents"\r\n\' This function is downloaded from:\r\n\' http://www.stefanthoolen.nl/archive/vb6-functions/\r\n\' \r\n\' You may freely distribute this file but please leave all comments, including this one, in it.\r\n\' \r\n\' @Author Stefan Thoolen <mail@stefanthoolen.nl>\r\n\r\nOption Explicit\r\n\r\n\'\'\n\' Reads entire file into a string\n\' Almost the same syntax as the PHP function \'file_get_contents\'\n\' See also: http://www.php.net/manual/en/function.file-get-contents.php\n\' @param String filename '..., 'filename' => 'FileGetContents.bas']; private ${Miniframe\Core\Response}text = NULL; private ${Miniframe\Core\Response}exitCode = 0; private ${Miniframe\Core\Response}responseCode = 200; private ${Miniframe\Core\Response}headers = []; protected $message = ''; private ${Exception}string = ''; protected $code = 0; protected $file = '/var/www/html/src/Controller/Archive.php'; protected $line = 82; private ${Exception}trace = [0 => [...], 1 => [...], 2 => [...], 3 => [...]]; private ${Exception}previous = NULL }, FALSE ).../Bootstrap.php:105
52.06913087632Miniframe\Statistics\Service\Storage->store( $pageHit = class Miniframe\Statistics\Model\PageHit { protected $dateTime = class DateTime { public $date = '2024-10-24 18:55:02.042767'; public $timezone_type = 3; public $timezone = 'UTC' }; protected $newVisitor = TRUE; protected $requestUri = '/archive/vb6-functions/preview/file_get_contents'; protected $country = 'US'; protected $browserBrand = 'Default Browser'; protected $browserVersion = '0.0'; protected $platform = 'unknown'; protected $deviceType = 'unknown' } ).../Statistics.php:152
62.06913087632Miniframe\Statistics\Service\Storage->tableHitsPerHour( $pageHit = class Miniframe\Statistics\Model\PageHit { protected $dateTime = class DateTime { public $date = '2024-10-24 18:55:02.042767'; public $timezone_type = 3; public $timezone = 'UTC' }; protected $newVisitor = TRUE; protected $requestUri = '/archive/vb6-functions/preview/file_get_contents'; protected $country = 'US'; protected $browserBrand = 'Default Browser'; protected $browserVersion = '0.0'; protected $platform = 'unknown'; protected $deviceType = 'unknown' } ).../Storage.php:41
72.07273092536query( $query = 'INSERT OR IGNORE INTO "hits_per_hour" VALUES (\n 2024, 10, 24, 18, 4, 0, 0\n )' ).../Storage.php:76

( ! ) Warning: SQLite3::query(): database is locked in /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php on line 84
Call Stack
#TimeMemoryFunctionLocation
10.0002396384{main}( ).../index.php:0
20.0065516520Miniframe\Core\Bootstrap->run( $projectFolder = '/var/www/html/public/../' ).../index.php:5
30.09821204496call_user_func:{/var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php:105}( $function_name = class Closure { virtual $closure = "$this->Miniframe\Statistics\Middleware\{closure}", public $this = class App\Middleware\Statistics { private array $countryIpCache = [...]; protected $CountryMmdbFile = '/var/www/html/cache/geoip//GeoLite2-Country.mmdb'; protected $browscap = class Miniframe\Statistics\Service\Browscap { ... }; protected $storage = class Miniframe\Statistics\Service\Storage { ... }; protected $statisticsPrefix = 'statistics'; protected $ignoreCollection = FALSE; protected $request = class Miniframe\Core\Request { ... }; protected $config = class Miniframe\Core\Config { ... } }; public $parameter = ['$response' => '<required>'] }, $parameters = class Miniframe\Response\PhpResponse { private $phpFile = '/var/www/html/src/Controller/../../templates/archive/vb6-functions-preview.html.php'; private $variables = ['baseHref' => '/', 'function' => class App\Model\Vb6Function { ... }, 'fullCode' => 'Attribute VB_Name = "modFileGetContents"\r\n\' This function is downloaded from:\r\n\' http://www.stefanthoolen.nl/archive/vb6-functions/\r\n\' \r\n\' You may freely distribute this file but please leave all comments, including this one, in it.\r\n\' \r\n\' @Author Stefan Thoolen <mail@stefanthoolen.nl>\r\n\r\nOption Explicit\r\n\r\n\'\'\n\' Reads entire file into a string\n\' Almost the same syntax as the PHP function \'file_get_contents\'\n\' See also: http://www.php.net/manual/en/function.file-get-contents.php\n\' @param String filename '..., 'filename' => 'FileGetContents.bas']; private ${Miniframe\Core\Response}text = NULL; private ${Miniframe\Core\Response}exitCode = 0; private ${Miniframe\Core\Response}responseCode = 200; private ${Miniframe\Core\Response}headers = []; protected $message = ''; private ${Exception}string = ''; protected $code = 0; protected $file = '/var/www/html/src/Controller/Archive.php'; protected $line = 82; private ${Exception}trace = [0 => [...], 1 => [...], 2 => [...], 3 => [...]]; private ${Exception}previous = NULL }, FALSE ).../Bootstrap.php:105
40.09821204576Miniframe\Statistics\Middleware\Statistics->Miniframe\Statistics\Middleware\{closure:/var/www/html/vendor/miniframe/statistics/src/Middleware/Statistics.php:143-163}( $response = class Miniframe\Response\PhpResponse { private $phpFile = '/var/www/html/src/Controller/../../templates/archive/vb6-functions-preview.html.php'; private $variables = ['baseHref' => '/', 'function' => class App\Model\Vb6Function { ... }, 'fullCode' => 'Attribute VB_Name = "modFileGetContents"\r\n\' This function is downloaded from:\r\n\' http://www.stefanthoolen.nl/archive/vb6-functions/\r\n\' \r\n\' You may freely distribute this file but please leave all comments, including this one, in it.\r\n\' \r\n\' @Author Stefan Thoolen <mail@stefanthoolen.nl>\r\n\r\nOption Explicit\r\n\r\n\'\'\n\' Reads entire file into a string\n\' Almost the same syntax as the PHP function \'file_get_contents\'\n\' See also: http://www.php.net/manual/en/function.file-get-contents.php\n\' @param String filename '..., 'filename' => 'FileGetContents.bas']; private ${Miniframe\Core\Response}text = NULL; private ${Miniframe\Core\Response}exitCode = 0; private ${Miniframe\Core\Response}responseCode = 200; private ${Miniframe\Core\Response}headers = []; protected $message = ''; private ${Exception}string = ''; protected $code = 0; protected $file = '/var/www/html/src/Controller/Archive.php'; protected $line = 82; private ${Exception}trace = [0 => [...], 1 => [...], 2 => [...], 3 => [...]]; private ${Exception}previous = NULL }, FALSE ).../Bootstrap.php:105
52.06913087632Miniframe\Statistics\Service\Storage->store( $pageHit = class Miniframe\Statistics\Model\PageHit { protected $dateTime = class DateTime { public $date = '2024-10-24 18:55:02.042767'; public $timezone_type = 3; public $timezone = 'UTC' }; protected $newVisitor = TRUE; protected $requestUri = '/archive/vb6-functions/preview/file_get_contents'; protected $country = 'US'; protected $browserBrand = 'Default Browser'; protected $browserVersion = '0.0'; protected $platform = 'unknown'; protected $deviceType = 'unknown' } ).../Statistics.php:152
62.06913087632Miniframe\Statistics\Service\Storage->tableHitsPerHour( $pageHit = class Miniframe\Statistics\Model\PageHit { protected $dateTime = class DateTime { public $date = '2024-10-24 18:55:02.042767'; public $timezone_type = 3; public $timezone = 'UTC' }; protected $newVisitor = TRUE; protected $requestUri = '/archive/vb6-functions/preview/file_get_contents'; protected $country = 'US'; protected $browserBrand = 'Default Browser'; protected $browserVersion = '0.0'; protected $platform = 'unknown'; protected $deviceType = 'unknown' } ).../Storage.php:41
72.07553092632query( $query = 'UPDATE `hits_per_hour` SET \n `hits` = `hits` + 1\n , `visitors` = `visitors` + 1\n WHERE \n `year` = 2024 AND `month` = 10 AND `day` = 24 AND `hour` = 18\n ' ).../Storage.php:84

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php:63) in /var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php on line 117
Call Stack
#TimeMemoryFunctionLocation
10.0002396384{main}( ).../index.php:0
20.0065516520Miniframe\Core\Bootstrap->run( $projectFolder = '/var/www/html/public/../' ).../index.php:5
32.09543093344header( $header = 'Content-Security-Policy: frame-ancestors \'none\'; base-uri \'self\'; object-src \'none\'; img-src data: \'self\'; form-action \'self\'; default-src \'self\' https://cdn.jsdelivr.net', $replace = TRUE ).../Bootstrap.php:117

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php:63) in /var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php on line 117
Call Stack
#TimeMemoryFunctionLocation
10.0002396384{main}( ).../index.php:0
20.0065516520Miniframe\Core\Bootstrap->run( $projectFolder = '/var/www/html/public/../' ).../index.php:5
32.09603093344header( $header = 'X-Content-Type-Options: nosniff', $replace = TRUE ).../Bootstrap.php:117

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php:63) in /var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php on line 117
Call Stack
#TimeMemoryFunctionLocation
10.0002396384{main}( ).../index.php:0
20.0065516520Miniframe\Core\Bootstrap->run( $projectFolder = '/var/www/html/public/../' ).../index.php:5
32.09653093344header( $header = 'Referrer-Policy: same-origin', $replace = TRUE ).../Bootstrap.php:117

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php:63) in /var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php on line 117
Call Stack
#TimeMemoryFunctionLocation
10.0002396384{main}( ).../index.php:0
20.0065516520Miniframe\Core\Bootstrap->run( $projectFolder = '/var/www/html/public/../' ).../index.php:5
32.09693093344header( $header = 'Strict-Transport-Security: max-age=63072000', $replace = TRUE ).../Bootstrap.php:117

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php:63) in /var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php on line 117
Call Stack
#TimeMemoryFunctionLocation
10.0002396384{main}( ).../index.php:0
20.0065516520Miniframe\Core\Bootstrap->run( $projectFolder = '/var/www/html/public/../' ).../index.php:5
32.09753093344header( $header = 'Permissions-Policy: camera=(), microphone=(), geolocation=()', $replace = TRUE ).../Bootstrap.php:117

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php:63) in /var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php on line 117
Call Stack
#TimeMemoryFunctionLocation
10.0002396384{main}( ).../index.php:0
20.0065516520Miniframe\Core\Bootstrap->run( $projectFolder = '/var/www/html/public/../' ).../index.php:5
32.09803093344header( $header = 'X-Frame-Options: DENY', $replace = TRUE ).../Bootstrap.php:117

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/vendor/miniframe/statistics/src/Service/Storage.php:63) in /var/www/html/vendor/miniframe/core/src/Core/Bootstrap.php on line 117
Call Stack
#TimeMemoryFunctionLocation
10.0002396384{main}( ).../index.php:0
20.0065516520Miniframe\Core\Bootstrap->run( $projectFolder = '/var/www/html/public/../' ).../index.php:5
32.09823093344header( $header = 'X-XSS-Protection: 1', $replace = TRUE ).../Bootstrap.php:117
Stefan Thoolen .nl | VB6 Function Database

Visual Basic 6 function "file_get_contents"

Go back

Below you'll find the source for the Visual Basic 6 function file_get_contents.

Attribute VB_Name = "modFileGetContents"
' This function is downloaded from:
' http://www.stefanthoolen.nl/archive/vb6-functions/
' 
' You may freely distribute this file but please leave all comments, including this one, in it.
' 
' @Author Stefan Thoolen <mail@stefanthoolen.nl>

Option Explicit

''
' Reads entire file into a string
' Almost the same syntax as the PHP function 'file_get_contents'
' See also: http://www.php.net/manual/en/function.file-get-contents.php
' @param    String  filename        The file to read
' @return   String                  The contents of the file
' @author   Stefan Thoolen <mail@stefanthoolen.nl>
Public Function file_get_contents(filename As String) As String
    Dim thedata As String, ff As Integer
    ' Note, length of 'TheData' will determine how many bytes are read.
    ff = FreeFile
    Open filename For Binary Access Read Shared As #ff
        thedata = Space(LOF(ff))
        Get #ff, 1, thedata
    Close #ff
    
    file_get_contents = thedata
End Function