• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Starting with Myth:Auth - some questions

#1
Hello All !

First of all, Thank you very much Lonnie for this mythic auth library !

Big Grin 


Following the installation instruction, I used composer with the command: 

PHP Code:
composer require myth/auth 
 
And I got the following error:

   

I am not a "composer" guy I´m from the time we had to download the zip file and upload it using FTP... hehe

Is there a way to install it without composer ?

Tried this:


Code:
λ composer require myth/auth:*
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package myth/auth * is satisfiable by myth/auth[dev-develop, dev-entityrefactor, dev-services, v1.0-beta] but these conflict with your requirements or minimum-stability.


Installation failed, reverting ./composer.json to its original content.
Reply

#2
I manually installed it but Lonnie answered this in another forum topic here.

READ ME 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
(11-01-2019, 02:47 AM)InsiteFX Wrote: I manually installed it but Lonnie answered this in another forum topic here.

READ ME 

Yeap... using the @beta worked for me.....

Can you give me some tips on how to manually install it ?  Dodgy ... I am not a big fan of composer....
Reply

#4
I just created the Myth/Auth directory and copied the src folder files into the Myth/Auth folder.

Then set everything up as in the Readme.md
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#5
(11-01-2019, 08:41 AM)InsiteFX Wrote: I just created the Myth/Auth directory and copied the src folder files into the Myth/Auth folder.

Then set everything up as in the Readme.md

So much easier....  Big Grin 

Where does the Myth/Auth directory should be placed ? Inside app folder ? Inside the root directory ?

Lonnie should put this method on the guide....
Reply

#6
You're right, I should add manual installation instructions back in. Had it there at one point, but then got it up on Packagist so Composer install would work and I replaced it instead of augmented the instructions. I'll get that remedied soon-ish.

The beauty of auto-loading is that you can place those files anywhere on the system you want (maybe app/ThirdParty?). Then you just have to tell the autoloader where to find it by editing app/Config/Autoload.php and add the Myth\Auth namespace to the $psr4 array.

PHP Code:
$psr4 = [
    
'Config' => APPPATH 'Config',
    
APP_NAMESPACE => APPPATH,            
    
'App' => APPPATH,
    
'Myth/Auth' => APPPATH .'ThirdParty/Myth/Auth/src',
]; 
Support Development  • Practical CodeIgniter 3  •
Myth:AuthVulcan - CLI Tools for CI4
Reply

#7
(11-01-2019, 09:04 AM)kilishan Wrote: You're right, I should add manual installation instructions back in. Had it there at one point, but then got it up on Packagist so Composer install would work and I replaced it instead of augmented the instructions. I'll get that remedied soon-ish.

The beauty of auto-loading is that you can place those files anywhere on the system you want (maybe app/ThirdParty?). Then you just have to tell the autoloader where to find it by editing app/Config/Autoload.php and add the Myth\Auth namespace to the $psr4 array.

PHP Code:
$psr4 = [
    'Config' => APPPATH 'Config',
    APP_NAMESPACE => APPPATH,            
    
'App' => APPPATH,
    'Myth/Auth' => APPPATH .'ThirdParty/Myth/Auth/src',
]; 

Since CI4 have the option to be installed without composer, a good library should also have that option...  Big Grin

I will keep the app folder only with my own code. I will place the Myth/Auth inside root/third-party (just my personal taste)

Another question, is auto-loading really required ? I mean, is it going to be loaded in every controller ? What about the controllers that doesn´t require it ? Is there a way to load it just when it is needed ?

Thanks again !
Reply

#8
(11-01-2019, 09:13 AM)Poetawd Wrote: Another question, is auto-loading really required ? I mean, is it going to be loaded in every controller ? What about the controllers that doesn´t require it ? Is there a way to load it just when it is needed ?

Thanks again !

The Autoloading class doesn't do it like in CI3 - no files are loaded just because they are in that file. It is more in the spirit of Composer's autoloading where it tells it how to find files within that namespace so the file can be loaded automatically whenever it's first needed.
Support Development  • Practical CodeIgniter 3  •
Myth:AuthVulcan - CLI Tools for CI4
Reply

#9
(11-01-2019, 09:16 AM)kilishan Wrote:
(11-01-2019, 09:13 AM)Poetawd Wrote: Another question, is auto-loading really required ? I mean, is it going to be loaded in every controller ? What about the controllers that doesn´t require it ? Is there a way to load it just when it is needed ?

Thanks again !

The Autoloading class doesn't do it like in CI3 - no files are loaded just because they are in that file. It is more in the spirit of Composer's autoloading where it tells it how to find files within that namespace so the file can be loaded automatically whenever it's first needed.

Superb ! Thank you for pointing that out !  Big Grin 

I will play some more with  Myth/Auth today... I am starting a new project (the time frame is january) and I will be using CI4 + Myth/Auth as its base.

Hey Lonnie, let me ask you something: Can I hire you just to take a look at my code and give me some advice ? Like a mentorship ? I am coming from CI3 and fells like there are a few things a need to improve... Btw, I am already your patron !  Big Grin
Reply

#10
Unfortunately, I don't have the bandwidth currently to take on any freelancing jobs or mentorships, as much as I would love to be able to. Sorry.
Support Development  • Practical CodeIgniter 3  •
Myth:AuthVulcan - CLI Tools for CI4
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.