Skip to content

Commit

Permalink
MDL-21249 improved php docs and adding direct access prevention in co…
Browse files Browse the repository at this point in the history
…re libs
  • Loading branch information
skodak committed Jul 25, 2010
1 parent 2ac619c commit 78bfb56
Show file tree
Hide file tree
Showing 70 changed files with 388 additions and 215 deletions.
7 changes: 4 additions & 3 deletions blocks/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
* It works with the {@link block_edit_form} class, or rather the particular
* subclass defined by this block, to do the editing.
*
* @package moodlecore
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage block
* @copyright 2009 Tim Hunt
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

if (!defined('MOODLE_INTERNAL')) {
Expand Down
5 changes: 3 additions & 2 deletions blocks/moodleblock.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
/**
* This file contains the parent class for moodle blocks, block_base.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package blocks
* @package core
* @subpackage block
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
*/

/// Constants
Expand Down
9 changes: 6 additions & 3 deletions lib/accesslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,14 @@
* DB need to ensure that the default role caps
* are dealt with appropriately.
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage role
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/** permission definitions */
define('CAP_INHERIT', 0);
/** permission definitions */
Expand Down
9 changes: 6 additions & 3 deletions lib/adminlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,14 @@
* Original author: Vincenzo K. Marcovecchio
* Maintainer: Petr Skoda
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage admin
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/// Add libraries
require_once($CFG->libdir.'/ddllib.php');
require_once($CFG->libdir.'/xmlize.php');
Expand Down
9 changes: 6 additions & 3 deletions lib/authlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
*
* 2006-08-28 File created, AUTH return values defined.
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage auth
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Returned when the login was successful.
*/
Expand Down
11 changes: 7 additions & 4 deletions lib/blocklib.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
*
* This file defines the {@link block_manager} class,
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage block
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**#@+
* @deprecated since Moodle 2.0. No longer used.
*/
Expand Down Expand Up @@ -1353,7 +1356,7 @@ public function process_url_move() {

/**
* Turns the display of normal blocks either on or off.
*
*
* @param bool $setting
*/
public function show_only_fake_blocks($setting = true) {
Expand Down
4 changes: 3 additions & 1 deletion lib/clilib.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
/**
* Command line utility functions and classes
*
* @package moodlecore
* @package core
* @subpackage cli
* @copyright 2009 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Get input from user
* @param string $prompt text prompt, should include possible options
Expand Down
23 changes: 13 additions & 10 deletions lib/completionlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,26 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

require_once $CFG->libdir.'/completion/completion_aggregation.php';
require_once $CFG->libdir.'/completion/completion_criteria.php';
require_once $CFG->libdir.'/completion/completion_completion.php';
require_once $CFG->libdir.'/completion/completion_criteria_completion.php';


/**
* Contains a class used for tracking whether activities have been completed
* by students ('completion')
*
* Completion top-level options (admin setting enablecompletion)
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage completion
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

require_once $CFG->libdir.'/completion/completion_aggregation.php';
require_once $CFG->libdir.'/completion/completion_criteria.php';
require_once $CFG->libdir.'/completion/completion_completion.php';
require_once $CFG->libdir.'/completion/completion_criteria_completion.php';


/** The completion system is enabled in this site/course */
define('COMPLETION_ENABLED', 1);
/** The completion system is not enabled in this site/course */
Expand Down Expand Up @@ -110,7 +113,7 @@
* @package moodlecore
*/
class completion_info {
/**
/**
* Course object passed during construction
* @access private
* @var object
Expand Down
4 changes: 3 additions & 1 deletion lib/componentlib.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@
*
* That's all!
*
* @package moodlecore
* @package core
* @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* @global object $CFG
* @name $CFG
Expand Down
9 changes: 6 additions & 3 deletions lib/conditionlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
* Used for tracking conditions that apply before activities are displayed
* to students ('conditional availability').
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage completion
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/** The activity is not displayed to students at all when conditions aren't met. */
define('CONDITION_STUDENTVIEW_HIDE',0);
/** The activity is displayed to students as a greyed-out name, with informational
Expand Down
10 changes: 5 additions & 5 deletions lib/configonlylib.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* before including main config.php. You can resume normal script operation
* if you define ABORT_AFTER_CONFIG_CANCEL and require the setup.php
*
* @package moodlecore
* @copyright 2009 petr Skoda (skodak)
* @package core
* @copyright 2009 Petr Skoda (skodak)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

Expand Down Expand Up @@ -82,7 +82,7 @@ function min_clean_param($value, $type) {
* @return boolean, true if compression enabled
*/
function min_enable_zlib_compression() {

if (headers_sent()) {
return false;
}
Expand All @@ -102,7 +102,7 @@ function min_enable_zlib_compression() {
}
}
}

@ini_set('output_handler', '');

/*
Expand All @@ -112,6 +112,6 @@ function min_enable_zlib_compression() {
* so let's try some bigger sizes.
*/
@ini_set('zlib.output_compression', 65536);

return true;
}
9 changes: 6 additions & 3 deletions lib/csvlib.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
* You can have a rather longer description of the file as well,
* if you like, and it can span multiple lines.
*
* @copyright Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package moodlecore
* @package core
* @subpackage lib
* @copyright Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Utitily class for importing of CSV files.
* @copyright Petr Skoda
Expand Down
9 changes: 6 additions & 3 deletions lib/customcheckslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@
* - true: if passed
* - false: if failed
*
* @package moodlecore
* @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage admin
* @copyright (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* This function will look for the risky PHP setting register_globals
* in order to inform about. MDL-12914
Expand Down
9 changes: 6 additions & 3 deletions lib/datalib.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@
* - weblib.php - functions that produce web output
* - moodlelib.php - general-purpose Moodle functions
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core
* @subpackage lib
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* The maximum courses in a category
* MAX_COURSES_IN_CATEGORY * MAX_COURSE_CATEGORIES must not be more than max integer!
Expand Down
6 changes: 4 additions & 2 deletions lib/ddllib.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
*
* For further documentation, visit {@link http://docs.moodle.org/en/DDL_functions}
*
* @package moodlecore
* @subpackage DDL
* @package core
* @subpackage ddl
* @copyright 2001-3001 Eloy Lafuente (stronk7) http://contiento.com
* 2008 Petr Skoda http://skodak.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

// Add required library
require_once($CFG->libdir.'/xmlize.php');

Expand Down
8 changes: 5 additions & 3 deletions lib/deprecatedlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
* Old functions retained only for backward compatibility. New code should not
* use any of these functions.
*
* @package moodlecore
* @package core
* @subpackage deprecated
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @deprecated
*/

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

/**
* Given a physical path to a file, returns the URL through which it can be reached in Moodle.
*
Expand Down
6 changes: 4 additions & 2 deletions lib/dmllib.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@
* http://docs.moodle.org/en/DML_functions
* (feel free to modify, improve and document such page, thanks!)
*
* @package moodlecore
* @subpackage DML
* @package core
* @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 the essential
require_once($CFG->libdir.'/dml/moodle_database.php');

Expand Down
6 changes: 4 additions & 2 deletions lib/dtllib.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
* This library includes all the required functions used to handle
* transfer of data from one database to another.
*
* @package moodlecore
* @subpackage DTL
* @package core
* @subpackage dtl
* @copyright 2008 Andrei Bautu
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

// Require {@link ddllib.php}
require_once($CFG->libdir.'/ddllib.php');
// Require {@link database_exporter.php}
Expand Down
9 changes: 6 additions & 3 deletions lib/eaccelerator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@
* memcached, a false value is indistinguisable from a
* "not found in cache" response.
*
* @copyright Martin Langhoff <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package moodlecore
* @package core
* @subpackage lib
* @copyright Martin Langhoff <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
*
* @copyright Martin Langhoff <[email protected]>
Expand Down
2 changes: 2 additions & 0 deletions lib/editorlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

/**
* Returns users preferred editor for given format
*
Expand Down
Loading

0 comments on commit 78bfb56

Please sign in to comment.