first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
<?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/>.
/**
* Dummy storage manager, returns nothing.
* used when no other manager available.
*
* @package core
* @copyright 2013 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core\log;
defined('MOODLE_INTERNAL') || die();
class dummy_manager implements manager {
public function get_readers($interface = null) {
return array();
}
public function dispose() {
}
public function get_supported_logstores($component) {
return array();
}
}
+62
View File
@@ -0,0 +1,62 @@
<?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/>.
/**
* Log storage manager interface.
*
* @package core
* @copyright 2013 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core\log;
defined('MOODLE_INTERNAL') || die();
/**
* Interface describing log readers.
*
* This is intended for reports, use get_log_manager() to get
* the configured instance.
*
* @package core
*/
interface manager {
/**
* Return list of available log readers.
*
* @param string $interface All returned readers must implement this interface.
*
* @return \core\log\reader[]
*/
public function get_readers($interface = null);
/**
* Dispose all initialised stores.
* @return void
*/
public function dispose();
/**
* For a given report, returns a list of log stores that are supported.
*
* @param string $component component.
*
* @return false|array list of logstores that support the given report. It returns false if the given $component doesn't
* require logstores.
*/
public function get_supported_logstores($component);
}
+51
View File
@@ -0,0 +1,51 @@
<?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/>.
/**
* Log storage reader interface.
*
* @package core
* @copyright 2013 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core\log;
defined('MOODLE_INTERNAL') || die();
interface reader {
/**
* Localised name of the reader.
*
* To be used in selection for in reports.
*
* @return string
*/
public function get_name();
/**
* Longer description of the log data source.
* @return string
*/
public function get_description();
/**
* Are the new events appearing in the reader?
*
* @return bool true means new log events are being added, false means no new data will be added
*/
public function is_logging();
}
@@ -0,0 +1,51 @@
<?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/>.
/**
* Log storage sql internal table reader interface.
*
* @package core
* @copyright 2015 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core\log;
defined('MOODLE_INTERNAL') || die();
/**
* Sql internal table reader.
*
* Replaces sql_internal_reader and extends sql_reader.
*
* @since Moodle 2.9
* @package core
* @copyright 2015 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
interface sql_internal_table_reader extends sql_reader {
/**
* Returns name of the table or database view that
* holds the log data in standardised format.
*
* Note: this table must be used for reading only,
* it is strongly recommended to use this in complex reports only.
*
* @return string
*/
public function get_internal_log_table_name();
}
+100
View File
@@ -0,0 +1,100 @@
<?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/>.
/**
* Log iterator reader interface.
*
* @package core
* @copyright 2015 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core\log;
defined('MOODLE_INTERNAL') || die();
/**
* Log iterator reader interface.
*
* Replaces sql_select_reader adding functions
* to return iterators.
*
* @since Moodle 2.9
* @package core
* @copyright 2015 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
interface sql_reader extends reader {
/**
* Fetch records using given criteria.
*
* @param string $selectwhere
* @param array $params
* @param string $sort
* @param int $limitfrom
* @param int $limitnum
* @return \core\event\base[]
*/
public function get_events_select($selectwhere, array $params, $sort, $limitfrom, $limitnum);
/**
* Return number of events matching given criteria.
*
* @param string $selectwhere
* @param array $params
* @return int
*/
public function get_events_select_count($selectwhere, array $params);
/**
* Get whether events are present for the given select clause.
*
* @param string $selectwhere select conditions.
* @param array $params params.
*
* @return bool Whether events available for the given conditions
*/
public function get_events_select_exists(string $selectwhere, array $params): bool;
/**
* Fetch records using the given criteria returning an traversable list of events.
*
* Note that the returned object is Traversable, not Iterator, as we are returning
* EmptyIterator if we know there are no events, and EmptyIterator does not implement
* Countable {@link https://bugs.php.net/bug.php?id=60577} so valid() should be checked
* in any case instead of a count().
*
* Also note that the traversable object contains a recordset and it is very important
* that you close it after using it.
*
* @param string $selectwhere
* @param array $params
* @param string $sort
* @param int $limitfrom
* @param int $limitnum
* @return \Traversable|\core\event\base[] Returns an iterator containing \core\event\base objects.
*/
public function get_events_select_iterator($selectwhere, array $params, $sort, $limitfrom, $limitnum);
/**
* Returns an event from the log data.
*
* @param \stdClass $data Log data
* @return \core\event\base
*/
public function get_log_event($data);
}