Class SkayoDB
SkayoDB
SkayoDB is a Flat-File-Database System made by Skayo.
It uses XML for storing data and .htaccess to deny access from anyone. So it's save too!
SkayoDB is free and easy to use and for everyone who don't want to spend money on a MySQL-Server like me.
Installation:
<?php
ini_set('user_agent','Mozilla/4.0 (compatible; MSIE 6.0)');
file_put_contents('SkayoDB.php', file_get_contents('http://skayo.lima-city.de/tests/SkayoDB/SkayoDBxml.txt'));
require_once('SkayoDB.php');
$db = new SkayoDB;
echo $db->setup();
?>
Methods summary
public
|
|
public
|
#
setup( )
Call once to create the DB-Folder and a htaccess-File
Call once to create the DB-Folder and a htaccess-File
|
public
string
|
#
createDB( string $name )
Creates a new databank
Parameters
- $name
- The name of the databank
Returns
string If debug is true, it returns a message
|
public
string
|
#
newXMLelement( string $DBname, string $content, string $elementname, string $parent, integer $parentnum = 0, string $attributename = NULL, string $attributevalue = NULL )
Used to create a new XML-Node
Used to create a new XML-Node
Parameters
- $DBname
- The name of the database you want to use
- $content
- The content you want to store in that node
- $elementname
- The name of the node you want to create
- $parent
- The name of the parent wich you want to create a child from
- $parentnum
- If you have more than one parent of a name, you can choose the number of the parent you want to use
- $attributename
- The name of the attribute, if you want to have an attribute for the node
- $attributevalue
- The value of the attribute, if you want to have an attribute for the node
Returns
string If debug is true, it returns a message
|
public
string
|
#
updateXMLvalue( string $DBname, string $newValue, string $elementname, integer $elementnum = 0 )
Used to update the value of an existing node.
Used to update the value of an existing node.
Parameters
- $DBname
- The name of the database you want to use
- $newValue
- The new value you want to store
- $elementname
- The name of the node you want to update
- $elementnum
- If you have more than one nodes of a name, you can choose the number of the node you want to update
Returns
string If debug is true, it returns a message
|
public
string
|
#
getXML( string $DBname, string $mode, string $elementname, integer $elementnum = 0, string $attributename = NULL, string $attributevalue = NULL )
Used to get the value of an existing node
Used to get the value of an existing node
Parameters
- $DBname
- The name of the database you want to use
- $mode
- The mode you want to use. You can choose between value (to get the value), number (to get the number of an node) and count (to get the number of existing nodes)
- $elementname
- The name of the node you want to get the information from
- $elementnum
- If you have more than one nodes of a name, you can choose the number of the node you want to get the information from
- $attributename
- The name of the attribute you want to get the value from
- $attributevalue
- The value of the attribute you want to get the value from
Returns
string If debug is true, it returns a message
|
public
string
|
#
removeXMLnode( string $DBname, string $parentname, integer $parentnum, string $elementname, integer $elementnum = 0 )
Used to remove an existing node
Used to remove an existing node
Parameters
- $DBname
- The name of the database you want to use
- $parentname
- The name of the parent you want to delete a child from
- $parentnum
- The number of the parent you want to delete a child from
- $elementname
- The name of the node you want to delete
- $elementnum
- The number of the node you want to delete
Returns
string If debug is true, it returns a message
|
Properties summary
public
array
|
$config
Configuration-Array
It contains two values:
"debug":
(default: True)
Setting debug to true will return all errors.
"DB_dir":
(default: "DB")
If the path is not DB you can set this to where the DB-Directory is. So for example if you want the DB-Directory to be data/DB/, you set the path to data/DB.
|
|