Welcome Guest, Not a member yet? Register   Sign In
Integrate Zend Framework Barcode Library2 in Codeigniter 2.1.3
#1

[eluser]zoellsche[/eluser]
Hello,

I have a problem to integrate the zend framework 2 (i want use the barcode class) in CI 2.1.3.

This is the tutorial i used
http://www.beyondcoding.com/2008/02/21/u...deigniter/

but this error massage is shown after I load the barcode zend class ($this->zend->load('Zend/Barcode/Barcode'))

Error:Fatal error: Class 'Zend_Barcode' not found

So far I found no answer at google....

The tuts are only for older versions...

There must be something wrong with the path

ini_set('include_path',

ini_get('include_path') . PATH_SEPARATOR . APPPATH . 'libraries');

require_once(): Failed opening required 'Zend/Barcode.php' (include_path='.;C:\\xampp\\php\\PEAR;application/libraries')

and if i you use require direct i got this error: Class 'Zend_Barcode' not found.

Do you have any solution for this problem?
#2

[eluser]XMadMax[/eluser]
Hey,

The Zend libraries can be installed under /third_party/Zend

I modified /libraries/Zend.php (the loader) :

Code:
class Zend
{
/**
  * Constructor
  *
  * @param string $class class name
  */
function __construct($class = NULL)
{
  // include path for Zend Framework
  // alter it accordingly if you have put the 'Zend' folder elsewhere
        if (!strstr(ini_get('include_path'),APPPATH . 'third_party'))
        {
            ini_set('include_path',
            ini_get('include_path') . PATH_SEPARATOR . APPPATH . 'third_party');
        }

  if ($class)
  {
   require_once (string) $class . EXT;
   log_message('debug', "Zend Class $class Loaded");
  }
  else
  {
   log_message('debug', "Zend Class Initialized");
  }
}

/**
  * Zend Class Loader
  *
  * @param string $class class name
  */
function load($class)
{
  require_once (string) $class . EXT;
  log_message('debug', "Zend Class $class Loaded");
}
}


Also, remember to instantiate the class after load:

Code:
$this->load->library('Zend','Zend/Barcode/Barcode');
$this->Zend_Barcode = new Zend\Barcode\Barcode();




Theme © iAndrew 2016 - Forum software by © MyBB