I have a Symfony framework installed in /symfony on my web sever. I also have zenphoto installed in /zenphoto at the same level. Zenphoto is up and running and I've added albums and images. Now I'm trying to make calls from Symphony to access the db. I'm starting with getting the path to the library to work with the following:
require_once($_SERVER['DOCUMENT_ROOT'] . "/zenphoto/zp-core/template-functions.php");
When I just include that line in one of my controllers, I get the error:
The requested URL /symfony/web/zp-core/setup/index.php was not found on this server.
The invocation of the controller goes through:
http://amcolan.loc/symfony/web/app_dev.phpIs there a way around this problem?
Comments
http://www.zenphoto.org/news/zenphotos-object-model-framework
It is neither meant nor tested to be called within other frameworks. The recommended way to accesss ZP functionality outside of Zenphoto is this:
http://www.zenphoto.org/news/integration-with-existing-sites-and-other-cms#zenphoto-as-a-plugin
define('SERVERPATH',$_SERVER['DOCUMENT_ROOT'] . "/zenphoto");
define('WEBPATH','/zenphoto');
require_once(SERVERPATH.'/zp-core/template-functions.php');
Unfortunately my first call failed on this line of code:
$gallery = new Gallery();
This is the error:
[17-Oct-2013 10:50:11 America/Los_Angeles] PHP Warning: Invalid argument supplied for foreach() in /Volumes/Data/htdocs/AmColAn/zenphoto/zp-core/functions-basic.php on line 231
[17-Oct-2013 10:50:11 America/Los_Angeles] PHP Fatal error: Class 'Zetcho\AmColAnBundle\Controller\Gallery' not found in /Volumes/Data/htdocs/AmColAn/symfony/src/Zetcho/AmColAnBundle/Controller/SurnameController.php on line 112
Here's the code from functions-basic.php starting at line 231:
foreach ($_zp_cachefileSuffix as $key => $type) {
if ($type) {
$_zp_supported_images[] = strtolower($key);
}
}
It looks like zenphoto is not going to work inside of a symfony framework.
Does anything speak against using directly what Zenphoto provides? Otherwise you might need to create a kind of bridge to setup the contextes.
If it is just latest images or the like outside you could try to use the rss feeds.
Thanks for all your help on this issue.