Page 1 of 1

Integrating another php application

Posted: Sat Jan 22, 2005 11:31 am
by psy
Not sure where the problem lies but I have an application called PHP Catalog that I want to include in my CMSMS website. I have created a Smarty plugin (ala your instructions about integrating Singapore) which is included in the relevant page. However when I browse to the page I get the following error:


{nocache:91b51115fbe63d7d98b1ec4b05b5f212#0}

{/nocache:91b51115fbe63d7d98b1ec4b05b5f212#0}



{nocache:91b51115fbe63d7d98b1ec4b05b5f212#1}
Warning: dbi_conn(/class/class.DBI_mysql.inc): failed to open stream: No such file or directory in /home/xxx/public_html/xxx/xxx/catalogue/include/stdlib.inc on line 192

Fatal error: dbi_conn(): Failed opening required '/class/class.DBI_mysql.inc' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxx/public_html/xxx/xxx/catalogue/include/stdlib.inc on line 192

From what I can gather, either CMSMS or Smarty is failing to recognise an object called $CFG. The code is:

Code: Select all

 
       /* define a generic object */
        class object {};

        /* setup the configuration object */
        $CFG = new object;
which all seems OK. If I call the page directly from a browser it works fine. $CFG is used throughout the application.

Any ideas on how I can fix it?

Thanks in advance
Psy

Integrating another php application

Posted: Sat Jan 22, 2005 1:34 pm
by Ted
Chances are that PHP catalog isn't including files with absolute paths and it's getting confused. Somewhere in there, it's probably doing a

Code: Select all

include('somefile.php');
where the files are all in the same dir. The best practice in PHP (that I'm aware of), is to use dirname(__FILE__) to get an absolute path of the current file, and then include from there. So, the code would be like:

Code: Select all

include(dirname(__FILE__).'/somefile.php');
That way, there are no chances that it could be looking in the wrong dir for include files.

Hope that helps.

Integrating another php application

Posted: Sat Jan 22, 2005 9:14 pm
by psy
Thanks wishy & Patricia and let you know how it goes.
Regards
psy

Re: Integrating another php application

Posted: Tue Apr 26, 2005 7:53 am
by iNSiPiD
Hi guys,

I have nocache errors all over my site as well and can't work out why. They are wrapping the places where I have made module calls e.g. title, bulletmenu, search, breadcrumbs, news, events etc. I'm guessing that one module is probably screwing everything else up.

If you take a look at http://d81314.i50.quadrahosting.com.au you'll see what I mean. I can paste the template code here if that will help.

All suggesttions welcome.

Re: Integrating another php application

Posted: Tue Apr 26, 2005 1:41 pm
by Ted
Is the cache cleared?  Does the web server have write access to tmp/cache?

Re: Integrating another php application

Posted: Tue Apr 26, 2005 11:40 pm
by iNSiPiD
Yeah, I flushed the cache first up to see if that was the problem. No good. All the appropriate directories and files are writeable. This was a clean installation.

The page stops rendering after:

Coming Events
{nocache:e6c9de4275d4a2731dbed600606f2fc2#10}Unknown display type!

- which is the Calendar module call.

The code I had was:

{cms_module module="Calendar" display="Calendar" category="" year="2005" session="true"}

I've since cleaned up the quotes etcetera and removed empty "" from some paramaters and all is well.

Now I just have two superb update requests for this module. So, Rob, if you're listening: :)

1. The ability to have the clicked events appear in a page for which you can set the template. Using the same template as the current page is not desirable.
2. A sample style sheet to hack.

Otherwise, it's terrific. Like all the other addons for the world's fastest growing CMS! :D

NB: I'll also email my requests to Rob.