Elenesski Object Database  EODB and NEODB
The Memento Pattern Database for Unity
34 Network - PHP Server Files

Most calls to the PHP server invoke a script which contains this line:

require("neodb_settings.php");

NEODB_SETTINGS.PHP will initialize all of the servers global variables and UTILITY_AUTHORIZATION.PHP will authorize the call to the server. AUTHORIZATION failure will cause the script to stop and return with a failure. Authorization exists to combat game/app script hijacking attacks.

Core PHP NEODB Server Settings

  • neodb_settings.php - Contains all of the global settings, such as host, database, passwords, keys, etc.

Index Setup

  • setup_indexes.php - Contains a script used to setup indexes. This is only called on the server. It automatically handles the creation of indexes even if new indexes are added after initial setup.

Getting new OID

  • get_new_oid.php - Used to get a new OID from the database. OIDs here are for dynamic data where the OID value is 1 or higher.

Get, Save, Delete Data

  • data_delete.php - Contains a script to delete one row of data from the database and respective indexes.
  • data_get.php - Contains a script to get a single row from the database for a given OID.
  • data_save.php - Contains a script to save an object ot the database.

Set and Clear Exclusive Locks

Very Important Note: Locks are semi-permanent. Once a lock ID is assigned to an object, only objects with that lock ID can update, delete or clear the lock. Otherwise, you need to edit the database directly to remove them.

  • lock_set.php - Contains a script that can create an exclusive lock on an object.
  • lock_clear.php - Contains a script that can clear a lock you created from an object.

Creating and Purging Dynamic Indexes

  • dynamic_create.php - Creates a string based index dynamically.
  • dynamic_purge.php - Purges all data associated to that index.
  • dynamic_delete.php - Deletes the string based index dynamically and purges all data associated to that index.

Finding Indexed Data

Find scripts find one or more rows from the database and are especially coded to prevent SQL Injection attacks.

  • find_all.php - Finds all the rows for a given index.
  • find_class.php - Finds all the rows of a given class.
  • find_like.php - Finds all rows from an index where a value is LIKE a provided value. See for more information.
  • find_between.php - Finds all rows between two values inclusively.
  • find_notbetween.php - Finds all rows from an index where a value is not between to values.
  • find_equals.php - Finds all rows from an index where a value is matched.
  • find_notequals.php - Finds all rows from an index where a value is not equal to a given value.
  • find_gt.php - Finds all rows from an index where a value is greater than the provided value.
  • find_gte.php - Finds all rows from an index where a value is greater than or equal to the provided value.
  • find_lt.php - Finds all rows from an index where a value is less than the provided value.
  • find_lte.php - Finds all rows from an index where a value is less than or equal to the provided value.

Internal Utility Functions

These PHP scripts contain the core functionality of the server and contain only functions.

  • utility_find.php - Functions related to searching and finding of data, and the return of data instances.
  • utility_indexes.php - Function related to indexing.
  • utility_save.php - Functions related to saving.