CodeIgniter Forums
CI 3.0.7 don't see APPPATH. Why? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: CI 3.0.7 don't see APPPATH. Why? (/showthread.php?tid=70146)



CI 3.0.7 don't see APPPATH. Why? - StAlKeRxXl - 02-28-2018

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


RE: CI 3.0.7 don't see APPPATH. Why? - ciadmin - 02-28-2018

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".


RE: CI 3.0.7 don't see APPPATH. Why? - StAlKeRxXl - 02-28-2018

I tried to connect it like you said .. also does not work (
Here's what I want to connect ..
https://github.com/edsonmedina/bittrex


RE: CI 3.0.7 don't see APPPATH. Why? - StAlKeRxXl - 02-28-2018

(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".



RE: CI 3.0.7 don't see APPPATH. Why? - StAlKeRxXl - 02-28-2018

P.S. i'm used last version (3.1.7, php 7.2)


RE: CI 3.0.7 don't see APPPATH. Why? - JayAdra - 02-28-2018

Your path has all backslashes, until the end, where it has /Client.php.

Maybe try using a backslash?


RE: CI 3.0.7 don't see APPPATH. Why? - InsiteFX - 03-01-2018

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...


RE: CI 3.0.7 don't see APPPATH. Why? - StAlKeRxXl - 03-01-2018

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