Flat file data sources

What are the most effective techniques around developing flat file database frameworks in PHP?

A great deal of the elder PHP flat file structures I see around effort to implement SQL-like question syntax, which mores than the top for my objectives most of the times (I would certainly simply make use of a database then).

Exist any kind of classy dress up there to get excellent efficiency and also attributes with a tiny code expenses?

0
2019-05-07 00:16:00
Source Share
Answers: 3

You could take into consideration SQLite. It is virtually as straightforward as level documents, yet you do get a SQL engine for quizing. It works well with PHP also.

0
2019-05-22 21:07:35
Source

One structure I'm taking into consideration would certainly be for a blog writing system. Given that nearly any kind of feasible sight of information you would certainly desire would certainly be arranged by day, I was thinking of this framework :

One directory site per web content node :

./content/YYYYMMDDHHMMSS/

Subdirectories of each node consisting of

/tags  
/authors  
/comments  

As well as straightforward message documents in the node directory site for pre - and also blog post - provided web content and so on.

This would certainly permit a straightforward PHP glob() call (and also possibly a turnaround of the outcome array) to quiz on nearly anything within the material framework :

glob("content/*/tags/funny");  

Would return courses consisting of all write-ups marked "amusing".

0
2019-05-08 19:53:43
Source

Well, what is the nature of the level data sources. Are they huge or tiny. Is it straightforward selections with selections in them? if its something straightforward claim userprofiles constructed thus :

$user = array("name" => "dubayou", 
              "age" => 20,
              "websites" => array("dubayou.com","willwharton.com","codecream.com"),
              "and_one" => "more");

and also to conserve or upgrade the db document for that customer.

$dir = "../userdata/";  //make sure to put it bellow what the server can reach.
file_put_contents($dir.$user['name'],serialize($user));

and also to load the document for the customer

function &get_user($name){
    return unserialize(file_get_contents("../userdata/".$name));
}

yet once more this execution will certainly differ on the application and also nature of the database you require.

0
2019-05-08 19:50:21
Source