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?
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:
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.
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.