0

Zend Quick Start

public/index.php

set_include_path(implode(PATH_SEPARATOR, array(
    dirname(dirname(__FILE__)) . '/library',
    get_include_path(),
)));

configs/application.ini

includePaths.library = APPLICATION_PATH "/../library"

As a result

print get_include_path();
// prints %localpath%/application/../library:%localpath%/library

if drop "includePaths.library" from ini, ./zf (Zend_Tool) fails. If drop in index.php, bootstraping fails.

How to correctly prevent this duplicate?

Dmitry
  • 1
  • 5
  • Where are you putting the `print get_include_path()` to test this? Do you have the include path set anywhere else (perhaps php.ini?) – Tim Fountain Aug 20 '13 at 09:13
  • IndexController::indexAction(), for example. No other include path manipulations – Dmitry Aug 20 '13 at 09:19
  • I understand that i can simplue hardcode includePath in bootstrap via set_include_path without saving old includepath components, but why need options "includePaths" in ini if it can't be used correctly – Dmitry Aug 20 '13 at 09:22

1 Answers1

0

I think you're right that the include path shouldn't be in application.ini as well, so I'd remove that. Then to get Zend Tool working, I think you have two options:

  1. Change your setup to be like the top answer in this question: Zend tool include path (which will help ZF find the include path). ZF's auto discovery was changed somewhere along the way though so I'm not sure if this approach will still work.

  2. Alternatively there is an environment variable you can set to give Zend Tool the library location, details here: http://framework.zend.com/manual/1.12/en/zend.tool.framework.clitool.html (see the section titled "Other Setup Considerations").

Personally I would just skip Zend Tool - I don't think it really makes things easier.

Community
  • 1
  • 1
Tim Fountain
  • 33,093
  • 5
  • 41
  • 69