From ce02a9bf9491c9b27ca27ed8bedbd7ee3ec1f551 Mon Sep 17 00:00:00 2001 From: samhemelryk Date: Tue, 26 May 2009 02:46:09 +0000 Subject: [PATCH] lib MDL-19236 Added boilerplates and copyrights --- lib/listlib.php | 53 +++++----- lib/locallib.php | 23 +++- lib/markdown.php | 229 +++++++++++++++++++++------------------- lib/mathslib.php | 27 ++++- lib/memcached.class.php | 54 +++++++--- lib/messagelib.php | 49 ++++----- lib/odbc.php | 9 +- lib/odslib.class.php | 76 +++++++------ 8 files changed, 305 insertions(+), 215 deletions(-) diff --git a/lib/listlib.php b/lib/listlib.php index 2cbfcee393..23a323501c 100644 --- a/lib/listlib.php +++ b/lib/listlib.php @@ -1,27 +1,19 @@ -. /** * Classes for displaying and editing a nested list of items. @@ -33,9 +25,9 @@ * Reordering of items works across pages. * Processing of editing actions on list. * - * @author Jamie Pratt - * @license http://www.gnu.org/copyleft/gpl.html GNU Public License * @package moodlecore + * @copyright Jamie Pratt + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** @@ -44,6 +36,10 @@ * The functions that move things around the tree structure just update the * database - they don't update the in-memory structure, instead they trigger a * page reload so everything is rebuilt from scratch. + * + * @package moodlecore + * @copyright Jamie Pratt + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class moodle_list { var $attributes; @@ -471,6 +467,11 @@ class moodle_list { } } +/** + * @package moodlecore + * @copyright Jamie Pratt + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class list_item { /** * id of record, used if list is editable diff --git a/lib/locallib.php b/lib/locallib.php index 0cf06e9fd1..67381bbbb7 100644 --- a/lib/locallib.php +++ b/lib/locallib.php @@ -1,4 +1,20 @@ . + /** * This file provides hooks from moodle core into custom code. * @@ -103,6 +119,10 @@ * In there, implement the function local_delete_course($courseid). This * function will then be called whenever the functions remove_course_contents() * or delete_course() from moodlelib are called. + * + * @package moodlecore + * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** @@ -110,9 +130,10 @@ * Look for a function local_delete_course() in a file called * local/lib.php andn call it if it is there. * + * @global object * @param int $courseid the course that is being deleted. * @param bool $showfeedback Whether to display notifications on success. - * @return false if local_delete_course failed, or true if + * @return bool false if local_delete_course failed, or true if * there was noting to do or local_delete_course succeeded. */ function notify_local_delete_course($courseid, $showfeedback) { diff --git a/lib/markdown.php b/lib/markdown.php index 2ffa47205a..384978f345 100755 --- a/lib/markdown.php +++ b/lib/markdown.php @@ -1,18 +1,24 @@ -# -# Original Markdown -# Copyright (c) 2004-2006 John Gruber -# -# - +/** + * + * Markdown Extra - A text-to-HTML conversion tool for web writers + * + * PHP Markdown & Extra + * Copyright (c) 2004-2007 Michel Fortin + * + * + * Original Markdown + * Copyright (c) 2004-2006 John Gruber + * + * + * @package moodlecore + * @copyright (c) 2004-2006 John Gruber + */ + +/** MARKDOWN_VERSION = 1.0.1j */ define( 'MARKDOWN_VERSION', "1.0.1j" ); # Tue 4 Sep 2007 +/** MARKDOWNEXTRA_VERSION = 1.1.6 */ define( 'MARKDOWNEXTRA_VERSION', "1.1.6" ); # Tue 4 Sep 2007 @@ -20,13 +26,13 @@ define( 'MARKDOWNEXTRA_VERSION', "1.1.6" ); # Tue 4 Sep 2007 # Global default settings: # -# Change to ">" for HTML output +/** Change to ">" for HTML output */ @define( 'MARKDOWN_EMPTY_ELEMENT_SUFFIX', " />"); -# Define the width of a tab for code blocks. +/** Define the width of a tab for code blocks. */ @define( 'MARKDOWN_TAB_WIDTH', 4 ); -# Optional title attribute for footnote links and backlinks. +/** Optional title attribute for footnote links and backlinks. */ @define( 'MARKDOWN_FN_LINK_TITLE', "" ); @define( 'MARKDOWN_FN_BACKLINK_TITLE', "" ); @@ -176,6 +182,10 @@ if (strcasecmp(substr(__FILE__, -16), "classTextile.php") == 0) { # Try to include PHP SmartyPants. Should be in the same directory. @include_once 'smartypants.php'; # Fake Textile class. It calls Markdown instead. + /** + * @package moodlecore + * @copyright (c) 2004-2006 John Gruber + */ class Textile { function TextileThis($text, $lite='', $encode='') { if ($lite == '' && $encode == '') $text = Markdown($text); @@ -193,9 +203,12 @@ if (strcasecmp(substr(__FILE__, -16), "classTextile.php") == 0) { -# -# Markdown Parser Class -# +/** + * Markdown Parser Class + * + * @package moodlecore + * @copyright (c) 2004-2006 John Gruber + */ class Markdown_Parser { @@ -1464,10 +1477,12 @@ class Markdown_Parser { } -# -# Markdown Extra Parser Class -# - +/** + * Markdown Extra Parser Class + * + * @package moodlecore + * @copyright (c) 2004-2006 John Gruber + */ class MarkdownExtra_Parser extends Markdown_Parser { # Prefix for footnote ids. @@ -2547,90 +2562,88 @@ class MarkdownExtra_Parser extends Markdown_Parser { } -/* - -PHP Markdown Extra -================== - -Description ------------ - -This is a PHP port of the original Markdown formatter written in Perl -by John Gruber. This special "Extra" version of PHP Markdown features -further enhancements to the syntax for making additional constructs -such as tables and definition list. - -Markdown is a text-to-HTML filter; it translates an easy-to-read / -easy-to-write structured text format into HTML. Markdown's text format -is most similar to that of plain text email, and supports features such -as headers, *emphasis*, code blocks, blockquotes, and links. - -Markdown's syntax is designed not as a generic markup language, but -specifically to serve as a front-end to (X)HTML. You can use span-level -HTML tags anywhere in a Markdown document, and you can use block level -HTML tags (like
and as well). - -For more information about Markdown's syntax, see: - - - - -Bugs ----- - -To file bug reports please send email to: - - - -Please include with your report: (1) the example input; (2) the output you -expected; (3) the output Markdown actually produced. - - -Version History ---------------- - -See the readme file for detailed release notes for this version. - - -Copyright and License ---------------------- - -PHP Markdown & Extra -Copyright (c) 2004-2007 Michel Fortin - -All rights reserved. - -Based on Markdown -Copyright (c) 2003-2006 John Gruber - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -* Neither the name "Markdown" nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -This software is provided by the copyright holders and contributors "as -is" and any express or implied warranties, including, but not limited -to, the implied warranties of merchantability and fitness for a -particular purpose are disclaimed. In no event shall the copyright owner -or contributors be liable for any direct, indirect, incidental, special, -exemplary, or consequential damages (including, but not limited to, -procurement of substitute goods or services; loss of use, data, or -profits; or business interruption) however caused and on any theory of -liability, whether in contract, strict liability, or tort (including -negligence or otherwise) arising in any way out of the use of this -software, even if advised of the possibility of such damage. - -*/ +/** + * PHP Markdown Extra + * ================== + * + * Description + * ----------- + * + * This is a PHP port of the original Markdown formatter written in Perl + * by John Gruber. This special "Extra" version of PHP Markdown features + * further enhancements to the syntax for making additional constructs + * such as tables and definition list. + * + * Markdown is a text-to-HTML filter; it translates an easy-to-read / + * easy-to-write structured text format into HTML. Markdown's text format + * is most similar to that of plain text email, and supports features such + * as headers, *emphasis*, code blocks, blockquotes, and links. + * + * Markdown's syntax is designed not as a generic markup language, but + * specifically to serve as a front-end to (X)HTML. You can use span-level + * HTML tags anywhere in a Markdown document, and you can use block level + * HTML tags (like
and
as well). + * + * For more information about Markdown's syntax, see: + * + * + * + * + * Bugs + * ---- + * + * To file bug reports please send email to: + * + * + * + * Please include with your report: (1) the example input; (2) the output you + * expected; (3) the output Markdown actually produced. + * + * + * Version History + * --------------- + * + * See the readme file for detailed release notes for this version. + * + * + * Copyright and License + * --------------------- + * + * PHP Markdown & Extra + * Copyright (c) 2004-2007 Michel Fortin + * + * All rights reserved. + * + * Based on Markdown + * Copyright (c) 2003-2006 John Gruber + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name "Markdown" nor the names of its contributors may + * be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * This software is provided by the copyright holders and contributors "as + * is" and any express or implied warranties, including, but not limited + * to, the implied warranties of merchantability and fitness for a + * particular purpose are disclaimed. In no event shall the copyright owner + * or contributors be liable for any direct, indirect, incidental, special, + * exemplary, or consequential damages (including, but not limited to, + * procurement of substitute goods or services; loss of use, data, or + * profits; or business interruption) however caused and on any theory of + * liability, whether in contract, strict liability, or tort (including + * negligence or otherwise) arising in any way out of the use of this + * software, even if advised of the possibility of such damage. + */ ?> \ No newline at end of file diff --git a/lib/mathslib.php b/lib/mathslib.php index f6ee745c1f..0d377f4618 100644 --- a/lib/mathslib.php +++ b/lib/mathslib.php @@ -1,13 +1,36 @@ . + +/** + * @package moodlecore + * @copyright Petr Skoda (skodak) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** @see evalmath/evalmath.class.php */ require_once $CFG->dirroot.'/lib/evalmath/evalmath.class.php'; /** * This class abstracts evaluation of spreadsheet formulas. * See unit tests in lib/simpletest/testmathslib.php for sample usage. * - * @author Petr Skoda (skodak) - * @license http://www.gnu.org/copyleft/gpl.html GNU Public License + * @package moodlecore + * @copyright Petr Skoda (skodak) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class calc_formula { diff --git a/lib/memcached.class.php b/lib/memcached.class.php index d58ce0c334..15197d07d2 100644 --- a/lib/memcached.class.php +++ b/lib/memcached.class.php @@ -1,21 +1,45 @@ - ** - ** Note: do NOT store booleans here. With memcached, a false value - ** is indistinguisable from a "not found in cache" response. - **/ +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * @package moodlecore + * @copyright Martin Langhoff + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +/** + * This class abstracts PHP's PECL memcached + * API to provide + * + * - get() + * - set() + * - delete() + * - getforfill() + * - releaseforfill() + * + * Author: Martin Langhoff + * + * Note: do NOT store booleans here. With memcached, a false value + * is indistinguisable from a "not found in cache" response. + * + * @package moodlecore + * @copyright Martin Langhoff + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + **/ class memcached { function memcached() { diff --git a/lib/messagelib.php b/lib/messagelib.php index bf39affcd7..5a48b5ede5 100644 --- a/lib/messagelib.php +++ b/lib/messagelib.php @@ -1,38 +1,29 @@ -. /** * messagelib.php - Contains generic messaging functions for the message system * - * @author Luis Rodrigues and Martin Dougiamas - * @version $Id$ - * @license http://www.gnu.org/copyleft/gpl.html GNU Public License - * @package + * @package moodlecore + * @copyright Luis Rodrigues and Martin Dougiamas + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - +/** TIMETOSHOWUSERS = 300 */ define('TIMETOSHOWUSERS', 300); /** diff --git a/lib/odbc.php b/lib/odbc.php index c8830c5964..3c773a3328 100755 --- a/lib/odbc.php +++ b/lib/odbc.php @@ -6,14 +6,19 @@ * * Released into the public domain for version 0.90 of ODBC Socket Server * {@link http://odbc.linuxbox.com/} + * + * @package moodlecore * @author Team FXML * @copyright Copyright (c) 1999 Team FXML * @license http://odbc.linuxbox.com/ public domain - * @package moodlecore */ - /** +/** * ODBC Socket Server class + * + * @package moodlecore + * @copyright Copyright (c) 1999 Team FXML + * @license http://odbc.linuxbox.com/ public domain */ class ODBCSocketServer { diff --git a/lib/odslib.class.php b/lib/odslib.class.php index 4d70c1b8d1..60cd40e6a9 100644 --- a/lib/odslib.class.php +++ b/lib/odslib.class.php @@ -1,38 +1,41 @@ -. + +/** + * Major Contributors: + * - Eloy Lafuente (stronk7) {@link http://contiento.com} + * - Petr Skoda (skodak) + * + * @package moodlecore + * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** * The xml used here is derived from output of KSpread 1.6.1 * * Known problems: * - missing formatting * - write_date() works fine in OOo, but it does not work in KOffice - it knows only date or time but not both :-( + * + * @package moodlecore + * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - class MoodleODSWorkbook { var $worksheets = array(); var $filename; @@ -115,6 +118,12 @@ class MoodleODSWorkbook { } +/** + * + * @package moodlecore + * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class MoodleODSWorksheet { var $data = array(); var $columns = array(); @@ -332,10 +341,13 @@ class MoodleODSWorksheet { // not implement } } - /** -* Define and operate over one Format. -*/ + * Define and operate over one Format. + * + * @package moodlecore + * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class MoodleODSFormat { var $id; var $properties; -- 2.39.5