Welcome Guest, Not a member yet? Register   Sign In
How do I include the OOP “defiant randomdotorg” library in codeigniter?
#1

The class is here (with instructions).
I have it added to 
Code:
application/libraries/randomorg

When I add 
Code:
$this->load->library('RandomOrg\Random');

 to my controller's constructor, I get the following error.

Quote:Message: Class 'RandomOrg\Client' not found
I have tried adding the various files before that (such as Client.php), but that doesn't help.
What is going on and how do I fix it?
Reply
#2

(03-23-2018, 09:14 PM)desbest Wrote: The class is here (with instructions).
I have it added to 
Code:
application/libraries/randomorg

When I add 
Code:
$this->load->library('RandomOrg\Random');

 to my controller's constructor, I get the following error.

Quote:Message: Class 'RandomOrg\Client' not found
I have tried adding the various files before that (such as Client.php), but that doesn't help.
What is going on and how do I fix it?

why do you need the randomorg client?

Set $config['composer_autoload'] to true.
Add the composer.json to the application folder.
And install the dependencies


https://www.codeigniter.com/user_guide/g...oader.html
https://getcomposer.org/doc/01-basic-usage.md
Reply
#3

I'm not using Composer because I need shell access to install Composer and my web host doesn't provide shell access.
I got the answer on Stack Overflow here https://stackoverflow.com/a/49461228/337306
Reply
#4

You do not need composer on you webhost.
Reply
#5

Yes, you do not need composer on your web host.
No SEO spam!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB