Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom locks #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Support custom locks #17

wants to merge 1 commit into from

Conversation

aolley
Copy link
Contributor

@aolley aolley commented Aug 17, 2021

Without this - there is no way to define custom lock instances and the default
file locking is forced.

This lets you define your own:

$CFG->tool_forcedcache_config_array = [
  'locks' => [
    'muclock_default' => [
      'name' => 'Example custom lock',
      'type' => 'cachelock_file',
    ],
  ],
];

Without this - there is no way to define custom lock instances and the default
file locking is forced.

This lets you define your own:
```
$CFG->tool_forcedcache_config_array = [
  'locks' => [
    'muclock_default' => [
      'name' => 'Example custom lock',
      'type' => 'cachelock_file',
    ],
  ],
];
```

// Then check the lock plugins exist.
$pluginname = substr($lock['type'], 10);
$cachepath = __DIR__.'/../../../../cache/locks/' . $pluginname . '/lib.php';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The $CFG object should be available here, so it will be a little cleaner to use $CFG->wwwroot . '/cache...'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$CFG->dirroot rather - but otherwise sure.

@Peterburnett
Copy link
Contributor

Thanks @aolley for your PRs against the plugin, overall they look great, and your contributions are appreciated. I will be able to test these next week in a real environment, but It may be nice to implement some unit tests for these features as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants