0

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.

6
  • 2
    Just curious, why don't "new to PHP" first learn how to program before trying to dive into a monsters such as Zend Framework? Commented Dec 28, 2010 at 2:46
  • "New to php" is not new to programming. Being "new to php" means I have a problem with configuring stuff rather than actually programming. Commented Dec 28, 2010 at 7:30
  • 2
    @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 Commented Dec 28, 2010 at 8:03
  • Maybe, on SO, you should be more helpful and less ironic. :) Commented Dec 28, 2010 at 8:43
  • @morsanu: I am ;-) In questions that can be answered ;-) Commented Dec 28, 2010 at 12:51

1 Answer 1

1

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();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.