Welcome Guest, Not a member yet? Register   Sign In
ionAuth controller and view overwrite
#1

I have a problem to overwrite controller and view of ionAuth.

i use Wamp on my local enviroment and i am able to overwrite the controller and view.

but when i tried to deploy on apache linux enviroment, my overwrite doesnt seem to work. Is there something that i may have missed?
Reply
#2

Hi,

You will need to provide us with some code, or it will be a needle in a haystack for us to help you. :-)
Reply
#3

(This post was last modified: 07-22-2020, 02:54 AM by ewnm.)

certainly, i sorry not posting codes

i am trying to overwrite ionAuth Controller. I followed the instructions https://github.com/benedmunds/CodeIgnite...TALLING.md
PHP Code:
<?php namespace App\Controllers;

class 
Auth extends \IonAuth\Controllers\Auth
{
    /**
     * Create a new user
     *
     * @return string|\CodeIgniter\HTTP\RedirectResponse
     */
    
public function create_user()
    {....} 

and my app still using the controller that is in the vendor\benedmunds\codeigniter-ion-auth

the same with the view, i copy ionauth views folder to my views folder as mentioned on the ionauth installation guide

everything works on my xamp ... but when i deploy it on the apache linux server... i can see the debug window that show the login.php is using the vendors views

login.php    VENDORPATH/benedmunds/codeigniter-ion-auth/Views/auth/login.php

Here is what on my local dev env
login.php   APPPATH\Views\IonAuth\Views\auth\login.php

I already added and checked IonAuth namespace to psr4  (linux)
PHP Code:
        $psr4 = [
            
'App'         => APPPATH,                // To ensure filters, etc still found,
            
APP_NAMESPACE => APPPATH,                // For custom namespace
            'Config'      => APPPATH 'Config',
            'IonAuth' => ROOTPATH 'CodeIgniter-Ion-Auth',
            
        
]; 


my routes is the same
PHP Code:
$routes->group('auth', ['namespace' => 'IonAuth\Controllers'], function ($routes) {
    $routes->get('/''Home::dashboard');
    
$routes->get('userlist''Auth::index');
    
$routes->add('login''Auth::login');
    
$routes->get('logout''Auth::logout');
    
$routes->add('forgot_password''Auth::forgot_password');
}); 


i already checked that both code server and local are the same... i suspecting that i missed something on the apache linux side.
Maybe someone have similar experience on this and point me a direction. or maybe show me how does normally one overwrite vendor controller in CI4
Reply
#4

Thanks for the information, hopefully there are enough in there for someone to be able to help you know. :-)
Haven't personally used it so I'm tapping out now.
Reply
#5

(This post was last modified: 07-22-2020, 06:43 AM by qury.)

Have you checked the directory and file names?
Linux systems are case sensitive, so if you have a discrepancy between upper and lowercase file or directory names that could thrown the whole thing off.

At least this would be the first thing i would check in a similar situation.
The next would be to ensure that the folders and files are accessible for the user/group that runs the web server (typically www-data or apache etc...) use htop top check the username of the httpd process.
The third one is to ensure that the writable folder is indeed writable for the above user so session and log files could be created.

A suggestion: if your final environment is linux, then develop in linux (virtualbox/vmware is your friend).
Reply
#6
Thumbs Up 

i also figure that the filename case is a possibility as windows is more forgiving about it. I guess i will look this up more closely then.

i already setup the user group and the writeable to be accessable, so it should be ok.

On that last thing, yes, i am trying to break my own habit of developing on window enviroment and slowly learning about vagrant. Thanks for the tip and the help. Angel
Reply
#7

Haven't personally used it so I'm tapping out now.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB