Re: [Catalyst] Getting Complaint from C::P::Session::Store::FastMmap.pm
Are the two versions for Cache::FastMmap in your old and new site_lib directory different? Jay On 6/2/07, Dennis Daupert [EMAIL PROTECTED] wrote: My app has been running; I decided it's time to package it up. I hadn't been keeping track of all my included modules in Makefile.PL, so I renamed 'site_perl' directory and recreated, so I could do a new install of Catalyst and company. I had Catalyst 5.7006, now 5.7007. C::P::S::S::FastMmap is still at 0.02. App starts up OK, and I can get to a few pages that avoid the login stuff, but everything else gets this error: Can't use string (1180812469) as a SCALAR ref while strict refs in use at /usr/lib/perl5/site_perl/5.8.8/Catalyst/Plugin/Session/Store/FastMmap.pm line 62. Comes from this routine: 60 sub get_session_data { 61 my ( $c, $sid ) = @_; 62 ${ $c-_session_fastmmap_storage-get($sid) || return }; 63 } Help? /dennis ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Plugin HOWTO?
Good morning. I would like to know if there's any HOWTO (or best practice) available on writing Catalyst's plugins. Thanks, Cristina ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Plugin HOWTO?
Hello Cristina! I would like to know if there's any HOWTO (or best practice) available on writing Catalyst's plugins. Try this: http://search.cpan.org/~jrockway/Catalyst-Manual-5.700701/lib/Catalyst/Manual/ExtendingCatalyst.pod Michele. -- Michele Beltrame http://www.varlogarthas.net/ ICQ 76660101 - MSN [EMAIL PROTECTED] Privacy: http://www.italpro.net/em.html ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Plugin HOWTO?
--- Michele Beltrame [EMAIL PROTECTED] wrote: Hello Cristina! I would like to know if there's any HOWTO (or best practice) available on writing Catalyst's plugins. Try this: http://search.cpan.org/~jrockway/Catalyst-Manual-5.700701/lib/Catalyst/Manual/ExtendingCatalyst.pod Michele. Hi, Cristina, perhaps you could share with us the what task it is you are trying to do? If you read the posted link you will see that there are several ways to extend or integrate catalyst with your project depending on your goal or needs. --john __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Re: Getting Complaint from C::P::Session::Store::FastMmap.pm
On Mon, 4 Jun 2007 Jay Buffington inquired: Are the two versions for Cache::FastMmap in your old and new site_lib directory different? Hmmm, that's a possible candidate. (swack! Sound of hand hitting forehead) old site_lib Cache::FastMmap: 1.09 new site_lib Cache::FastMmap: 1.14 I'll look deeper in that direction tonight after work. Big thanks. /dennis ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] deploying a Catalyst app
On 06/01/07 15:00, mla wrote: I've always used cvs/svn for the app. Tagged it for staging/prod and pulled the changes to the appropriate servers. svn++ -- Peter Karman . http://peknet.com/ . [EMAIL PROTECTED] ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] debug mode
What is the best way to deal with the -Debug flag between a production and development environment? Obviously its not desirable to go into the file and remove the flag every time the code goes to prod. I see you can start the stanalone server with -d to force debug. I think I remember about an environment variable to set debug also. Is the preferred method to take the hardcoded flag out and use one of these, or is there another way (such as a config option)? How are people dealing with this? Thanks, John ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
RE: [Catalyst] debug mode
I thought a nice way would be to be able to specify it in the config file; then your _local.yml file could add it for the dev environment. Yet to produce a patch for that though it should be pretty straight forwards. Mark _ From: John Goulah [mailto:[EMAIL PROTECTED] Sent: 04 June 2007 15:32 To: The elegant MVC web framework Subject: [Catalyst] debug mode What is the best way to deal with the -Debug flag between a production and development environment? Obviously its not desirable to go into the file and remove the flag every time the code goes to prod. I see you can start the stanalone server with -d to force debug. I think I remember about an environment variable to set debug also. Is the preferred method to take the hardcoded flag out and use one of these, or is there another way (such as a config option)? How are people dealing with this? Thanks, John ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] debug mode
i use the following in sandbox httpd.conf's: Perl BEGIN { $ENV{MYAPP_DEBUG} = 1; } use MyApp; /Perl and s/1/0/ for prod. What is the best way to deal with the -Debug flag between a production and development environment? Obviously its not desirable to go into the file and remove the flag every time the code goes to prod. I see you can start the stanalone server with -d to force debug. I think I remember about an environment variable to set debug also. Is the preferred method to take the hardcoded flag out and use one of these, or is there another way (such as a config option)? How are people dealing with this? Thanks, John ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] debug mode
John Goulah wrote: What is the best way to deal with the -Debug flag between a production and development environment? Obviously its not desirable to go into the file and remove the flag every time the code goes to prod. I see you can start the stanalone server with -d to force debug. I think I remember about an environment variable to set debug also. Is the preferred method to take the hardcoded flag out and use one of these, or is there another way (such as a config option)? How are people dealing with this? If you start your development server from the command line, set environment variable CATALYST_DEBUG=1, e.g. CATALYST_DEBUG=1 script/myapp_server.pl -- Bernhard Graf ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] debug mode
On Mon, 4 Jun 2007, John Goulah wrote: What is the best way to deal with the -Debug flag between a production and development environment? Obviously its not desirable to go into the file and remove the flag every time the code goes to prod. I see you can start the stanalone server with -d to force debug. I think I remember about an environment variable to set debug also. Is the preferred method to take the hardcoded flag out and use one of these, or is there another way (such as a config option)? How are people dealing with this? I just specify all my plugins and flags in a config module and only include -Debug on non-prod machines, by looking at the hostname. -dave /*=== VegGuide.Orgwww.BookIRead.com Your guide to all that's veg. My book blog ===*/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
RE: [Catalyst] debug mode
I wrote a cheap little plugin for my app to override $c-debug to return the debug flag from $c-config-{debug}. As such: package MyApp::Plugin::DebugMode; sub debug { my $c = shift; return $c-config-{debug} || 0; } 1; Then I just add a debug: 1 line to my DEV/QA/UAT configs and make it debug: 0 for my PROD config. It's been working pretty well for me. Enjoy, Matt Pitts On Mon, 2007-06-04 at 15:51 +0100, mark wrote: I thought a nice way would be to be able to specify it in the config file; then your _local.yml file could add it for the dev environment. Yet to produce a patch for that though it should be pretty straight forwards. Mark __ From: John Goulah [mailto:[EMAIL PROTECTED] Sent: 04 June 2007 15:32 To: The elegant MVC web framework Subject: [Catalyst] debug mode What is the best way to deal with the -Debug flag between a production and development environment? Obviously its not desirable to go into the file and remove the flag every time the code goes to prod. I see you can start the stanalone server with -d to force debug. I think I remember about an environment variable to set debug also. Is the preferred method to take the hardcoded flag out and use one of these, or is there another way (such as a config option)? How are people dealing with this? Thanks, John ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst::Plugin::Session, Facebook, and Custom Session ids
So I've started using the Session::State::URI plugin (with rewrite turned off... I don't need that aspect of it), but have quickly encountered a problem with using an externally created session key with Catalyst::Plugin::Session... it doesn't pass validate_session_id(). The session key I receive from Facebook and attempt to use the the session id is not alphanumeric... e.g. 1254342bc1f2af7558f5979d-728080233 I end up getting the following error: Tried to set invalid session ID '1254342bc1f2af7558f5979d-728080233' at /usr/share/perl5/Catalyst/Plugin/Authentication.pm line 103 Is there any way to disable the validation of session ids? Seems like it would be a somewhat useful option for those cases (like interfacing with Facebook), where the session ids are pre-created. - Jim Yuval Kogman wrote: The code below is essentially Catalyst::Plugin::Session::State::URI with param set to 'token'. On Wed, May 30, 2007 at 23:00:06 -0700, Jay Buffington wrote: I did something like this. With Session::State::Cookie the session id comes out of the cookie. I wanted web service calls using REST to be able to use that same session id, but pass it as a http parameter (called token) rather than in the cookie. With the below code catalyst will first look for the session in in a url param like this: http://myapp.com/foo?token=af3423e342dac987d8e0a0e If there is no token param the NEXT will cause it to fall back to Session::State::Cookie and look for the session id in the cookie. *** in MyApp.pm *** use Catalyst qw/ Session::State::Token Session::State::Cookie /; *** in Catalyst/Plugin/Session/State/Token.pm *** package Catalyst::Plugin::Session::State::Token; use base qw/Catalyst::Plugin::Session::State/; use strict; use warnings; use NEXT; our $VERSION = 0.01; sub get_session_id { my $c = shift; my $session_id = $c-request-params-{token}; if ( $session_id ) { $c-log-debug(qq/Found sessionid $session_id in request parameter/) if $c-debug; return $session_id; } $c-NEXT::get_session_id(@_); } 1; On 5/30/07, Jim Spath [EMAIL PROTECTED] wrote: I'm currently using the following plugins for session management in my Catalyst app: Session Session::Store::Memcached Session::State::Cookie Session::DynamicExpiry Along with the following authentication plugins: Authentication Authentication::Store::DBIC Authentication::Credential::Password It all works great on my site... however, I was looking to integrate our app into Facebook, and to have users login to our service through Facebook. For every request, they will be passing an parameter called fb_sig_user, which I should be using as a session id on our side. I was wondering if there was a way that I could override the automatic creation of session ids with the Facebook id, while also continuing to use my current setup for onsite users? I've looked through the docs and searched a bit and am unclear on this. Thanks! Jim ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] running a function once on all requests
I have a routine I would like to run once for each request. After reading through the docs, I think I have found a good approach and am wondering what others have done. I created a base controller which uses base 'Catalyst::Controller' . Inside the base controller I create a begin function: sub begin : Private { my ( $self, $c ) = @_; $c-stash-{ controller } = $c-namespace; } In all my other controllers I use this base class. If I want to add a controller specific begin routine to a controller I place the following in that controller class: sub begin : Private { my ( $self, $c ) = @_; $self-SUPER::begin($c); # CONTROLLER SPECIFIC LOGIC HERE } Anyone know of any good reason to do it differently, or has anyone used other strategies in the past? Thanks, Steve Francia ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] running a function once on all requests
On 6/4/07, Steve Francia [EMAIL PROTECTED] wrote: Anyone know of any good reason to do it differently, or has anyone used other strategies in the past? That looks like auto-chaining, you might want to take a look at auto actions. http://search.cpan.org/~jrockway/Catalyst-Manual-5.700701/lib/Catalyst/Manual/Intro.pod#Built-in_actions_in_controllers/autochaining http://dev.catalystframework.org/wiki/FlowChart -- Eden Cardim Instituto Baiano de Biotecnologia Núcleo de Biologia Computacional e Gestão de Informações Biotecnológicas Laboratório de Bioinformática ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] running a function once on all requests
--- Steve Francia [EMAIL PROTECTED] wrote: I have a routine I would like to run once for each request. After reading through the docs, I think I have found a good approach and am wondering what others have done. I created a base controller which uses base 'Catalyst::Controller' . Inside the base controller I create a begin function: sub begin : Private { my ( $self, $c ) = @_; $c-stash-{ controller } = $c-namespace; } In all my other controllers I use this base class. If I want to add a controller specific begin routine to a controller I place the following in that controller class: sub begin : Private { my ( $self, $c ) = @_; $self-SUPER::begin($c); # CONTROLLER SPECIFIC LOGIC HERE } Anyone know of any good reason to do it differently, or has anyone used other strategies in the past? Thanks, Steve Francia I think begin actions where created for exactly this reason. The only thing I do differently is to use NEXT or C3 instead of SUPER. --john __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] running a function once on all requests
Eden Cardim wrote: On 6/4/07, Steve Francia [EMAIL PROTECTED] wrote: Anyone know of any good reason to do it differently, or has anyone used other strategies in the past? That looks like auto-chaining, you might want to take a look at auto actions. http://search.cpan.org/~jrockway/Catalyst-Manual-5.700701/lib/Catalyst/Manual/Intro.pod#Built-in_actions_in_controllers/autochaining http://dev.catalystframework.org/wiki/FlowChart It does look like auto-chaining, so perhaps I should restate my original question. What I want to do is a bit more specific. I am using chaining a decent amount, often chaining across different controllers. The end result of what I want to do is pass into the template (TT) the top most level controller name IE the controller closest to root. This is accessed using $c-namespace, from within the controller. If I use auto-chaining like: sub auto : Private { my ( $self, $c ) = @_; $c-stash-{ controller } = $c-namespace; } in the root controller (Root.pm). It works until I chain across more than one controller. Instead of the first, it gives me last controller in the chain, which leads me to believe that this method is either called once for each controller or called only once, but from the last controller in the chain. Perhaps there is a different approach with autochaining I should try. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
RE: [Catalyst] debug mode
Oh, missed this email. Yours looks better than mine. =) -D -Original Message- From: Matthew Pitts [mailto:[EMAIL PROTECTED] Sent: Monday, June 04, 2007 8:23 AM To: The elegant MVC web framework Subject: RE: [Catalyst] debug mode I wrote a cheap little plugin for my app to override $c-debug to return the debug flag from $c-config-{debug}. As such: package MyApp::Plugin::DebugMode; sub debug { my $c = shift; return $c-config-{debug} || 0; } 1; Then I just add a debug: 1 line to my DEV/QA/UAT configs and make it debug: 0 for my PROD config. It's been working pretty well for me. Enjoy, Matt Pitts On Mon, 2007-06-04 at 15:51 +0100, mark wrote: I thought a nice way would be to be able to specify it in the config file; then your _local.yml file could add it for the dev environment. Yet to produce a patch for that though it should be pretty straight forwards. Mark __ From: John Goulah [mailto:[EMAIL PROTECTED] Sent: 04 June 2007 15:32 To: The elegant MVC web framework Subject: [Catalyst] debug mode What is the best way to deal with the -Debug flag between a production and development environment? Obviously its not desirable to go into the file and remove the flag every time the code goes to prod. I see you can start the stanalone server with -d to force debug. I think I remember about an environment variable to set debug also. Is the preferred method to take the hardcoded flag out and use one of these, or is there another way (such as a config option)? How are people dealing with this? Thanks, John ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] running a function once on all requests
On 6/4/07, Steve Francia [EMAIL PROTECTED] wrote: Instead of the first, it gives me last controller in the chain, which leads me to believe that this method is either called once for each controller or called only once, but from the last controller in the chain. It runs for all controllers in the hierarchy, top-most first. Even if it ran the other way around, you'd still get the wrong result because you're calling $c-namespace, which gives you the namespace of the current running action, you want $self-namespace instead. Perhaps there is a different approach with autochaining I should try. you could do something like: sub auto : Private { my($self, $c) = @_; push @{$c-stash-{controllers}}, $self-namespace; return 1; } # in Root sub end : Private { my($self, $c) = @_; $c-stash{controller} = $c-stash-{controllers}[0]; } Although I'm not sure if this is the best way to do it, I'd much prefer this over subclassing since things can get messy if you need to inherit from another controller like FormBuilder or REST. -- Eden Cardim Instituto Baiano de Biotecnologia Núcleo de Biologia Computacional e Gestão de Informações Biotecnológicas Laboratório de Bioinformática ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/