CodeIgniter Forums

Full Version: CI 3.0.7 don't see APPPATH. Why?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!
My controller
PHP Code:
public function getorders()
 
   {
 
       $apiKey '*****';
 
       $apiSecret '***';
 
      
        require_once APPPATH
.'libraries/Client.php'

Why is CI don't see libraries folder? 
Severity: Warning

Message: require_once(C:\OSPanel\domains\site3\application\libraries/Client.php): failed to open stream: No such file or directory
Er, your title is misleading. CI does see APPPATH - that is obvious from your error message.
The error message suggests that Client.php is not in that location.

Curious, but why wouldn't you use $this->load->library('client') ? That is the "CI way".
I tried to connect it like you said .. also does not work (
Here's what I want to connect ..
https://github.com/edsonmedina/bittrex
(02-28-2018, 05:04 PM)ciadmin Wrote: [ -> ]Er, your title is misleading. CI does see APPPATH - that is obvious from your error message.
The error message suggests that Client.php is not in that location.

Curious, but why wouldn't you use $this->load->library('client') ? That is the "CI way".
P.S. i'm used last version (3.1.7, php 7.2)
Your path has all backslashes, until the end, where it has /Client.php.

Maybe try using a backslash?
in client.php remark out the name space.

PHP Code:
// Load the library
$this->load->library('client');

// Create a new instants of client
$test = new client($apiKey$apiSecret); 

Load it like any other CodeIgniter Library...
I solved the problem ..
If you connect as a library - it does not work, because there is a call right away
If you connect as a helper - it works. Because when connected helper is not immediately called
Thank you