DataSift\Storyplayer\Cli\Feature_TestUsersSupport::initAfterModulesAvailable PHP Метод

initAfterModulesAvailable() публичный Метод

public initAfterModulesAvailable ( StoryTeller $st, Phix_Project\CliEngine $engine, DataSift\Storyplayer\Injectables $injectables )
$st DataSift\Storyplayer\PlayerLib\StoryTeller
$engine Phix_Project\CliEngine
$injectables DataSift\Storyplayer\Injectables
    public function initAfterModulesAvailable(StoryTeller $st, CliEngine $engine, Injectables $injectables)
    {
        // shorthand
        $output = $injectables->output;
        // do we *have* any users to load?
        if (!isset($engine->options->testUsersFile)) {
            // do nothing
            return;
        }
        // understand what we are about to do
        $filename = $engine->options->testUsersFile;
        $isReadOnly = false;
        if (isset($engine->options->readOnlyTestUsers) && $engine->options->readOnlyTestUsers) {
            $isReadOnly = true;
        }
        // go silent
        $output->setSilentMode();
        // load the users
        $this->loadTestFile($st, $output, $filename, $isReadOnly);
        // are we read-only?
        if (isset($engine->options->readOnlyTestUsers) && $engine->options->readOnlyTestUsers) {
            usingUsers()->setUsersFileIsReadOnly();
        } else {
            $setting = fromTestEnvironment()->getModuleSetting("users.readOnly");
            if ($setting === true) {
                usingUsers()->setUsersFileIsReadOnly();
            }
        }
        // all done
        $output->resetSilentMode();
    }