-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b24faf3
commit 38ae377
Showing
17 changed files
with
662 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?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/>. | ||
|
||
/** | ||
* Auto-provisioning service. | ||
* | ||
* @package tool_webanalytics | ||
* @author Simon Adams ([email protected]) | ||
* @copyright 2023 Catalyst IT | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace tool_webanalytics; | ||
|
||
use tool_webanalytics\plugininfo\watool; | ||
|
||
class auto_provisioner { | ||
|
||
/** | ||
* Get all plugin types that support provisioning and are ready to provision. Then attempt an auto-provision. | ||
* | ||
* @return void | ||
*/ | ||
public static function auto_provision(): void { | ||
$autoprovisionable = plugin_manager::instance()->get_auto_provision_type_plugins(); | ||
|
||
/** @var watool $tool */ | ||
foreach ($autoprovisionable as $tool) { | ||
$class = $tool->get_tool_classname(); | ||
if ($class::can_auto_provision()) { | ||
$class::auto_provision(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Matomo (formerly Piwik) | ||
- Set the Site ID | ||
- Choose whether you want image fallback tracking | ||
- Enter the URL to your Matomo install excluding http/https and trailing slashes | ||
- Choose whether you want to track admins (not recommended) | ||
- Choose whether you want to send Clean URLs (recommended): Matomo will aggregate Page Titles and show a nice waterfall cascade of all sites, | ||
- Set alternative piwik.js URL for any purpose | ||
including categories and action types | ||
- Optional tracking for User ID | ||
- User ID could be id or username | ||
- Set the API url | ||
- Set the API token | ||
|
||
If both the API url and API token are set in the form and the siteid is empty when the form is submitted, an attempt to register the site with the API will be made. | ||
|
||
|
||
# Auto-provisioning | ||
- Set the global config settings 'apitoken' and 'apiurl' to enable auto provisioning. These can also be set in config.php e.g: | ||
- `$CFG->forced_plugin_settings['watool_matomo']['apiurl'] = 'https://matomo.org';` | ||
- `$CFG->forced_plugin_settings['watool_matomo']['apitoken'] = 'xxxx';` | ||
- Auto provisioning attempts are made if the current site url has changed since any of the instances were stored. | ||
- If autoprovisioning failed, the instance will be set with the name 'auto-provisioned:FAILED'. Delete the instance to attempt an autoprovision again. |
Oops, something went wrong.