Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 402] [Versions 311 and 403]

wikimedia class class for communication with Wikimedia Commons API

Author: Dongsheng Cai <dongsheng@moodle.com>, Raul Kern <raunator@gmail.com>
License: http://www.gnu.org/copyleft/gpl.html GNU Public License
File Size: 236 lines (10 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

wikimedia:: (7 methods):
  __construct()
  login()
  logout()
  get_image_url()
  get_images_by_page()
  get_thumb_url()
  search_images()


Class: wikimedia  - X-Ref

__construct($url = '')   X-Ref
No description

login($user, $pass)   X-Ref
No description

logout()   X-Ref
No description

get_image_url($titles)   X-Ref
No description

get_images_by_page($title)   X-Ref
No description

get_thumb_url($image_url, $orig_width, $orig_height, $thumb_width = 75, $force = false)   X-Ref
Generate thumbnail URL from image URL.

param: string $image_url
param: int $orig_width
param: int $orig_height
param: int $thumb_width
param: bool $force When true, forces the generation of a thumb URL.
return: string

search_images($keyword, $page = 0, $params = array()   X-Ref
Search for images and return photos array.

param: string $keyword
param: int $page
param: array $params additional query params
return: array