PHP Classes
elePHPant
Icontem

File: readme.md

Recommend this page to a friend!
  Classes of Damir  >  SQLite3 checker  >  readme.md  >  Download  
File: readme.md
Role: Documentation
Content type: text/markdown
Description: Readme file
Class: SQLite3 checker
Checks if a file is of a SQLite3 database
Author: By
Last change:
Date: 1 year ago
Size: 2,729 bytes
 

 

Contents

Class file image Download

SQLite3 checker

This is simple class that allows search for SQLite3 files somewhere in file system.

It happens, especially if software deals with beginers, that some created databases were dispersed over unknown destinations.

To make things more difficult, SQLite3 database could exists with various extensions, even without them. So, it is not posible to determine if something is SQLite3 file just on extension basis.

So, this class checks first 100 bytes of suspiction file and find out is it SQLite3 file.

Example 1:

This code:

$kk=new SQliteSearch("../../../",NULL,array("2"=> "repo"));

echo $kk."<br><br><br>";

foreach($kk as $k=>$v)
echo "<br>$k ".print_r($v)."<br><br>";

would make this result: <pre> Database1:../..\db\ELSE.db Database2:../..\db\MultiLang.db

Array ( [0] => SQLite format 3 [1] => [2] => [3] => [4] => [5] => @ [6] => [7] => [8] => [9] => [10] => [11] => [12] => [13] => [14] => [15] => [16] => [17] => [18] => [19] => [20] => [21] => [22] => -? ) ../..\db\ELSE.db 1

Array ( [0] => SQLite format 3 [1] => [2] => [3] => [4] => [5] => @ [6] => [7] => [8] => b [9] => [10] => [11] => [12] => [13] => [14] => [15] => [16] => [17] => [18] => [19] => [20] => [21] => [22] => ) ../..\db\MultiLang.db3 1 </pre>

Example 2:

Almost same code:

$kk=new SQliteSearch("../../../");

echo $kk."<br><br><br>";

foreach($kk as $k=>$v)
echo "<br>$k ".print_r($v)."<br><br>";

would make this result: <pre> Database1:../../..\repo\db\ELSE.db Database2:../../..\repo\db\MultiLang.db Database3:../../..\ucenici\franezidic\Db\MultiLang.db

Database4:../../..\ucenici\jadrankotudovic\Db\MultiLang.db

Array ( [0] => SQLite format 3 [1] => [2] => [3] => [4] => [5] => @ [6] => [7] => [8] => [9] => [10] => [11] => [12] => [13] => [14] => [15] => [16] => [17] => [18] => [19] => [20] => [21] => [22] => -? ) ../../..\repo\db\ELSE.db 1

Array ( [0] => SQLite format 3 [1] => [2] => [3] => [4] => [5] => @ [6] => [7] => [8] => b [9] => [10] => [11] => [12] => [13] => [14] => [15] => [16] => [17] => [18] => [19] => [20] => [21] => [22] => ) ../../..\repo\db\MultiLang.db3 1

Array ( [0] => SQLite format 3 [1] => [2] => [3] => [4] => [5] => @ [6] => [7] => [8] => b [9] => [10] => [11] => [12] => [13] => [14] => [15] => [16] => [17] => [18] => [19] => [20] => [21] => [22] => ) ../../..\ucenici\franezidic\Db\MultiLang.db3 1

Array ( [0] => SQLite format 3 [1] => [2] => [3] => [4] => [5] => @ [6] => [7] => [8] => b [9] => [10] => [11] => [12] => [13] => [14] => [15] => [16] => [17] => [18] => [19] => [20] => [21] => [22] => ) ../../..\ucenici\jadrankotudovic\Db\MultiLang.db3 1 </pre>