Re: [fw-general] Problems with Zend_Date creating Date objects from Zend_Mail IMAP messages

2007-11-13 Thread Thomas Weidner
Define the input format if you are not using the standard locale format as 
inputstring.


$zd = new Zend_Date($message-date, Zend_Date::RFC_822);

Greetings
Thomas

- Original Message - 
From: Taylor Andrew [EMAIL PROTECTED]

To: fw-general@lists.zend.com
Sent: Tuesday, November 13, 2007 12:09 PM
Subject: [fw-general] Problems with Zend_Date creating Date objects from 
Zend_Mail IMAP messages




Hi,

I'm trying to parse dates from a Zend_Mail IMAP message. This code seems
to be the most succinct example:

$zd = new Zend_Date($message-date);
echo $message-date.' = '.$zd-toString('-MM-dd HH:mm:ss').'br /';

This simple example outputs the below based on 4 email messages:

4 Nov 2005 11:05:21 - = 2005-04-11 11:05:21
7 Nov 2005 09:41:49 - = 2005-11-07 09:41:49
4 Nov 2005 11:41:56 - = 2005-04-11 11:41:56
7 Nov 2005 09:41:28 - = 2005-11-07 09:41:28

As you can see, to the naked eye it always parses the time element
correctly, the year is also correct, however, on the messages from the
4th of November, it's transposed the month and date elements. This
doesn't occur on the 7th of November. This is a subset of a larger group
of messages, at a quick guess 95% of overall messages are correct. I
could understand it if the initial strings were different (as they can
be with some messages), but, as you can see from the echo of
$message-date in the above examples the formats are matched. Surely
these should all match, or all fail.

Any suggestions as to what's going wrong?

Thanks

Andrew



This email and its attachments are intended for the addressee only and may 
be
confidential or the subject of legal privilege. If this email and its 
attachments have
come to you in error,  you must take no action based on them, nor must you 
copy them,
distribute them or show them to anyone. Please contact the sender to notify 
us of the

error.

Durham City Council accept no liability for, and shall not be legally bound 
by,
the contents of this email. No assurances are given as to the authority of 
the sender
to act on the Council's behalf and the views expressed within this email may 
not be

official Council policy but instead the personal views of the distributor.

This email and any attached files have been scanned for the presence of 
computer viruses
however, you are advised that Durham City Council bears no liability for 
attachments
and you therefore open any attachments at your own risk. 



RE: [fw-general] Problems with Zend_Date creating Date objects from Zend_Mail IMAP messages

2007-11-13 Thread Taylor Andrew

Hi,

I'm not sure that would work, as not all messages that I'm seeing match
the specification. On another note; why would this work for one and not
the other:

 4 Nov 2005 11:05:21 - = 2005-04-11 11:05:21
 7 Nov 2005 09:41:49 - = 2005-11-07 09:41:49

The formats of those strings are identical.

Kind regards

Andrew 

 -Original Message-
 From: Thomas Weidner [mailto:[EMAIL PROTECTED] 
 Sent: 13 November 2007 13:03
 To: Taylor Andrew; fw-general@lists.zend.com
 Subject: Re: [fw-general] Problems with Zend_Date creating 
 Date objects from Zend_Mail IMAP messages
 
 Define the input format if you are not using the standard 
 locale format as inputstring.
 
 $zd = new Zend_Date($message-date, Zend_Date::RFC_822);
 
 Greetings
 Thomas
 
 - Original Message -
 From: Taylor Andrew [EMAIL PROTECTED]
 To: fw-general@lists.zend.com
 Sent: Tuesday, November 13, 2007 12:09 PM
 Subject: [fw-general] Problems with Zend_Date creating Date 
 objects from Zend_Mail IMAP messages
 
 
 
 Hi,
 
 I'm trying to parse dates from a Zend_Mail IMAP message. This 
 code seems to be the most succinct example:
 
 $zd = new Zend_Date($message-date);
 echo $message-date.' = '.$zd-toString('-MM-dd 
 HH:mm:ss').'br /';
 
 This simple example outputs the below based on 4 email messages:
 
 4 Nov 2005 11:05:21 - = 2005-04-11 11:05:21
 7 Nov 2005 09:41:49 - = 2005-11-07 09:41:49
 4 Nov 2005 11:41:56 - = 2005-04-11 11:41:56
 7 Nov 2005 09:41:28 - = 2005-11-07 09:41:28
 
 As you can see, to the naked eye it always parses the time 
 element correctly, the year is also correct, however, on the 
 messages from the 4th of November, it's transposed the month 
 and date elements. This doesn't occur on the 7th of November. 
 This is a subset of a larger group of messages, at a quick 
 guess 95% of overall messages are correct. I could understand 
 it if the initial strings were different (as they can be with 
 some messages), but, as you can see from the echo of 
 $message-date in the above examples the formats are matched. 
 Surely these should all match, or all fail.
 
 Any suggestions as to what's going wrong?
 
 Thanks
 
 Andrew
 
 
 
 This email and its attachments are intended for the addressee 
 only and may be confidential or the subject of legal 
 privilege. If this email and its attachments have come to you 
 in error,  you must take no action based on them, nor must 
 you copy them, distribute them or show them to anyone. Please 
 contact the sender to notify us of the error.
 
 Durham City Council accept no liability for, and shall not be 
 legally bound by, the contents of this email. No assurances 
 are given as to the authority of the sender to act on the 
 Council's behalf and the views expressed within this email 
 may not be official Council policy but instead the personal 
 views of the distributor.
 
 This email and any attached files have been scanned for the 
 presence of computer viruses however, you are advised that 
 Durham City Council bears no liability for attachments and 
 you therefore open any attachments at your own risk. 
 
 

This email and its attachments are intended for the addressee only and may be
confidential or the subject of legal privilege. If this email and its 
attachments have 
come to you in error,  you must take no action based on them, nor must you copy 
them,
distribute them or show them to anyone. Please contact the sender to notify us 
of the
error.  

Durham City Council accept no liability for, and shall not be legally bound by,
the contents of this email. No assurances are given as to the authority of the 
sender
to act on the Council's behalf and the views expressed within this email may 
not be
official Council policy but instead the personal views of the distributor. 

This email and any attached files have been scanned for the presence of 
computer viruses
however, you are advised that Durham City Council bears no liability for 
attachments
and you therefore open any attachments at your own risk.


Re: [fw-general] Problems with Zend_Date creating Date objects from Zend_Mail IMAP messages

2007-11-13 Thread Thomas Weidner

Hy,

it depends on your locale setting.
I don't know what your locale setting is, but if you do not give the input 
format your set locale will be used to determinate the input format.


So I expect that your default date format is something like /MM/dd and 
Zend_Date tries to automatically correct the failure.

If you switch off the fixation you will see where the problem occurs.

As you said that you are using the mail dateformat as input I expect that 
all date values correspond to a given format.


I would propose to use Zend_Date as normal and give the input format if it 
can not be parsed automatically.


Greetings
Thomas


- Original Message - 
From: Taylor Andrew [EMAIL PROTECTED]

To: fw-general@lists.zend.com
Sent: Tuesday, November 13, 2007 2:09 PM
Subject: RE: [fw-general] Problems with Zend_Date creating Date objects from 
Zend_Mail IMAP messages




Hi,

I'm not sure that would work, as not all messages that I'm seeing match
the specification. On another note; why would this work for one and not
the other:


4 Nov 2005 11:05:21 - = 2005-04-11 11:05:21
7 Nov 2005 09:41:49 - = 2005-11-07 09:41:49


The formats of those strings are identical.

Kind regards

Andrew


-Original Message-
From: Thomas Weidner [mailto:[EMAIL PROTECTED]
Sent: 13 November 2007 13:03
To: Taylor Andrew; fw-general@lists.zend.com
Subject: Re: [fw-general] Problems with Zend_Date creating
Date objects from Zend_Mail IMAP messages

Define the input format if you are not using the standard
locale format as inputstring.

$zd = new Zend_Date($message-date, Zend_Date::RFC_822);

Greetings
Thomas

- Original Message -
From: Taylor Andrew [EMAIL PROTECTED]
To: fw-general@lists.zend.com
Sent: Tuesday, November 13, 2007 12:09 PM
Subject: [fw-general] Problems with Zend_Date creating Date
objects from Zend_Mail IMAP messages



Hi,

I'm trying to parse dates from a Zend_Mail IMAP message. This
code seems to be the most succinct example:

$zd = new Zend_Date($message-date);
echo $message-date.' = '.$zd-toString('-MM-dd
HH:mm:ss').'br /';

This simple example outputs the below based on 4 email messages:

4 Nov 2005 11:05:21 - = 2005-04-11 11:05:21
7 Nov 2005 09:41:49 - = 2005-11-07 09:41:49
4 Nov 2005 11:41:56 - = 2005-04-11 11:41:56
7 Nov 2005 09:41:28 - = 2005-11-07 09:41:28

As you can see, to the naked eye it always parses the time
element correctly, the year is also correct, however, on the
messages from the 4th of November, it's transposed the month
and date elements. This doesn't occur on the 7th of November.
This is a subset of a larger group of messages, at a quick
guess 95% of overall messages are correct. I could understand
it if the initial strings were different (as they can be with
some messages), but, as you can see from the echo of
$message-date in the above examples the formats are matched.
Surely these should all match, or all fail.

Any suggestions as to what's going wrong?

Thanks

Andrew



This email and its attachments are intended for the addressee
only and may be confidential or the subject of legal
privilege. If this email and its attachments have come to you
in error,  you must take no action based on them, nor must
you copy them, distribute them or show them to anyone. Please
contact the sender to notify us of the error.

Durham City Council accept no liability for, and shall not be
legally bound by, the contents of this email. No assurances
are given as to the authority of the sender to act on the
Council's behalf and the views expressed within this email
may not be official Council policy but instead the personal
views of the distributor.

This email and any attached files have been scanned for the
presence of computer viruses however, you are advised that
Durham City Council bears no liability for attachments and
you therefore open any attachments at your own risk.




This email and its attachments are intended for the addressee only and may 
be
confidential or the subject of legal privilege. If this email and its 
attachments have
come to you in error,  you must take no action based on them, nor must you 
copy them,
distribute them or show them to anyone. Please contact the sender to notify 
us of the

error.

Durham City Council accept no liability for, and shall not be legally bound 
by,
the contents of this email. No assurances are given as to the authority of 
the sender
to act on the Council's behalf and the views expressed within this email may 
not be

official Council policy but instead the personal views of the distributor.

This email and any attached files have been scanned for the presence of 
computer viruses
however, you are advised that Durham City Council bears no liability for 
attachments
and you therefore open any attachments at your own risk. 



Re: [fw-general] Problems with Zend_Date creating Date objects from Zend_Mail IMAP messages

2007-11-13 Thread Thomas Weidner

Hy Taylor,

Looking into the IMAP specification the date format used for within the 
fields is always RFC2822 which is a child of RFC822.

So all you have to do is setting the input format to Zend_Date::RFC_2822.
See http://tools.ietf.org/html/rfc3501

If you say you are using an IMAP client which is not conform to IMAP your 
only way would be to search the inputformat and fix it...


Example:
if (Zend_Date::isDate($mydate, Zend_Date::RFC_2822)) {
   $date = new Zend_Date($mydate, Zend_Date::RFC_2822);
}else if (Zend_Date::isDate($mydate, Zend_Date::ISO_8601)) {
   $date = new Zend_Date($mydate, Zend_Date::ISO_8601);
} else {
   // no iso or 2822 format... try something different
}

Anyway... Zend_Date is no magican... it is not able to parse all dates 
without knowing what it should do.
As there are about 300 different standard dateformats out in the world and 
even more non standard formats you can imagine that this is almost 
impossible.


Greetings
Thomas
I18N Team Leader


- Original Message - 
From: Taylor Andrew [EMAIL PROTECTED]

To: Thomas Weidner [EMAIL PROTECTED]
Sent: Tuesday, November 13, 2007 3:59 PM
Subject: RE: [fw-general] Problems with Zend_Date creating Date objects from 
Zend_Mail IMAP messages




Hi Thomas,

I understand what you're suggesting but I can't adopt that as not all
IMAP dates conform to the RFC. I'll have to look at another solution,
it's just frustrating that Zend_Date can autoparse one but not the
other:

4 Nov 2005 11:05:21 - = 2005-04-11 11:05:21
7 Nov 2005 09:41:49 - = 2005-11-07 09:41:49

They're obviously the same format.

Andrew

--
Andrew Taylor
Web Site Manager
City of Durham Council
17 Claypath
Durham
Co. Durham
DH1 1RH
Tel:0191 3018769
Fax:0191 3018426
E-Mail: [EMAIL PROTECTED]



-Original Message-
From: Thomas Weidner [mailto:[EMAIL PROTECTED]
Sent: 13 November 2007 13:18
To: Taylor Andrew; fw-general@lists.zend.com
Subject: Re: [fw-general] Problems with Zend_Date creating
Date objects from Zend_Mail IMAP messages

Hy,

it depends on your locale setting.
I don't know what your locale setting is, but if you do not
give the input format your set locale will be used to
determinate the input format.

So I expect that your default date format is something like
/MM/dd and Zend_Date tries to automatically correct the failure.
If you switch off the fixation you will see where the problem occurs.

As you said that you are using the mail dateformat as input I
expect that all date values correspond to a given format.

I would propose to use Zend_Date as normal and give the input
format if it can not be parsed automatically.

Greetings
Thomas


- Original Message -
From: Taylor Andrew [EMAIL PROTECTED]
To: fw-general@lists.zend.com
Sent: Tuesday, November 13, 2007 2:09 PM
Subject: RE: [fw-general] Problems with Zend_Date creating
Date objects from Zend_Mail IMAP messages



Hi,

I'm not sure that would work, as not all messages that I'm
seeing match the specification. On another note; why would
this work for one and not the other:

 4 Nov 2005 11:05:21 - = 2005-04-11 11:05:21
 7 Nov 2005 09:41:49 - = 2005-11-07 09:41:49

The formats of those strings are identical.

Kind regards

Andrew

 -Original Message-
 From: Thomas Weidner [mailto:[EMAIL PROTECTED]
 Sent: 13 November 2007 13:03
 To: Taylor Andrew; fw-general@lists.zend.com
 Subject: Re: [fw-general] Problems with Zend_Date creating Date
 objects from Zend_Mail IMAP messages

 Define the input format if you are not using the standard locale
 format as inputstring.

 $zd = new Zend_Date($message-date, Zend_Date::RFC_822);

 Greetings
 Thomas

 - Original Message -
 From: Taylor Andrew [EMAIL PROTECTED]
 To: fw-general@lists.zend.com
 Sent: Tuesday, November 13, 2007 12:09 PM
 Subject: [fw-general] Problems with Zend_Date creating Date objects
 from Zend_Mail IMAP messages



 Hi,

 I'm trying to parse dates from a Zend_Mail IMAP message. This code
 seems to be the most succinct example:

 $zd = new Zend_Date($message-date);
 echo $message-date.' = '.$zd-toString('-MM-dd HH:mm:ss').'br
 /';

 This simple example outputs the below based on 4 email messages:

 4 Nov 2005 11:05:21 - = 2005-04-11 11:05:21
 7 Nov 2005 09:41:49 - = 2005-11-07 09:41:49
 4 Nov 2005 11:41:56 - = 2005-04-11 11:41:56
 7 Nov 2005 09:41:28 - = 2005-11-07 09:41:28

 As you can see, to the naked eye it always parses the time element
 correctly, the year is also correct, however, on the
messages from the
 4th of November, it's transposed the month and date elements. This
 doesn't occur on the 7th of November.
 This is a subset of a larger group of messages, at a quick
guess 95%
 of overall messages are correct. I could understand it if
the initial
 strings were different (as they can be with some messages), but, as
 you can see from the echo of $message-date in the above
examples the
 formats are matched.
 Surely these should all match, or all fail.

 Any suggestions as 

Re: [fw-general] ZF Jira/FishEye error

2007-11-13 Thread Simone Carletti
Hi Darby,
I confirm it works for me now.

Thanks for the quick fix, Wil.

-- Simone

On Nov 13, 2007 8:03 PM, Darby Felton [EMAIL PROTECTED] wrote:

 Hi Wil,

 Thanks, that seems to have fixed it for me. :) Maybe others can confirm?

 Best regards,
 Darby

 Wil Sinclair wrote:
  I have seen those errors come up sporadically in the JIRA logs. This
  simply indicates that JIRA timed out while waiting for data on the
  fisheye API connection. The timeout was set to 1 sec, so I just bumped
  it up to 10 sec to reduce the frequency this error. Please let me know
  if the fisheye tab comes up slowly after this change, but I doubt it
  would take more than a few seconds in the worst case.
  I suspect the reason why this happens in the first place is that fisheye
  occasionally experiences CPU spikes that slow down all threads in this
  process. I haven't had a chance to hook up a profiler to fisheye yet to
  troubleshoot. I'll do this as soon as I have some time to get to the
  real solution.
 
  ,Wil
 
  -Original Message-
  From: Darby Felton [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, November 13, 2007 7:55 AM
  To: Simone Carletti
  Cc: fw-general@lists.zend.com; Wil Sinclair
  Subject: Re: [fw-general] ZF Jira/FishEye error
 
  Hi Simone,
 
  I confirm the problem from my end. Maybe Wil can help us figure out
  what's happening?
 
  Best regards,
  Darby
 
  Simone Carletti wrote:
  When I try to open FishEye tab for a ticket I get a Java exception.
  See for example
 
  http://framework.zend.com/issues/browse/ZF-507?page=com.cenqua.fisheye.j
  ira:fisheye-tabpanel
  Error communicating with FishEye: java.net.SocketTimeoutException:
  Read
  timed out
 
  Anyone else could confirm the problem?
 



Re: [fw-general] Zend_Form

2007-11-13 Thread Jim Scherer

Matthew,

I played around with your prototype in the lab and I really like it. It was
simple to setup and adds a lot of function to my forms at the same time. Its
also helping me understand how the validators and filters tie in and how to
utilize them. Surely a lot of the credit is due to those that created the
proposals. I know it is just a prototype in the lab, but its exciting none
the less. I look forward to it making it to the incubator and eventually
into the core.

Jim


Matthew Weier O'Phinney-3 wrote:
 
 -- dinok [EMAIL PROTECTED] wrote
 (on Wednesday, 07 November 2007, 12:46 PM -0800):
 Any news concerning this topic?
 Because I want to start a new project and it would be very nice, if I
 could
 use a Zend_Form component =)
 And in the proposal comments didn't anything happen in the last last days
 /
 weeks.
 So what the things are now?
 
 I've built a prototype in the laboratory area:
 
 http://framework.zend.com/svn/laboratory/Zend_Form/
 
 I'm hoping to finish out a few more ideas with it by the end of this
 week, and then issue a consolidated Zend_Form proposal on the wiki.
 
 -- 
 Matthew Weier O'Phinney
 PHP Developer| [EMAIL PROTECTED]
 Zend - The PHP Company   | http://www.zend.com/
 
 

-- 
View this message in context: 
http://www.nabble.com/Zend_Form-tf4719410s16154.html#a13738899
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Log with SMTP

2007-11-13 Thread Matthew Weier O'Phinney
-- Dan Rossi [EMAIL PROTECTED] wrote
(on Wednesday, 14 November 2007, 12:11 PM +1100):
 Hi I generally use PEAR Log for these things but is there an smtp logger 
 driver built yet for Zend_Log or do a i have to implement one myself ?

Currently we do not have one. If you write, please consider contributing
it. :-)

-- 
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/


Re: [fw-general] Zend_Log with SMTP

2007-11-13 Thread Dan Rossi
Alright its fairly easy anyway, im not sure if i have the time to be a  
maintainer for anything though.


On 14/11/2007, at 2:23 PM, Matthew Weier O'Phinney wrote:


-- Dan Rossi [EMAIL PROTECTED] wrote
(on Wednesday, 14 November 2007, 12:11 PM +1100):
Hi I generally use PEAR Log for these things but is there an smtp  
logger
driver built yet for Zend_Log or do a i have to implement one  
myself ?


Currently we do not have one. If you write, please consider  
contributing

it. :-)

--
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/




Re: [fw-general] issues with Zend_Controller_Plugin_ErrorHandler

2007-11-13 Thread Bastian Gerhard

Hey Dan,

That's really not how you're supposed to do it. You should rather set  
your own errorcode in the constructor when throwing the exception.
In my application (namely within a given controller) I throw an  
exception like this:


// [...]
throw new Zend_Controller_Exception(Oops! You're not supposed to be  
here., 100);


Then, in the ErrorController I simply retrieve my errorcode and do  
whatever I want with it. You will note that $errors-exception-code  
is protected and hence not accessible. That's where the  
Exception::getCode() method comes in handy:


$errors = $this-_getParam('error_handler');
switch ($errors-exception-getCode())
{
  case 100:
 echo Access denied.;
 break;
  default:
}

Alternatively you could work with your own constants too. Hope that  
helps.


Cheers
Bastian


On Aug 16, 2007, at 10:17 PM, Dan Rossi wrote:

Thanks matt, ill do the forwards in the caught exception, im not  
sure if Zend_Auth throw exceptions though.



Matthew Weier O'Phinney wrote:

-- Dan Rossi [EMAIL PROTECTED] wrote
(on Thursday, 16 August 2007, 07:33 PM +1000):

Hi trying to bubble an error when throwing something like this as  
Zend_Auth wont do it for u it seems


if (!$auth-hasIdentity())
   {
   throw new Zend_Auth_Adapter_Exception(Not Allowed  
Access);

   }

The return type to the error controller is always  
EXCEPTION_OTHER. Id like it to be a EXCEPTION_AUTH_FAILED code or  
whatever so that i am able to display some custom template for a  
particular code / type.




switch ($exceptionType) {
   case 'Zend_Controller_Dispatcher_Exception':
   $error-type = self::EXCEPTION_NO_CONTROLLER;
   break;
   case 'Zend_Controller_Action_Exception':
   $error-type = self::EXCEPTION_NO_ACTION;
   break;
   default:
   $error-type = self::EXCEPTION_OTHER;
   break;
   }






Bastian Gerhard
Product Manager
__
Ashley Associates Ltd.
Technology Group

Minami-Aoyama First Building 8F
7-8-1 Minami-Aoyama
Minato-ku, Tokyo 107-0062



Re: [fw-general] Zend_Log with SMTP

2007-11-13 Thread Simon Mundy
It is possible to obtain a 'log' (or a transaction record) for each  
SMTP transaction. You need to access the transport object from the  
SMTP using
getConnection() object and you can retrieve it using the getLog()  
method.


Cheers


-- Dan Rossi [EMAIL PROTECTED] wrote
(on Wednesday, 14 November 2007, 12:11 PM +1100):
Hi I generally use PEAR Log for these things but is there an smtp  
logger
driver built yet for Zend_Log or do a i have to implement one  
myself ?


Currently we do not have one. If you write, please consider  
contributing

it. :-)

--
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/


--

Simon Mundy | Director | PEPTOLAB



Please support Movember today!  Visit http://www.movember.com/au/donate
Registration number for Simon 160725

202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654  
4124

http://www.peptolab.com