Skip to content

Commit

Permalink
MDL-42148 new overview of 3rd party libraries
Browse files Browse the repository at this point in the history
Includes:
* each plugin has own thirdpartylibs.xml file
* added missing libraries
* fixed existing library infos
* new Site administration / Development / Third party libraries page
  • Loading branch information
skodak authored and danpoltawski committed Oct 16, 2013
1 parent 80dc196 commit b2858b9
Show file tree
Hide file tree
Showing 17 changed files with 219 additions and 82 deletions.
2 changes: 2 additions & 0 deletions admin/settings/development.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,6 @@
}

$ADMIN->add('development', new admin_externalpage('purgecaches', new lang_string('purgecaches','admin'), "$CFG->wwwroot/$CFG->admin/purgecaches.php"));

$ADMIN->add('development', new admin_externalpage('thirdpartylibs', new lang_string('thirdpartylibs','admin'), "$CFG->wwwroot/$CFG->admin/thirdpartylibs.php"));
} // end of speedup
76 changes: 76 additions & 0 deletions admin/thirdpartylibs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php
// 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 <http://www.gnu.org/licenses/>.

/**
* List of 3rd party libs used in moodle and all plugins.
*
* @package admin
* @copyright 2013 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');

admin_externalpage_setup('thirdpartylibs');

echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('thirdpartylibs', 'core_admin'));

$files = array('core' => "$CFG->libdir/thirdpartylibs.xml");

$plugintypes = core_component::get_plugin_types();
foreach ($plugintypes as $type => $ignored) {
$plugins = core_component::get_plugin_list_with_file($type, 'thirdpartylibs.xml', false);
foreach ($plugins as $plugin => $path) {
$files[$type.'_'.$plugin] = $path;
}
}

$table = new html_table();
$table->head = array(
get_string('thirdpartylibrary', 'core_admin'), get_string('version'),
get_string('thirdpartylibrarylocation', 'core_admin'), get_string('license'));
$table->align = array('left', 'left', 'left', 'left');
$table->id = 'thirdpartylibs';
$table->attributes['class'] = 'admintable generaltable';
$table->data = array();

foreach ($files as $component => $xmlpath) {
$xml = simplexml_load_file($xmlpath);
foreach ($xml as $lib) {
$base = realpath(dirname($xmlpath));
$location = substr($base, strlen($CFG->dirroot)).'/'.$lib->location;
if (is_dir($CFG->dirroot.$location)) {
$location .= '/';
}
$version = '';
if (!empty($lib->version)) {
$version = $lib->version;
}
$license = $lib->license;
if (!empty($lib->licenseversion)) {
$license .= ' '.$lib->licenseversion;
}

$table->data[] = new html_table_row(array($lib->name, $version, $location, $license));
}
}

echo html_writer::table($table);

echo $OUTPUT->footer();
10 changes: 10 additions & 0 deletions auth/cas/thirdpartylibs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<libraries>
<library>
<location>CAS</location>
<name>CAS</name>
<license>BSD</license>
<version>1.1.3</version>
<licenseversion></licenseversion>
</library>
</libraries>
10 changes: 10 additions & 0 deletions auth/fc/thirdpartylibs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<libraries>
<library>
<location>fcFPP.php</location>
<name>fcFPP</name>
<license>GPL</license>
<version></version>
<licenseversion>2.0+</licenseversion>
</library>
</libraries>
10 changes: 10 additions & 0 deletions filter/tex/thirdpartylibs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<libraries>
<library>
<location>mimetex.*</location>
<name>mimeTeX</name>
<license>GPL</license>
<version>1.74</version>
<licenseversion>3.0+</licenseversion>
</library>
</libraries>
3 changes: 3 additions & 0 deletions lang/en/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,9 @@
$string['themeselector'] = 'Theme selector';
$string['themesettings'] = 'Theme settings';
$string['therewereerrors'] = 'There were errors in your data';
$string['thirdpartylibrary'] = 'Library';
$string['thirdpartylibrarylocation'] = 'Location';
$string['thirdpartylibs'] = 'Third party libraries';
$string['timezone'] = 'Default timezone';
$string['timezoneforced'] = 'This is forced by the site administrator';
$string['timezoneisforcedto'] = 'Force all users to use';
Expand Down
2 changes: 1 addition & 1 deletion lib/editor/tinymce/plugins/pdw/readme_moodle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Moodle maintainer: Jason Fowler (phalacee)
Upgrade procedure:
1/ extract standard PDW package into lib/editor/tinymce/plugins/pdw/tinymce/
2/ bump up version.php
3/ update lib/thirdpartylibs.xml
3/ update ./thirdpartylibs.xml
4/ reimplement patch in MDL-23646
5/ reimplement patch in MDL-40668
6/ add in "DOM.setStyle(ifr, 'width',DOM.getSize(ifrcon).w); // Resize iframe" (without quotes)
Expand Down
10 changes: 10 additions & 0 deletions lib/editor/tinymce/plugins/pdw/thirdpartylibs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<libraries>
<library>
<location>tinymce</location>
<name>PDW Toolbar Toggle</name>
<license>MIT</license>
<version>1.2</version>
<licenseversion></licenseversion>
</library>
</libraries>
10 changes: 10 additions & 0 deletions lib/editor/tinymce/plugins/spellchecker/thirdpartylibs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<libraries>
<library>
<location>rpc.php</location>
<name>TinyMCE spellchecker</name>
<license>LGPL</license>
<version>2.0.6.1</version>
<licenseversion>2.1+</licenseversion>
</library>
</libraries>
2 changes: 1 addition & 1 deletion lib/editor/tinymce/readme_moodle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Upgrade procedure:
1/ extract standard TinyMCE package into lib/editor/tinymce/tiny_mce/x.y.z/
2/ bump up editor version in lib.php to match the directory name x.y.z
3/ bump up main version.php
4/ update lib/thirdpartylibs.xml
4/ update ./thirdpartylibs.xml
5/ execute cli/update_lang_files.php and review changes in lang/en/editor_tinymce.php
6/ use search/replace to fix oversized zIndexes

Expand Down
10 changes: 10 additions & 0 deletions lib/editor/tinymce/thirdpartylibs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<libraries>
<library>
<location>tiny_mce</location>
<name>TinyMCE</name>
<license>LGPL</license>
<version>3.5.8</version>
<licenseversion>2.1+</licenseversion>
</library>
</libraries>
93 changes: 15 additions & 78 deletions lib/thirdpartylibs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<library>
<location>adodb</location>
<name>AdoDB</name>
<license>GPL/BSD</license>
<license>BSD/GPL</license>
<version>5.18</version>
<licenseversion>2.1+</licenseversion>
</library>
Expand All @@ -26,14 +26,7 @@
<name>DragMath</name>
<license>GPL</license>
<version>0.7.8.2</version>
<licenseversion></licenseversion>
</library>
<library>
<location>editor/tinymce/tiny_mce</location>
<name>TinyMCE</name>
<license>LGPL</license>
<version>3.5.8</version>
<licenseversion>2.1+</licenseversion>
<licenseversion>3.0+</licenseversion>
</library>
<library>
<location>evalmath</location>
Expand All @@ -50,14 +43,7 @@
<licenseversion>2.1+</licenseversion>
</library>
<library>
<location>gallery</location>
<name>Gallery Lightbox</name>
<license>BSD</license>
<version>2010.04.21-21-51</version>
<licenseversion></licenseversion>
</library>
<library>
<location>PEAR_GeoIP</location>
<location>pear/Net</location>
<name>GeoIP</name>
<license>LGPL</license>
<version>1.0.0</version>
Expand Down Expand Up @@ -96,12 +82,19 @@
<name>Flowplayer</name>
<license>GPL</license>
<version>3.2.16</version>
<licenseversion>3</licenseversion>
<licenseversion>3.0+</licenseversion>
</library>
<library>
<location>password_compat</location>
<name>Compatible password hashing</name>
<license>MIT</license>
<version></version>
<licenseversion></licenseversion>
</library>
<library>
<location>pear/Auth/RADIUS.php</location>
<name>Pear_Auth_Radius</name>
<license>?</license>
<license>BSD</license>
<version>1.1</version>
<licenseversion></licenseversion>
</library>
Expand Down Expand Up @@ -141,7 +134,7 @@
<licenseversion></licenseversion>
</library>
<library>
<location>pear/OLE</location>
<location>pear/OLE.php</location>
<name>Pear_OLE</name>
<license>PHP</license>
<version>1.0.0</version>
Expand All @@ -154,13 +147,6 @@
<version>1.4.5</version>
<licenseversion>3.0</licenseversion>
</library>
<library>
<location>pear/Spreadsheet/Excel</location>
<name>Pear_Spreadsheet_Excel</name>
<license>LGPL</license>
<version>0.9.1</version>
<licenseversion>2.1+</licenseversion>
</library>
<library>
<location>pear/XML/Parser</location>
<name>Pear_XML_Parser</name>
Expand Down Expand Up @@ -227,7 +213,7 @@
<library>
<location>zend</location>
<name>Zend Framework</name>
<license>new BSD</license>
<license>BSD</license>
<version>1.10.6</version>
<licenseversion></licenseversion>
</library>
Expand Down Expand Up @@ -255,7 +241,7 @@
<library>
<location>recaptchalib.php</location>
<name>ReCAPTCHA</name>
<license>Open Source</license>
<license>MIT</license>
<version>1.10</version>
<licenseversion></licenseversion>
</library>
Expand All @@ -273,53 +259,4 @@
<version>1.0</version>
<licenseversion>3.0+</licenseversion>
</library>
<library>
<location>theme/bootstrapbase/less/bootstrap</location>
<name>Twitter Bootstrap</name>
<license>Apache</license>
<version>2.3.0</version>
<licenseversion>2.0</licenseversion>
</library>
<library>
<location>theme/bootstrapbase/javascript/html5shiv.js</location>
<name>Html5Shiv</name>
<license>Apache</license>
<version>3.6.2</version>
<licenseversion>2.0</licenseversion>
</library>
<library>
<location>theme/bootstrapbase/yui/src/bootstrap/js/bootstrapcollapse.js</location>
<name>Gallery Bootstrap Collapse</name>
<license>BSD</license>
<version>2012.08.22-20-00</version>
<licenseversion></licenseversion>
</library>
<library>
<location>theme/bootstrapbase/yui/src/bootstrap/js/bootstrapdropdown.js</location>
<name>Gallery Bootstrap Dropdown</name>
<license>BSD</license>
<version>2012.08.22-20-00</version>
<licenseversion></licenseversion>
</library>
<library>
<location>theme/bootstrapbase/yui/src/bootstrap/js/bootstrapengine.js</location>
<name>Gallery Bootstrap Engine</name>
<license>BSD</license>
<version>2012.08.22-20-00</version>
<licenseversion></licenseversion>
</library>
<library>
<location>lib/editor/tinymce/plugins/pdw/tinymce</location>
<name>PDW Toolbar Toggle</name>
<license>MIT</license>
<version>1.2</version>
<licenseversion></licenseversion>
</library>
<library>
<location>mod/assign/feedback/editpdf/fpdi</location>
<name>FPDI</name>
<license>Apache</license>
<version>1.4.4</version>
<licenseversion>2.0</licenseversion>
</library>
</libraries>
1 change: 1 addition & 0 deletions lib/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ information provided here is intended especially for developers.
* New optional parameter to stored_file::get_content_file_handle to open file handle with 'gzopen' instead
of 'fopen' to read gzip-compressed files if required.
* update_internal_user_password() and setnew_password_and_mail() now trigger user_updated event.
* Add thirdpartylibs.xml file to plugins that bundle any 3rd party libraries.

DEPRECATIONS:
Various previously deprecated functions have now been altered to throw DEBUG_DEVELOPER debugging notices
Expand Down
10 changes: 10 additions & 0 deletions mod/assign/feedback/editpdf/thirdpartylibs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<libraries>
<library>
<location>fpdi</location>
<name>FPDI</name>
<license>Apache</license>
<version>1.4.4</version>
<licenseversion>2.0</licenseversion>
</library>
</libraries>
10 changes: 10 additions & 0 deletions repository/s3/thirdpartylibs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<libraries>
<library>
<location>S3.php</location>
<name>S3</name>
<license>BSD</license>
<version>0.5.0-dev</version>
<licenseversion></licenseversion>
</library>
</libraries>
4 changes: 2 additions & 2 deletions theme/bootstrapbase/readme_moodle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To update to the latest release of twitter bootstrap:
* download the new less files and store them in less/bootstrap
* regenerate files using recess: recess --compile --compress moodle.less > ../style/moodle.css **
* regenerate files using recess: recess --compile --compress editor.less > ../style/editor.css **
* update lib/thirdpartylibs.xml
* update ./thirdpartylibs.xml

** If you want to make changes to the .css generated from these .less files then you
need to install recess (https://github.com/twitter/recess) to compile the .less files,
Expand All @@ -28,7 +28,7 @@ https://github.com/aFarkas/html5shiv/blob/master/src/html5shiv.js

To update to the latest release of html5shiv:
* download and replace: javascript/html5shiv.js
* update lib/thirdpartylibs.xml
* update ./thirdpartylibs.xml

bootstrapcollapse.js, bootstrapdropdown.js, bootstrapengine.js
--------------------------------------------------------------
Expand Down
Loading

0 comments on commit b2858b9

Please sign in to comment.