Re: [Catalyst] not working URLS

2008-03-14 Thread Zbigniew Lukasiak
Check the new Catalyst wiki: http://catwiki.toeat.com/.   It'll become
the official one soon.

--
Zbigniew

On Thu, Mar 13, 2008 at 6:37 AM, Octavian Rasnita [EMAIL PROTECTED] wrote:
 Hi,

  On the page
  http://dev.catalystframework.org/wiki/Faq_ref#sc.1

  In the section Best practices there is a link to:
  http://home.ngmedia.net/chansen/catalyst/conf/

  that doesn't seem to display anything related to Catalyst.
  If somebody know if I could find the content of that page somewhere, please
  let me know.

  That page should contain set of web server configurations that you can
  build your environment from.
  (samples for Apache 1.3, 2.0, and lighttpd utilizing mod_perl, speedycgi,
  fastcgi, and standard cgi)

  Thanks.

  Octavian


  ___
  List: Catalyst@lists.scsys.co.uk
  Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
  Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
  Dev site: http://dev.catalyst.perl.org/




-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] [again] die() in an action chain : does not break the chain !

2008-03-14 Thread Charlie Garrison

Good evening,

On 14/3/08 at 8:54 AM +0100, Dami Laurent (PJ) 
[EMAIL PROTECTED] wrote:



Sorry, I already asked the same question a couple of days ago, but
probably I was not clear enough.
My problem is that if there is an exception at the entry point of an
action chain, processing nevertheless continues until the endpoint of
the chain.



I thought Jonas gave a pretty good answer:


On 11/3/08 at 5:03 PM -, Jonas Alves [EMAIL PROTECTED] wrote:


Probably you need to catch it and call detach.


I even made a note about his answer since it's something I had 
wondered about. And it's such an easy/obvious solution.


Of course you may be asking something else. But it looks like a 
'detach' added to your actions would do the trick.


Charlie

--
   Charlie Garrison  [EMAIL PROTECTED]
   PO Box 141, Windsor, NSW 2756, Australia

O ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: problem on $c-res-body(*STDOUT);

2008-03-14 Thread Fayland Lam

Matt Lawrence wrote:

Fayland Lam wrote:

sub test_body : Local {
   my ($self, $c) = @_;

   $c-res-body(*STDOUT);
   print a\n;
   print b\n;
}



Have you tried passing the glob as a reference?

$c-res-body(\*STDOUT);

It looks like that's at least part of your problem. I suspect that using 
filehandles in this way is not going to work as you expect and may have 
engine-specific problems, have you considered using $c-res-write as a 
substitute for print?





mainly I want to use Benchmark in Catalyst Controller. so I guess I 
can't use res-write in this case.


BTW, Thanks very much. \* is working perfect!




Matt

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/




--
Fayland Lam // http://www.fayland.org/
Foorum based on Catalyst // http://www.foorumbbs.com/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Session expiry per user

2008-03-14 Thread Matt Lawrence

Alexandre Jousset wrote:

Hello list,

I've problems to set session expiry time per user.

My goal is to have a default expiry time of until you quit the 
browser unless the user logs in and select a checkbox to have the 
site remember her (i.e. set expiry time to 1 year).


I use the following plugins for session management :

Session Session::State::Cookie Session::Store::DBI

I've looked at the docs and I've only found a way to set expiry 
time in MyApp.pm, and even with this I don't know how to set it for 
until you quit the brower. If I put 0 the session expires immediately.


To set the longer expiry time, I try:

$c-config-{session}{expires} = 31536000 if 
$c-req-param('remember_me');


I think that will make the cookie expire on the 1st January 1971. Try 
+31536000.


I have a feeling that an undef expiry will result in a session cookie, 
based on nothing more than guesswork and superstition.



Matt


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Catalyst best practices - exceptions

2008-03-14 Thread Ian Sillitoe
I'm curious about catalyst best practices regarding exceptions. FWIW I found
the following links outline a neat way of handling Exceptions (i.e. tying
additional functionality to typical HTTP headers) and I'm currently using
this model (not Model) in my application.

http://bricas.vox.com/library/post/catalyst-exceptionclass.html
http://bricas.vox.com/library/post/catalyst-exceptionclass-detach.html

I can't seem to find an enormous amount of discussion on the topic - I
wondered if anyone had any strong opinions on the matter? this method in
particular? whether this article should be slurped into an entry on the new
wiki?

Cheers,

Ian
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Session expiry per user

2008-03-14 Thread Alexandre Jousset

Hello Matt,

Matt Lawrence a écrit :

To set the longer expiry time, I try:



I think that will make the cookie expire on the 1st January 1971. Try 
+31536000.


	Looking at the sessions table, the value is correct, with or without 
the '+'. The problem seems to come from the line :


 $c-config-{session}{expires} = 31536000 if
 $c-req-param('remember_me');

	that works only once. When I request another page on the site, the 
param 'remember_me' is not set so the sessions falls back to 1 hour (tha 
value I've put by default).


I have a feeling that an undef expiry will result in a session cookie, 
based on nothing more than guesswork and superstition.


Halas, 'undef' is like '0', the session expires immediately :-(

Regards,
--
--  \^/--
---/ O \-----
--   | |/ \|  Alexandre (Midnite) Jousset  |   --
---|___|-----

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] problem on $c-res-body(*STDOUT);

2008-03-14 Thread Andy Grundman


On Mar 14, 2008, at 5:57 AM, Matt Lawrence wrote:


Fayland Lam wrote:

sub test_body : Local {
  my ($self, $c) = @_;

  $c-res-body(*STDOUT);
  print a\n;
  print b\n;
}



Have you tried passing the glob as a reference?

$c-res-body(\*STDOUT);

It looks like that's at least part of your problem. I suspect that  
using filehandles in this way is not going to work as you expect and  
may have engine-specific problems, have you considered using $c-res- 
write as a substitute for print?


Yeah, don't do that, you should use $c-res-write(a\n); etc.




___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Session expiry per user

2008-03-14 Thread Matt Lawrence

Alexandre Jousset wrote:

Hello Matt,

Matt Lawrence a écrit :

To set the longer expiry time, I try:



I think that will make the cookie expire on the 1st January 1971. Try 
+31536000.


Looking at the sessions table, the value is correct, with or 
without the '+'. The problem seems to come from the line :


 $c-config-{session}{expires} = 31536000 if
 $c-req-param('remember_me');

that works only once. When I request another page on the site, the 
param 'remember_me' is not set so the sessions falls back to 1 hour 
(tha value I've put by default).


Ah, I missed the fact that you were accessing the cookies via a session 
plugin, I thought you were setting them directly.


Would it be horribly perverse to store the expiry interval time (or the 
remember_me bool) in the session?


$c-config-{session}{expires} = 31536000 if $c-session-{remember_me};

I have a feeling that an undef expiry will result in a session 
cookie, based on nothing more than guesswork and superstition.

Catatlyst::Plugin::Session::State::Cookie says:

  cookie_expires
  Number of seconds from now you want to elapse before cookie will
  expire.  Set to 0 to create a session cookie, ie one which 
will die

  when the user’s browser is shut down.


Matt

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Session expiry per user

2008-03-14 Thread Bill Moseley
On Fri, Mar 14, 2008 at 12:33:19PM +0100, Alexandre Jousset wrote:
   Hello list,
 
   I've problems to set session expiry time per user.
 
   My goal is to have a default expiry time of until you quit the 
 browser unless the user logs in and select a checkbox to have the site 
 remember her (i.e. set expiry time to 1 year).

There's a plugin that is designed for that:

http://search.cpan.org/~nuffin/Catalyst-Plugin-Session-DynamicExpiry-0.02/lib/Catalyst/Plugin/Session/DynamicExpiry.pm

I'm not using it, but I looked at it in detail one day and had some
problems.  I think I posted a patch.  Yes, December 5th with the
subject Patch for Catalyst::Plugin::Session::DynamicExpiry

 $c-config-{session}{expires} = 31536000 if $c-req-param('remember_me');

That's per process.

-- 
Bill Moseley
[EMAIL PROTECTED]


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Session expiry per user

2008-03-14 Thread Moritz Onken


Am 14.03.2008 um 13:53 schrieb Bill Moseley:


Catalyst::Plugin::Session::DynamicExpiry


isn't working for me using cookies. The patch was never applied so I  
go with this:


sub auto : Private {
my ( $self, $c ) = @_;
if ( $c-user_exists ) {
$c-config-{session}-{expires} = 
$c-session-{per_user_expiry}
  || $c-config-{session}-{expires};
$c-session_expires(1);
return 1;
}
}

set $c-session-{per_user_expiry} if you want a different expiry.
$c-session_expires(1) does all the stuff like setting cookies etc.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] [again] die() in an action chain : does not break the chain !

2008-03-14 Thread Ashley

I've been threatening for more than a year to write a plugin to do this.
I wrote to ask for CPAN/method name suggestions, Aristotle gave me  
good advice

which I'll have to dig up.

If you want to do it yourself you would just put a new method which dies
and detaches. Then in your examples below you'd call
$c-error_out() (I think this is my original stupid name which Aristotle
tried to save us all from) and it would throw your exception (or perhaps
something out of $c-errors) and $c-detach(end)... maybe. It's been
a year since I looked at it though I think it's a good idea.

-Ashley

On Mar 14, 2008, at 12:54 AM, Dami Laurent (PJ) wrote:


Hello list,

Sorry, I already asked the same question a couple of days ago, but
probably I was not clear enough.

My problem is that if there is an exception at the entry point of an
action chain, processing nevertheless continues until the endpoint of
the chain.

Consider for example the following action chain :

   sub one : Chained(/) :PathPart(one) :CaptureArgs(0) {
 my ($self, $c) = @_;
 $c-{stash}{msg} = start_work;
 die die in one;
   }

   sub two : Chained(one) :PathPart(two) :CaptureArgs(0) {
 my ($self, $c) = @_;
 $c-{stash}{msg} .= , . $self-expensive_work($c);
 die die in two;
   }

   sub three : Chained(two) :PathPart(three) :Args(0) {
 my ($self, $c) = @_;
 $c-{stash}{msg} .= , . $self-expensive_work($c) .  again;
 die die in three;
 $c-response-body($c-stash-{msg});
   }

   sub expensive_work {
 my ($self, $c) = @_;
 return this took me a long time;
   }

and the following finalize_error function :

sub finalize_error {
  my ($c) = @_;
  my $body = got errors :  . join (\n, @{$c-error})
   . \nand message was :\n . $c-stash-{msg};
  $c-response-body($body);
}

This yields

  got errors : Caught exception in
Cata_exceptions::Controller::Root-one die in one at
D:/Temp/Cata_exceptions/scripts/../lib/Cata_exceptions/Controller/ 
Root.p

m line 22.
  Caught exception in Cata_exceptions::Controller::Root-two die  
in two

at
D:/Temp/Cata_exceptions/scripts/../lib/Cata_exceptions/Controller/ 
Root.p

m line 28.
  Caught exception in Cata_exceptions::Controller::Root-three die in
three at
D:/Temp/Cata_exceptions/scripts/../lib/Cata_exceptions/Controller/ 
Root.p

m line 35.
  and message was :
  start_work, this took me a long time, this took me a long time again


Now the question is : how to avoid calling expensive_work() ? Is  
there a

way to tune up the chaining mechanism so that it would automatically
detach() at the first exception ?

Thanks in advance, Laurent Dami

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/ 
catalyst@lists.scsys.co.uk/

Dev site: http://dev.catalyst.perl.org/



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst best practices - exceptions

2008-03-14 Thread Ashley

On Mar 14, 2008, at 5:09 AM, Ian Sillitoe wrote:
I'm curious about catalyst best practices regarding exceptions.  
FWIW I found the following links outline a neat way of handling  
Exceptions (i.e. tying additional functionality to typical HTTP  
headers) and I'm currently using this model (not Model) in my  
application.


http://bricas.vox.com/library/post/catalyst-exceptionclass.html
http://bricas.vox.com/library/post/catalyst-exceptionclass-detach.html

I can't seem to find an enormous amount of discussion on the topic  
- I wondered if anyone had any strong opinions on the matter? this  
method in particular? whether this article should be slurped into  
an entry on the new wiki?



It looks pretty nice. It's doing a lot of things that Catalyst  
already does; setting status, throwing exceptions. Since Cat catches  
all your exceptions and you have to deal with stuff in the end()  
anyway, my version does all the error checking and such then and I  
throw my exceptions with: die RC_401: blah, blah, blah. The end()  
error catcher looks for the RC_[status_code] and uses HTTP::Status to  
return the name.


I posted a snippet of it to the list almost 2 years ago, I think, but  
those messages don't seem to be in the archive. Someone also has a  
plugin to do some of this; the name escapes me.


I print the error stack (I have two versions, one regular errors, one  
that shows the guts of StackTrace) with the status message if the app  
is running under debug so that users just see 404 Not found: /asdf/ 
asf/asdf and developers see the works. Since there can be many  
errors thrown (as Laurent Dami is asking in another thread), normal  
users just get the first error thrown out of $c-errors. Developers  
get the whole mess in case it matters.


-Ashley


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Session expiry per user

2008-03-14 Thread Alexandre Jousset

Hello Bill,

Bill Moseley a écrit :
	My goal is to have a default expiry time of until you quit the 
browser unless the user logs in and select a checkbox to have the site 
remember her (i.e. set expiry time to 1 year).


There's a plugin that is designed for that:

http://search.cpan.org/~nuffin/Catalyst-Plugin-Session-DynamicExpiry-0.02/lib/Catalyst/Plugin/Session/DynamicExpiry.pm

I'm not using it, but I looked at it in detail one day and had some
problems.  I think I posted a patch.  Yes, December 5th with the
subject Patch for Catalyst::Plugin::Session::DynamicExpiry


	You posted a patch against a version 0.03. On CPAN the version is 0.02. 
I googled to find the SVN but with no luck. Can you tell me where it is 
please?


	I've also found a Catalyst::Plugin::Session::DynamicExpiry::Cookie (not 
on CPAN) that does the job.


	I've spent a lot of time on it because Firefox *keeps session cookies* 
when you close all tabs and ask it to restore session on 
reopen.. Maybe it's FF that does this, maybe it's an extension, 
I don't know. The fact is that I've had to close the FF tab before the 
FF window in order to dismiss the cookie...


	I still have problems with the cookie TTL and the session TTL. With the 
module cited above, it does not seem to take into account my setting:


$c-session_time_to_live(31536000) if $c-req-param('rme');

	and instead use the default session TTL (2 hours, I see that in my 
`sessions` table).


	Maybe I'm mixing wrongly session TTL and cookie TTL but I thought 
$c-session_time_to_live(x) refered to session, not cookie. However it 
seems to refer to cookie.


	Anyway, with setting session TTL to 1 year, it now works as I want 
(maybe not as it should?).


Thanks a lot to you all!

PS : After some thinking I believe I start to understant it all ;-) but 
it's very confusing...

--
--  \^/--
---/ O \-----
--   | |/ \|  Alexandre (Midnite) Jousset  |   --
---|___|-----

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst best practices - exceptions

2008-03-14 Thread Ian Sillitoe
Thanks Ashley - that all sounds very sensible. I couldn't find your entry in
the mailing list either - but I guess the code  snippet you mention isn't a
million miles away from the Delivering a Custom Error Page entry on
Catalyst::Cookbook?

And I guess you're right - throwing exceptions as objects, while neat in
concept, isn't necessarily adding a huge amount of new functionality. And it
is more typing :P

Cheers,

Ian


On Fri, Mar 14, 2008 at 3:22 PM, Ashley [EMAIL PROTECTED] wrote:



 On Mar 14, 2008, at 5:09 AM, Ian Sillitoe wrote:
  I'm curious about catalyst best practices regarding exceptions.
  FWIW I found the following links outline a neat way of handling
  Exceptions (i.e. tying additional functionality to typical HTTP
  headers) and I'm currently using this model (not Model) in my
  application.
 
  http://bricas.vox.com/library/post/catalyst-exceptionclass.html
  http://bricas.vox.com/library/post/catalyst-exceptionclass-detach.html
 
  I can't seem to find an enormous amount of discussion on the topic
  - I wondered if anyone had any strong opinions on the matter? this
  method in particular? whether this article should be slurped into
  an entry on the new wiki?


 It looks pretty nice. It's doing a lot of things that Catalyst
 already does; setting status, throwing exceptions. Since Cat catches
 all your exceptions and you have to deal with stuff in the end()
 anyway, my version does all the error checking and such then and I
 throw my exceptions with: die RC_401: blah, blah, blah. The end()
 error catcher looks for the RC_[status_code] and uses HTTP::Status to
 return the name.

 I posted a snippet of it to the list almost 2 years ago, I think, but
 those messages don't seem to be in the archive. Someone also has a
 plugin to do some of this; the name escapes me.

 I print the error stack (I have two versions, one regular errors, one
 that shows the guts of StackTrace) with the status message if the app
 is running under debug so that users just see 404 Not found: /asdf/
 asf/asdf and developers see the works. Since there can be many
 errors thrown (as Laurent Dami is asking in another thread), normal
 users just get the first error thrown out of $c-errors. Developers
 get the whole mess in case it matters.

 -Ashley


 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive:
http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] DBIx::Class model for Form::Processor

2008-03-14 Thread Bill Moseley
On Thu, Mar 13, 2008 at 02:53:51PM -0400, Gerda Shank wrote:
 If anybody is interested in trying my DBIx::Class model for 
 Form::Processor let me know.
 
 I'm working on tests and packaging it for CPAN now.

Hi Gerda,

Thanks very much for working on this.

I see that the module is on CPAN, now:

http://search.cpan.org/~gshank/Form-Processor-Model-DBIC-0.01/lib/Form/Processor/Model/DBIC.pm






-- 
Bill Moseley
[EMAIL PROTECTED]


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Catalyst and Shibboleth authentication

2008-03-14 Thread Kirby Krueger

Greetings,

I'm writing a new web application, and have decided to jump into  
Catalyst (because I am smart.)


One thing that Catalyst seems to do well is have a good mechanism for  
plugging in standard approaches to things.  Here at the University of  
Washington, we use a project called 'Shibboleth' for authentication: http://shibboleth.internet2.edu/


Has anyone worked with this in conjunction with Catalyst yet?  I  
didn't see anything in Authentication::Credential::* yet, and it seems  
like that would be where it would go.


If not, I suppose I'll have to write it, and this seems like an  
obvious candidate to give back.  (One plus of working for a  
University, they really don't mind the whole Open Source thing!)  Any  
tips beyond 'read a few other Authentication::Credential modules and  
stick to the same standards' would be appreciated.  (But I'm still  
hoping someone else already has done it and just didn't think anyone  
else would care.)


Thanks in advance,

Kirby

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: [again] die() in an action chain : does not break the chain !

2008-03-14 Thread Aristotle Pagaltzis
Hi Ashley,

* Ashley [EMAIL PROTECTED] [2008-03-14 16:40]:
 I've been threatening for more than a year to write a plugin to
 do this. I wrote to ask for CPAN/method name suggestions,
 Aristotle gave me good advice which I'll have to dig up.

you mean this:

* Aristotle Pagaltzis [EMAIL PROTECTED] [2007-07-17 00:25]:
 I’d rather call it FatalErrorThrow and the method would be
 `fatal_error`, I think.

Bit less than a year, it turns out. :-)

Regards,
-- 
Aristotle Pagaltzis // http://plasmasturm.org/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: [again] die() in an action chain : does not break the chain !

2008-03-14 Thread Ashley

On Mar 14, 2008, at 1:36 PM, Aristotle Pagaltzis wrote:

Hi Ashley,

* Ashley [EMAIL PROTECTED] [2008-03-14 16:40]:

I've been threatening for more than a year to write a plugin to
do this. I wrote to ask for CPAN/method name suggestions,
Aristotle gave me good advice which I'll have to dig up.


you mean this:


* Aristotle Pagaltzis [EMAIL PROTECTED] [2007-07-17 00:25]:

I’d rather call it FatalErrorThrow and the method would be
`fatal_error`, I think.


Bit less than a year, it turns out. :-)


Ah, but I didn't say who I was threatening or when the threats
began or if the restraining order might still be in force.




___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Why use external FastCGI apps?

2008-03-14 Thread Tomas Doran


On 10 Mar 2008, at 14:47, Matt Pitts wrote:


-Original Message-
From: Matt S Trout [mailto:[EMAIL PROTECTED]

Neat approach.


Thanks again for all the input.


Any chance you could repay in kind by writing up what you ended up

with

on the wiki?

Using PAR + external fcgi this way is an interesting deployment  
option

and
I think people would be interested in the process - if nothing else

the

work you did to get your PAR built would be worth showing off.


I'm honored by the invitation and I got my boss to OK it. So where
should it exist in the Wiki and what should it be called? PAR
Deployments w/ Apache and FastCGI?



The wiki (and where I'd put your page) is here:

http://catwiki.toeat.com/gettingstarted/tutorialsandhowtos

The wiki uses a standard wiki syntax for links, and Markdown as the  
'markup' language..


Cheers
Tom


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: [again] die() in an action chain : does not break the chain !

2008-03-14 Thread Ashley

On Mar 14, 2008, at 1:36 PM, Aristotle Pagaltzis wrote:

* Ashley [EMAIL PROTECTED] [2008-03-14 16:40]:

I've been threatening for more than a year to write a plugin to
do this. I wrote to ask for CPAN/method name suggestions,
Aristotle gave me good advice which I'll have to dig up.


you mean this:


* Aristotle Pagaltzis [EMAIL PROTECTED] [2007-07-17 00:25]:

I’d rather call it FatalErrorThrow and the method would be
`fatal_error`, I think.




While we're on the topic. How abhorrent/stupid is this?
   $c-die();
   # or
   $c-die(Dying is easy, comedy is hard);

I'd really like something like this. I could go for $c-fatal() too.
fatal_error() is nice and descriptive but I lean toward something
shorter if it can be agreed upon.

It should convey, /somehow/, that it's circumventing further processing
excepting the end. die feels intuitive and is super easy to type but
it seems too loaded. Please give me insight, sanction, corrections,
spankings, declarations regarding how I'll never work in this town
again et cetera and so forth.

The code below is *barely* tested.

package Catalyst::Plugin::Die;
use strict;
use warnings;

BEGIN {
no strict vars;
push(@ISA, $Catalyst::Exception::CATALYST_EXCEPTION_CLASS ||  
'Catalyst::Exception::Base');

}

sub die : method {
my $self = shift;
my %params = @_ == 1 ? ( error = $_[0] ) : @_;
my $message = $params{message} || $params{error} || $! ||  
Catalyst::Plugin::Die-die called;


eval { $self-throw($message) };

$self-error($@ || Unknown error in Catalyst::Plugin::Die-die);

$self-NEXT::die(@_);
$self-detach;  # $self-detach(end) ???
}

1;
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/