Skip to content

Commit

Permalink
MDL-21249 improved php docs and adding direct access prevention in dml
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jul 25, 2010
1 parent c86f538 commit f2ed3f0
Show file tree
Hide file tree
Showing 23 changed files with 122 additions and 77 deletions.
6 changes: 4 additions & 2 deletions lib/dml/database_column_info.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
/**
* Database column information.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2008 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

/**
* Detail database field information.
* Based on ADOFieldObject.
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/moodle_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
/**
* Abstract database driver class.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2008 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/database_column_info.php');
require_once($CFG->libdir.'/dml/moodle_recordset.php');
require_once($CFG->libdir.'/dml/moodle_transaction.php');
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/moodle_recordset.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
/**
* Abstract recordset.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2008 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

/**
* Abstract class for resultsets returned from database functions.
* This is a simple Iterator with needed recorset closing support.
Expand Down
9 changes: 5 additions & 4 deletions lib/dml/moodle_temptables.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@
* of doing temporary tables support 100% cross-db and transparent within the DB API.
*
* Only drivers needing it will use this store. Neither moodle_database (abstract) or
* databases like postgres need this, because they don't lack any temp functionality.º:w
* databases like postgres need this, because they don't lack any temp functionality.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2009 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

class moodle_temptables {

protected $mdb; // circular reference, to be able to use DB facilities here if needed
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/moodle_transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
/**
* Delegated database transaction support.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2009 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

/**
* Delegated transaction class.
*/
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/mssql_native_moodle_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
/**
* Native mssql class representing moodle database interface.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2009 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/moodle_database.php');
require_once($CFG->libdir.'/dml/mssql_native_moodle_recordset.php');
require_once($CFG->libdir.'/dml/mssql_native_moodle_temptables.php');
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/mssql_native_moodle_recordset.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
/**
* MSSQL specific recordset.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2009 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/moodle_recordset.php');

class mssql_native_moodle_recordset extends moodle_recordset {
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/mssql_native_moodle_temptables.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
* are named differently than normal tables. Also used to be able to retrieve
* temp table names included in the get_tables() method of the DB.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2009 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/moodle_temptables.php');

class mssql_native_moodle_temptables extends moodle_temptables {
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/mysqli_native_moodle_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
/**
* Native mysqli class representing moodle database interface.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2008 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/moodle_database.php');
require_once($CFG->libdir.'/dml/mysqli_native_moodle_recordset.php');
require_once($CFG->libdir.'/dml/mysqli_native_moodle_temptables.php');
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/mysqli_native_moodle_recordset.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
/**
* Mysqli specific recordset.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2008 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/moodle_recordset.php');

/**
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/mysqli_native_moodle_temptables.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
* are named differently than normal tables. Also used to be able to retrieve
* temp table names included in the get_tables() method of the DB.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2009 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/moodle_temptables.php');

class mysqli_native_moodle_temptables extends moodle_temptables {
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/oci_native_moodle_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
/**
* Native oci class representing moodle database interface.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2008 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/moodle_database.php');
require_once($CFG->libdir.'/dml/oci_native_moodle_recordset.php');
require_once($CFG->libdir.'/dml/oci_native_moodle_temptables.php');
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/oci_native_moodle_recordset.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
/**
* Oracle specific recordset.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2008 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/moodle_recordset.php');

class oci_native_moodle_recordset extends moodle_recordset {
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/oci_native_moodle_temptables.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
* Also used to be able to retrieve temp table names included in the get_tables()
* method of the DB.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2009 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/moodle_temptables.php');

class oci_native_moodle_temptables extends moodle_temptables {
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/pdo_moodle_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
/**
* Experimental pdo database class
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2008 Andrei Bautu
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/moodle_database.php');
require_once($CFG->libdir.'/dml/pdo_moodle_recordset.php');

Expand Down
6 changes: 4 additions & 2 deletions lib/dml/pdo_moodle_recordset.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
/**
* Experimental pdo recordset
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2008 Andrei Bautu
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/moodle_recordset.php');

/**
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/pgsql_native_moodle_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
/**
* Native pgsql class representing moodle database interface.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2008 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/moodle_database.php');
require_once($CFG->libdir.'/dml/pgsql_native_moodle_recordset.php');
require_once($CFG->libdir.'/dml/pgsql_native_moodle_temptables.php');
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/pgsql_native_moodle_recordset.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
/**
* Native postgresql recordset.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2008 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/moodle_recordset.php');

/**
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/pgsql_native_moodle_temptables.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
* are named differently than normal tables. Also used to be able to retrieve
* temp table names included in the get_tables() method of the DB.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/moodle_temptables.php');

class pgsql_native_moodle_temptables extends moodle_temptables {
Expand Down
6 changes: 4 additions & 2 deletions lib/dml/sqlite3_pdo_moodle_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
/**
* Experimental pdo database class.
*
* @package moodlecore
* @subpackage DML
* @package code
* @subpackage dml
* @copyright 2008 Andrei Bautu
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir.'/dml/pdo_moodle_database.php');

/**
Expand Down
Loading

0 comments on commit f2ed3f0

Please sign in to comment.