-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moodle code compliance changes, a noop
- Loading branch information
1 parent
796916e
commit d6d8523
Showing
9 changed files
with
39 additions
and
33 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 |
---|---|---|
@@ -1,13 +1,12 @@ | ||
# .github/workflows/ci.yml | ||
name: ci | ||
|
||
env: | ||
PLUGIN: tool_forcedcache | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
ci: | ||
uses: catalyst/catalyst-moodle-workflows/.github/workflows/ci.yml@main | ||
secrets: | ||
moodle_org_token: ${{ secrets.MOODLE_ORG_TOKEN }} | ||
with: | ||
disable_behat: true |
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 |
---|---|---|
|
@@ -15,15 +15,13 @@ | |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* This class changes the actions that are available to various stores, | ||
* and changes the layout slightly | ||
* This class changes the actions that are available to various stores, and changes the layout slightly | ||
* | ||
* @package tool_forcedcache | ||
* @author Peter Burnett <[email protected]> | ||
* @copyright Catalyst IT | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
class tool_forcedcache_cache_administration_helper extends core_cache\administration_helper { | ||
|
||
/** | ||
|
@@ -133,7 +131,7 @@ public function get_ruleset_output(): string { | |
/** | ||
* Generates a config table for the selected caching store | ||
* | ||
* @param integer $mode the mode to generate the table for. | ||
* @param string $name def table name (prefix) | ||
* @param array $config the config array from the JSON. | ||
* @return string HTML for the table. | ||
*/ | ||
|
@@ -197,7 +195,7 @@ private function generate_override_table(array $overrides): string { | |
/** | ||
* Generates a ruleset table for the selected caching mode. | ||
* | ||
* @param integer $mode the mode to generate the table for. | ||
* @param int $mode the mode to generate the table for. | ||
* @param array $config the config array from the JSON. | ||
* @return string HTML for the table. | ||
*/ | ||
|
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 |
---|---|---|
|
@@ -15,16 +15,15 @@ | |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* This cache_config class extends the first one, and generates the | ||
* configuration array from reading a hardcoded JSON file instead of | ||
* the configuration file on shared disk. | ||
* This cache_config class generates the configuration array from reading a hardcoded JSON file | ||
* | ||
* Instead of the configuration file on shared disk. | ||
* | ||
* @package tool_forcedcache | ||
* @author Peter Burnett <[email protected]> | ||
* @copyright Catalyst IT | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
class tool_forcedcache_cache_config extends cache_config { | ||
|
||
/** | ||
|
@@ -283,9 +282,10 @@ public static function get_default_mode_mappings() : array { | |
/** | ||
* This function generates the mappings for each cache mode after rules are applied. | ||
* | ||
* @param array $rules | ||
* @return array the generated mode mappings post-rules. | ||
*/ | ||
private function generate_mode_mapping($rules): array { | ||
private function generate_mode_mapping(array $rules): array { | ||
$modetostr = [ | ||
cache_store::MODE_APPLICATION => 'application', | ||
cache_store::MODE_SESSION => 'session', | ||
|
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 |
---|---|---|
|
@@ -14,16 +14,15 @@ | |
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
namespace tool_forcedcache\privacy; | ||
|
||
/** | ||
* Plugin privacy provider | ||
* | ||
* @package tool_forcedcache | ||
* @copyright 2020 Peter Burnett <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace tool_forcedcache\privacy; | ||
|
||
class provider implements | ||
// This plugin does not store any personal user data. | ||
\core_privacy\local\metadata\null_provider { | ||
|
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 |
---|---|---|
|
@@ -14,6 +14,15 @@ | |
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Language strings | ||
* | ||
* @package tool_forcedcache | ||
* @author Peter Burnett <[email protected]> | ||
* @copyright 2022, Catalyst IT | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
$string['pluginname'] = 'Forced Caching'; | ||
|
||
// Page Strings. | ||
|
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 |
---|---|---|
|
@@ -14,18 +14,18 @@ | |
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
namespace tool_forcedcache; | ||
|
||
/** | ||
* Test file for tool_forcedcache_cache_config. | ||
* Tests for tool_forcedcache_cache_config. | ||
* | ||
* @package tool_forcedcache | ||
* @author Peter Burnett <[email protected]> | ||
* @copyright Catalyst IT | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
* @covers \tool_forcedcache_cache_config | ||
*/ | ||
|
||
namespace tool_forcedcache\tests; | ||
|
||
class tool_forcedcache_cache_config_testcase extends \advanced_testcase { | ||
class cache_config_test extends \advanced_testcase { | ||
|
||
/** | ||
* We need to load the config files outside of the $CFG->dirroot, so it | ||
|
can't do this, it's incompatible with core