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

Fresh install - Invalid File #33

Closed
alisonrag opened this issue Apr 19, 2019 · 5 comments
Closed

Fresh install - Invalid File #33

alisonrag opened this issue Apr 19, 2019 · 5 comments

Comments

@alisonrag
Copy link

alisonrag commented Apr 19, 2019

Using current CodeIgniter version:
https://github.com/codeigniter4/CodeIgniter4

cloned myth-auth to app/ThirdParty/auth

added to Autoload.php $psr4:

'Myth\\Auth' => APPPATH . 'ThirdParty\\auth\\src', // Auth system

added to Validations.php

\Myth\Auth\Authentication\Passwords\ValidationRules::class,

and migrated

php spark migrate:latest -all

when i try
localhost:8080/login

result:
image

i not checked if is a issue with this system or with CI4

a workaround that worked to me:
CI4\system\Autoloader\FileLocator.php

commented line 135:
//$filename = $folder . '/' . $filename;

result:
image

@MGatner
Copy link
Collaborator

MGatner commented Apr 19, 2019

Looks like it is trying to load a View file that isn’t there. The actual file should be farther down than your screenshot shows (maybe revealed by clicking “arguments”), and would help a lot for troubleshooting.

@alisonrag
Copy link
Author

alisonrag commented Apr 20, 2019

image

CI4 is trying to load:
C:\webserver\htdocs\app\ThirdParty\auth\src/\Views/Views/login.php

he is adding one more 'Views' in path for no reason

a better workaround that should not break the function:
CI4\system\Autoloader\FileLocator.php changed line 134
from:
if (! empty($folder) && strpos($path . $filename, '/' . $folder . '/') === false)

to
if ((! empty($folder) && strpos($path . $filename, '/' . $folder . '/') === false) && !is_file($path . $filename))

@MGatner
Copy link
Collaborator

MGatner commented Apr 21, 2019

I don't see the actual view path in your screenshot but the one you pasted seems to have translated incorrectly from namespace to path. I'm not sure if this is an issue with Windows, but the namespace View is correct (Myth\Auth\Views\login.php) so my guess is this is an issue with CI4 and not Myth:Auth.

@alisonrag
Copy link
Author

hmm i see. seems to be a problem with CI, my login view is default, it's a fresh install

@lonnieezell
Copy link
Owner

I cannot replicate. I did the same thing:

  • clone CI
  • clone Myth\Auth into app/ThirdParty/auth
  • added namespace to Autoload.php: Myth\Auth' => APPPATH .'ThirdParty/auth/src
  • php spark serve
  • visit /login
  • screen showed up as expected.

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

No branches or pull requests

3 participants