0
votes

I am new to PHP and very new to Zend Framework, so please give me a detailed answer.

I have Zend Server (including Zend Framework), Apache, MySql installed on the machine. I have a project created in Eclipse PDT (not with Zend Framework) and I've decided I want to use Zend_Db in my Data Acces Layer. I read many answers here and on other forums, I saw that I should use Zend_Loader but I am not really sure how to begin. I also saw that I need some php extension appropriate to the type of my database server.

As I said, please give me a detailed answer or a kick in the right direction.

Thanks

Later edit: I've just copied the required components in my project and included them and it works.

1
Just curious, why don't "new to PHP" first learn how to program before trying to dive into a monsters such as Zend Framework? - zerkms
"New to php" is not new to programming. Being "new to php" means I have a problem with configuring stuff rather than actually programming. - morsanu
@morsanu: then as a solid developer you should know, that until you get yourself that you need to use a tool - you don't need in it. So until you required to use Zend_Loader - forget about it. Btw: as a solid developer you could start with reading documentation!! ;-) framework.zend.com/manual/en/zend.loader.html - zerkms
Maybe, on SO, you should be more helpful and less ironic. :) - morsanu
@morsanu: I am ;-) In questions that can be answered ;-) - zerkms

1 Answers

1
votes

I ended up copying the Zend folder with the components I needed into a folder called Library and this is the way I instantiate the Autoloader, for example.

/* Define site root */
defined('DOCUMENT_ROOT') ? null : define('DOCUMENT_ROOT',realpath(dirname(__FILE__)));
defined('SITE_ROOT') ? null : define('SITE_ROOT',realpath(dirname(DOCUMENT_ROOT).'\mysite'));


$includePath[] = DOCUMENT_ROOT.'.';
$includePath[] = SITE_ROOT . '\Library';
$includePath[] = get_include_path();
$includePath = implode(PATH_SEPARATOR,$includePath);
set_include_path($includePath);

//Including Zend LoaderClass
require_once('Library/Zend/Loader/Autoloader.php');

//Loading the auto loader file.( Including the autoloader.php file)
$autoloader = Zend_Loader_Autoloader::getInstance();