0

I am using codeigniter and trying to integrate Os-ticket into it. The reason for moving into codeigniter is for user login to work with Os-ticket log in.

Hence I created codeigniter library and was trying to load the 'view.php' from library.

class Lib_support
{

protected $ci;

/**
 * __construct
 *
 * @return void
 * @author 
 **/
public function __construct()
{

    $this->ci =& get_instance();
    $this->ci->load->library('session');
    $this->ci->load->database();
    $this->ci->load->helper('date');
    $this->ci->load->helper('url');

    $CI=& get_instance();

    if (! isset($_SESSION)) {
        session_start();
    }

}

    public function view()
    {

        require('support/view.php');
    } 

 } 

That's where I got this message.

I placed the osticket files inside ../application/libraries/support/ folder. And was calling require('support/view.php');

Can anyone let me know what went wrong here or what steps(config values) that I need to take care while changing/moving files to codeingiter library folder.

From what I understood, is that the INCLUDE_DIR failed and hence the require files might have failed to load. The code is working perfectly if I placed outside codeigniter folder.

Moppo
  • 18,797
  • 5
  • 65
  • 64
jones
  • 749
  • 7
  • 34

1 Answers1

0

You are requiring a file form the ../application/libraries/support/ folder, For this I think you should use the APPPATH constant provided by CI.

require(APPPATH.'libraries/support/view.php');
Nil'z
  • 7,487
  • 1
  • 18
  • 28
  • Thanks... But the issue that I am talking about is from view.php(Which is Osticket file). Ie require('support/view.php'); is loading perfectly. But inside view.php osticket variables are not loaded. Anyone used Osticket inside Codeingiter??? – jones Jul 30 '15 at 10:03
  • 1
    What I've found is that you need to change the values in Bootstrap.php. define('INCLUDE_DIR',"/include/"); //Change this if include is moved outside the web path. define('PEAR_DIR',INCLUDE_DIR.'pear/'); define('ROOT_DIR',''); – jones Jul 30 '15 at 10:33