Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to extend a library in codeigniter. The only way to do so seems to include the original library using require_once then load the extended library using $this->load->library()

right now I have tried

  1. require_once('ion_auth.php');
  2. require_once('home/SITE_NAME/public_html/FOLDER_NAME/application/libraries/ion_auth.php')
  3. require_once('/home/SITE_NAME/public_html/FOLDER_NAME/application/libraries/ion_auth.php')

but unfortunately not luck..... I keep getting this error

Message: require_once(...) [function.require-once]: failed to open stream: No such file or directory

Weird thing is though this works on my local xampp environment but not on the actual server.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
415 views
Welcome To Ask or Share your Answers For Others

1 Answer

Use CodeIgniter's built in constant, APPPATH

require_once(APPPATH.'libraries/ion_auth.php');


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...