Re: Difficulty using PEAR library Date_calc

2006-06-06 Thread nate

If the library is using require_once to load a file, it shouldn't
matter how many times it gets loaded, since PHP won't actually load it
more than once.

This may seem a little obvious, but did you look to see what file is
getting loaded on line 88, that's actually causing the error?  It's
possible that one of the Pear classes in conflicting with a Cake core
class.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Difficulty using PEAR library Date_calc

2006-06-06 Thread pat

hi Nate,
Yes, I did have a look.

The structure of of this PEAR library is like this:

Date\Date.php
Date\Date\Span.php
Date\Date\Calc.php
Date\Date\Human.php
Date\Date\Timezone.php

Date.php is the high level library.
The other libraries are the implementations.

The problem is that Date.php does a require_once on Span.php and other
files,
and each files (Span, Calc,Human,Timezone) does require_once on
Date.php
like this:  require_once 'Date.php'; 

It is on this line:  require_once 'Date.php';  that gives error.

I agree with what you are saying, but it appears PHP does not realise
they are the same file. How does the vendor() statement translate to an
require() statement?

Pat.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Difficulty using PEAR library Date_calc

2006-06-06 Thread John Zimmerman [gmail]
I was under the assumption (and looking at my PEAR installation I think I might be right) that Date.php should not be inside the 'Date' directory.On my installation it is outside (i.e. 'PEAR/Date.php' instead of 'PEAR/Date/Date.php')
Also, with the PEAR libraries I had mixed results when trying to vendor/include/require in the controller, but I did not persue it too far. I just put my require_once statements in bootstrap.php and everything worked just fine.
I did a quick grep on the cake directory and I did not see a Date class which is what it is complaining about being re-declared, so it is likely that by trying to vendor/require the pear library in the controller where you are it is trying to declare the class multiple times. I can't say this for sure though.
But try it in the bootstrap.php file (using require_once) and see if that works for you.On 6/6/06, nate 
[EMAIL PROTECTED] wrote:If the library is using require_once to load a file, it shouldn't
matter how many times it gets loaded, since PHP won't actually load itmore than once.This may seem a little obvious, but did you look to see what file isgetting loaded on line 88, that's actually causing the error?It's
possible that one of the Pear classes in conflicting with a Cake coreclass.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Difficulty using PEAR library Date_calc

2006-06-06 Thread pat

Hi John,
Your suggestion worked!

I think you are spot-on about mixing vendor/require.

Many thanks, I had given up getting that working.

Perhaps this is something for Wiki or the tutorial?

thanks Nate also!

Pat.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---