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

fix error BaseFilter not found when use auth:publish #569

Closed
wants to merge 12 commits into from

Conversation

hunter-and1
Copy link

@hunter-and1 hunter-and1 commented Sep 6, 2022

update

src/Commands/Publish.php

    protected function publishFilters()
    {
        $filters = ['LoginFilter', 'PermissionFilter', 'RoleFilter'];

        foreach ($filters as $filter) {
            $path = "{$this->sourcePath}/Filters/{$filter}.php";

            $content = file_get_contents($path);
            $content = $this->replaceNamespace($content, 'Myth\Auth\Filters', 'Filters');
            $usingClasses = "use CodeIgniter\HTTP\ResponseInterface;\n";
            $newusingClasses = $usingClasses."use \Myth\Auth\Filters\BaseFilter;\n";
            $content = str_replace($usingClasses, $newusingClasses, $content);

            $this->writeFile("Filters/{$filter}.php", $content);
        }
    }

@manageruz
Copy link
Collaborator

manageruz commented Sep 6, 2022

Please fork the develop branch and make your PR from there.

@manageruz
Copy link
Collaborator

And replacement code not working.

@manageruz
Copy link
Collaborator

Closing as fixed by #575

@manageruz manageruz closed this Oct 25, 2022
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.

None yet

3 participants