Merge branch 'MDL-55278_master' of https://github.com/dmonllao/moodle

This commit is contained in:
Dan Poltawski
2016-07-26 11:57:09 +01:00
38 changed files with 50 additions and 47 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2016 Skylar Kelty <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class mycourse extends \core_search\area\base {
class mycourse extends \core_search\base {
/**
* The context levels the search implementation is working on.
+3
View File
@@ -37,4 +37,7 @@ defined('MOODLE_INTERNAL') || die();
// The array must be called $renamedclasses.
$renamedclasses = array(
'core\progress\null' => 'core\progress\none',
'core_search\area\base' => 'core_search\base',
'core_search\area\base_mod' => 'core_search\base_mod',
'core_search\area\base_activity' => 'core_search\base_activity'
);
+1 -1
View File
@@ -35,7 +35,7 @@ require_once($CFG->dirroot . '/mod/assign/locallib.php');
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
/**
* Returns true if this area uses file indexing.
*
+1 -1
View File
@@ -33,5 +33,5 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
}
+1 -1
View File
@@ -33,7 +33,7 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2016 Eric Merrill {@link http://www.merrilldigital.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class chapter extends \core_search\area\base_mod {
class chapter extends \core_search\base_mod {
/**
* @var array Cache of book records.
*/
+1 -1
View File
@@ -33,5 +33,5 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
}
+1 -1
View File
@@ -33,5 +33,5 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
}
+1 -1
View File
@@ -33,5 +33,5 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
}
+1 -1
View File
@@ -33,5 +33,5 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
}
+1 -1
View File
@@ -33,7 +33,7 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
/**
* Returns true if this area uses file indexing.
*
+1 -1
View File
@@ -33,5 +33,5 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
}
+1 -1
View File
@@ -35,7 +35,7 @@ require_once($CFG->dirroot . '/mod/forum/lib.php');
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class post extends \core_search\area\base_mod {
class post extends \core_search\base_mod {
/**
* @var array Internal quick static cache.
+1 -1
View File
@@ -33,5 +33,5 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
}
+1 -1
View File
@@ -35,7 +35,7 @@ require_once($CFG->dirroot . '/mod/glossary/lib.php');
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class entry extends \core_search\area\base_mod {
class entry extends \core_search\base_mod {
/**
* @var array Internal quick static cache.
+1 -1
View File
@@ -33,5 +33,5 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
}
+1 -1
View File
@@ -36,7 +36,7 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
/**
* Overwritten as labels are displayed in-course.
+1 -1
View File
@@ -33,5 +33,5 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
}
+1 -1
View File
@@ -33,5 +33,5 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
}
+1 -1
View File
@@ -33,7 +33,7 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
/**
+1 -1
View File
@@ -33,5 +33,5 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
}
+1 -1
View File
@@ -33,7 +33,7 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
/**
* Returns true if this area uses file indexing.
*
+1 -1
View File
@@ -33,5 +33,5 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
}
+1 -1
View File
@@ -33,7 +33,7 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
/**
* Returns recordset containing required data for indexing activities.
+1 -1
View File
@@ -33,7 +33,7 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2016 Dan Poltawski
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
/**
* Returns the document associated with this activity.
+1 -1
View File
@@ -33,5 +33,5 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
}
@@ -35,7 +35,7 @@ require_once($CFG->dirroot . '/mod/wiki/locallib.php');
* @copyright 2016 Eric Merrill {@link http://www.merrilldigital.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class collaborative_page extends \core_search\area\base_mod {
class collaborative_page extends \core_search\base_mod {
/**
* @var array Cache of wiki records.
*/
+1 -1
View File
@@ -33,5 +33,5 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2015 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity extends \core_search\area\base_activity {
class activity extends \core_search\base_activity {
}
@@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_search\area;
namespace core_search;
defined('MOODLE_INTERNAL') || die();
@@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_search\area;
namespace core_search;
defined('MOODLE_INTERNAL') || die();
@@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_search\area;
namespace core_search;
defined('MOODLE_INTERNAL') || die();
+5 -5
View File
@@ -138,7 +138,7 @@ abstract class engine {
* Returns a search instance of the specified area checking internal caching.
*
* @param string $areaid Area id
* @return \core_search\area\base
* @return \core_search\base
*/
protected function get_search_area($areaid) {
@@ -174,11 +174,11 @@ abstract class engine {
/**
* Returns a document instance prepared to be rendered.
*
* @param \core_search\area\base $searcharea
* @param \core_search\base $searcharea
* @param array $docdata
* @return \core_search\document
*/
protected function to_document(\core_search\area\base $searcharea, $docdata) {
protected function to_document(\core_search\base $searcharea, $docdata) {
list($componentname, $areaname) = \core_search\manager::extract_areaid_parts($docdata['areaid']);
$doc = \core_search\document_factory::instance($docdata['itemid'], $componentname, $areaname, $this);
@@ -255,7 +255,7 @@ abstract class engine {
/**
* Do anything that may need to be done before an area is indexed.
*
* @param \core_search\area\base $searcharea The search area that was complete
* @param \core_search\base $searcharea The search area that was complete
* @param bool $fullindex True if a full index is being performed
* @return void
*/
@@ -268,7 +268,7 @@ abstract class engine {
*
* Return false to prevent the search area completed time and stats from being updated.
*
* @param \core_search\area\base $searcharea The search area that was complete
* @param \core_search\base $searcharea The search area that was complete
* @param int $numdocs The number of documents that were added to the index
* @param bool $fullindex True if a full index is being performed
* @return bool True means that data is considered indexed
+6 -6
View File
@@ -78,12 +78,12 @@ class manager {
const NO_OWNER_ID = 0;
/**
* @var \core_search\area\base[] Enabled search areas.
* @var \core_search\base[] Enabled search areas.
*/
protected static $enabledsearchareas = null;
/**
* @var \core_search\area\base[] All system search areas.
* @var \core_search\base[] All system search areas.
*/
protected static $allsearchareas = null;
@@ -100,7 +100,7 @@ class manager {
/**
* Constructor, use \core_search\manager::instance instead to get a class instance.
*
* @param \core_search\area\base The search engine to use
* @param \core_search\base The search engine to use
*/
public function __construct($engine) {
$this->engine = $engine;
@@ -194,7 +194,7 @@ class manager {
* Returns a new area search indexer instance.
*
* @param string $areaid
* @return \core_search\area\base|bool False if the area is not available.
* @return \core_search\base|bool False if the area is not available.
*/
public static function get_search_area($areaid) {
@@ -218,7 +218,7 @@ class manager {
* Return the list of available search areas.
*
* @param bool $enabled Return only the enabled ones.
* @return \core_search\area\base[]
* @return \core_search\base[]
*/
public static function get_search_areas_list($enabled = false) {
@@ -681,7 +681,7 @@ class manager {
/**
* Returns search areas configuration.
*
* @param \core_search\area\base[] $searchareas
* @param \core_search\base[] $searchareas
* @return \stdClass[] $configsettings
*/
public function get_areas_config($searchareas) {
+1 -1
View File
@@ -1001,7 +1001,7 @@ class engine extends \core_search\engine {
*
* Return false to prevent the search area completed time and stats from being updated.
*
* @param \core_search\area\base $searcharea The search area that was complete
* @param \core_search\base $searcharea The search area that was complete
* @param int $numdocs The number of documents that were added to the index
* @param bool $fullindex True if a full index is being performed
* @return bool True means that data is considered indexed
+1 -1
View File
@@ -27,7 +27,7 @@ namespace core_mocksearch\search;
defined('MOODLE_INTERNAL') || die;
class mock_search_area extends \core_search\area\base {
class mock_search_area extends \core_search\base {
/**
* Multiple context level so we can test get_areas_user_accesses.
+1 -1
View File
@@ -49,7 +49,7 @@ class engine extends \core_search\engine {
return null;
}
public function to_document(\core_search\area\base $searcharea, $docdata) {
public function to_document(\core_search\base $searcharea, $docdata) {
return parent::to_document($searcharea, $docdata);
}
+2 -2
View File
@@ -80,10 +80,10 @@ class testable_core_search extends \core_search\manager {
* Adds an enabled search component to the search areas list.
*
* @param string $areaid
* @param \core_search\area\base $searcharea
* @param \core_search\base $searcharea
* @return void
*/
public function add_search_area($areaid, \core_search\area\base $searcharea) {
public function add_search_area($areaid, \core_search\base $searcharea) {
self::$enabledsearchareas[$areaid] = $searcharea;
self::$allsearchareas[$areaid] = $searcharea;
}
+1 -1
View File
@@ -70,7 +70,7 @@ class search_manager_testcase extends advanced_testcase {
$fakeareaid = \core_search\manager::generate_areaid('mod_unexisting', 'chihuaquita');
$searcharea = \core_search\manager::get_search_area($this->forumpostareaid);
$this->assertInstanceOf('\core_search\area\base', $searcharea);
$this->assertInstanceOf('\core_search\base', $searcharea);
$this->assertFalse(\core_search\manager::get_search_area($fakeareaid));
+1 -1
View File
@@ -35,7 +35,7 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2016 Devang Gaur {@link http://www.devanggaur.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class user extends \core_search\area\base {
class user extends \core_search\base {
/**
* Returns recordset containing required data attributes for indexing.