Re: [Catalyst] Restarting Catalyst on request or doing something per request

2009-08-25 Thread Wade Stuart
On Mon, Aug 24, 2009 at 3:51 PM, Matthias Dietrich wrote:

> Hi Chris,
>
> Am 24.08.2009 um 04:43 schrieb Chris:
>
>  Can you use catalyst::plugin::cache as the backend for the lexicon?
>> Then refreshing the texts involves clearing the cache, and updates are
>> transparent.
>>
>
> I took a quick look at C::P::Cache and I don't think it is possible to use
> this module as the backend with adequate work.  Locale::Maketext::Lexicon
> stores the text somewhere under its own package name in a hash.  To use a
> cache backend here would mean creating a module around L::M::L which alters
> "internal" data whereas this new module would depend on the current L::M::L
> module version.  I don't think this would be good.
>
> So from my point of view the best way would be to reload the lexicon data
> once it has changed.  As this is not possible without manually restarting
> apache, this leads me to reloading the lexicon after the database contents
> has changed within each apache client on request start (before any lexicon
> text is requested).  I could initiate this within an auto sub in Root.pm,
> but this seems very ugly.  I guess a new plugin (like
> C::P::I18N::DBI::Reloader) would be good.  What do you think?
>
>
Why cant you just do a:

# ... incrementally add new lexicons
Locale::Maketext::Lexicon->import({
de => [Gettext => 'local/hello/de.po'],

})

... on change instead of reloading apache?
___
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] Systems built on top of Catalyst

2009-08-25 Thread Steve


I am lobbying for the exclusive use of Catalyst as the development tool 
of choice, and therefore Perl as the preferred language in our small 
software company.  Having researched Catalyst and having gone through 
every tutorial I can get my hands on, I have a basic understanding of 
the Catalyst framework.  The Catalyst::Manual::About references 'several 
systems built on top of Catalyst that can get you very close to a 
working app.'.  Though I understand and subscribe to the same views 
expressed in this document regarding what Catalyst is and what it isn't, 
I am in need of something more if I am to be successful in my efforts.  
Suggestions?


TIA
Steve

___
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] Systems built on top of Catalyst

2009-08-25 Thread Roderick A. Anderson

Steve wrote:


I am lobbying for the exclusive use of Catalyst as the development tool 
of choice, and therefore Perl as the preferred language in our small 
software company.  Having researched Catalyst and having gone through 
every tutorial I can get my hands on, I have a basic understanding of 
the Catalyst framework.  The Catalyst::Manual::About references 'several 
systems built on top of Catalyst that can get you very close to a 
working app.'.  Though I understand and subscribe to the same views 
expressed in this document regarding what Catalyst is and what it isn't, 
I am in need of something more if I am to be successful in my efforts.  
Suggestions?


I'll say one thing -- CPAN -- but it implies much more than the modules 
you find there.  You need to include those that make Perl ... Perl, a 
list far too long to list and you'd still many people and companies.


And the icing on the cake?  Perl runs on every OS (I can think of.)


\\||/
Rod
--


TIA
Steve

___
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] Restarting Catalyst on request or doing something per request

2009-08-25 Thread Matthias Dietrich

Hi Wade,

Am 25.08.2009 um 13:48 schrieb Wade Stuart:

Why cant you just do a:

# ... incrementally add new lexicons
Locale::Maketext::Lexicon->import({
de => [Gettext => 'local/hello/de.po'],

})
... on change instead of reloading apache?


because this would only affect the current apache child process (at  
least under mod_perl).  All other clients will still have the old  
lexicon.


Thanks,
  matt

--
rainboxx Matthias Dietrich
Freier Software Engineer

rainboxx  |  Tel.: +49 (0) 151 / 50 60 78 64
Tölzer Str. 19|  Mail: m...@rainboxx.de
70372 Stuttgart   |  WWW : http://www.rainboxx.de

XING: https://www.xing.com/profile/Matthias_Dietrich18
GULP: http://www.gulp.de/profil/rainboxx.html





PGP.sig
Description: Signierter Teil der Nachricht
___
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] Restarting Catalyst on request or doing something per request

2009-08-25 Thread Matthias Dietrich

Hi Chris,

Am 25.08.2009 um 00:48 schrieb Chris:

I wonder if you could force a reload using a SIG{USR1} handler and  
avoid

a per-request check?


I think so, but I need to know the processes to send the signal to.  I  
guess $$ is only the current apache client process and a signal to  
this will not get to the others.  What about sending a signal to the  
parent process -- will this affect the childs?  If yes, how can I  
determine the PID of the parent from within a child process?


As I already said I'm not familiar with FastCGI and I don't yet know  
about how clients are spawn and if they might share their memory.   
Maybe someone here knows about this?


Thanks,
  matt

--
rainboxx Matthias Dietrich
Freier Software Engineer

rainboxx  |  Tel.: +49 (0) 151 / 50 60 78 64
Tölzer Str. 19|  Mail: m...@rainboxx.de
70372 Stuttgart   |  WWW : http://www.rainboxx.de

XING: https://www.xing.com/profile/Matthias_Dietrich18
GULP: http://www.gulp.de/profil/rainboxx.html





PGP.sig
Description: Signierter Teil der Nachricht
___
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] Systems built on top of Catalyst

2009-08-25 Thread Steve
To be more specific, something like AutoCRUD, mixed in with some CSS 
would be a huge plus, as the UI is the biggest obstacle.  Business 
logic, database design are strengths.  In the past we have used a 
PHP-based product called ATK which comes with 'themes'.  I'm looking for 
something similar, but using Catalyst.


Steve
Roderick A. Anderson wrote:

Steve wrote:


I am lobbying for the exclusive use of Catalyst as the development 
tool of choice, and therefore Perl as the preferred language in our 
small software company.  Having researched Catalyst and having gone 
through every tutorial I can get my hands on, I have a basic 
understanding of the Catalyst framework.  The Catalyst::Manual::About 
references 'several systems built on top of Catalyst that can get you 
very close to a working app.'.  Though I understand and subscribe to 
the same views expressed in this document regarding what Catalyst is 
and what it isn't, I am in need of something more if I am to be 
successful in my efforts.  Suggestions?


I'll say one thing -- CPAN -- but it implies much more than the 
modules you find there.  You need to include those that make Perl ... 
Perl, a list far too long to list and you'd still many people and 
companies.


And the icing on the cake?  Perl runs on every OS (I can think of.)


\\||/
Rod


___
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] [ANNOUNCE] Gitalist - bringing Catalyst to gitweb

2009-08-25 Thread Dan Brook
For those of you who've had the pleasure of working with git you
may have come across gitweb, the web front end to a given set of git
repositories. It is bundled with the git source[1] as gitweb.perl and
gets munged into gitweb.cgi after make runs through it. With gitweb.cgi
you have one monolithic CGI program that provides the whole gamut of its
web app functionality from grovelling in git repos to providing feeds for
commits. This being a Catalyst list you can probably see where I'm going
with this ...

Having decided at work[2] that we needed to extend gitweb to support stuff
useful to us I thought it would be easier to move gitweb into a Catalyst
app than build on the existing script. After a week or two of idle hacking
I've got it to the point where it's wrapped in Catalyst and has a basic
layout template and a single controller. The work for this can be found here:

http://github.com/broquaint/Gitalist/tree/master

And here (thanks to t0m for sorting this out!):

ro git://git.shadowcat.co.uk/catagits/Gitalist.git rw
catag...@git.shadowcat.co.uk:Gitalist.git

It should noted at this point that the name "Gitalist" is intentionally
quite bad in the hope that once the foundation work of moving in gitweb
into a Catalyst structure is done it can move on from being "gitweb in
Catalyst" and on to something bigger and better.

Being a total Catalyst novice there's bound to be all sorts of mistakes
and assumptions that could be straightened out so please feel free to
fork'n'fix. If you have any queries, questions or quips drop me a line,
I go by the handle broquaint on IRC and the web at large.

Thanks to Venda for the time to do the dev and letting the code be open
sourced. Also thanks to t0m and chrisa for the encouragement to do the
work and push it out to the community.

Cheers,
Dan Brook

[1] http://xrl.us/gitwebperl
[2] Venda

___
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] use base vs use parent

2009-08-25 Thread Octavian Râşniţă

Hi,

I've seen some Catalyst sample modules that use "use base" and some others 
that use "use parent".


I know that the recommendation could be to use Moose and "extends...", but 
if Moose is not needed, what's the difference between use parent and use 
base?


When should be "use parent" be used and not "use base" or it really doesn't 
matter which one is used?


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/


Re: [Catalyst] use base vs use parent

2009-08-25 Thread Evan Carroll
>
>
> I know that the recommendation could be to use Moose and "extends...", but
> if Moose is not needed, what's the difference between use parent and use
> base?
>


per base.pm

Unless you are using the fields pragma, consider this module discouraged in
favor of the lighter-weight parent.


per parent.pm

This module was forked from base  to
remove the cruft that had accumulated in it.

It also seems as if parent.pm has a '-norequire' field.



>
> When should be "use parent" be used and not "use base" or it really doesn't
> matter which one is used?
>
>
parent.pm when you can use cpan, base.pm when you can't.



-- 
Evan Carroll
www.evancarroll.com
System Lord of the Internets
___
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] [ANNOUNCE] Gitalist - bringing Catalyst to gitweb

2009-08-25 Thread Stephen Sykes
Thanks for posting this to the list, Dan. I have been thinking of the
same type of project recently. I am glad this is a Github project as
well. ;)

Best Regards,
Stephen Sykes
[http://catalystsites.org]

Dan Brook wrote:
> For those of you who've had the pleasure of working with git you
> may have come across gitweb, the web front end to a given set of git
> repositories. It is bundled with the git source[1] as gitweb.perl and
> gets munged into gitweb.cgi after make runs through it. With gitweb.cgi
> you have one monolithic CGI program that provides the whole gamut of its
> web app functionality from grovelling in git repos to providing feeds for
> commits. This being a Catalyst list you can probably see where I'm going
> with this ...
>
> Having decided at work[2] that we needed to extend gitweb to support stuff
> useful to us I thought it would be easier to move gitweb into a Catalyst
> app than build on the existing script. After a week or two of idle hacking
> I've got it to the point where it's wrapped in Catalyst and has a basic
> layout template and a single controller. The work for this can be found here:
>
> http://github.com/broquaint/Gitalist/tree/master
>
> And here (thanks to t0m for sorting this out!):
>
> ro git://git.shadowcat.co.uk/catagits/Gitalist.git rw
> catag...@git.shadowcat.co.uk:Gitalist.git
>
> It should noted at this point that the name "Gitalist" is intentionally
> quite bad in the hope that once the foundation work of moving in gitweb
> into a Catalyst structure is done it can move on from being "gitweb in
> Catalyst" and on to something bigger and better.
>
> Being a total Catalyst novice there's bound to be all sorts of mistakes
> and assumptions that could be straightened out so please feel free to
> fork'n'fix. If you have any queries, questions or quips drop me a line,
> I go by the handle broquaint on IRC and the web at large.
>
> Thanks to Venda for the time to do the dev and letting the code be open
> sourced. Also thanks to t0m and chrisa for the encouragement to do the
> work and push it out to the community.
>
> Cheers,
> Dan Brook
>
> [1] http://xrl.us/gitwebperl
> [2] Venda
>
> ___
> 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] use base vs use parent

2009-08-25 Thread Bill Moseley
On Tue, Aug 25, 2009 at 11:55 AM, Evan Carroll wrote:

>
>
>> When should be "use parent" be used and not "use base" or it really
>> doesn't matter which one is used?
>>
>>
> parent.pm when you can use cpan, base.pm when you can't.
>

If it's a Moose class should you always use "extends" over both?

Hum, the CatalystAndMoose manual doesn't even show the application base
class inheriting:

http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/CatalystAndMoose.pod#THE_CONTEXT_CLASS

Unlike in the Intro which shows "use parent."

(The CatAndMoose page also shows $app, which isn't defined).

Not sure if this is by design or not, but the application base class
automatically inherits from Catalyst and Catalyst::Controller.




-- 
Bill Moseley
mose...@hank.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/


[Catalyst] What is correct way to re-check user password for authenticated user?

2009-08-25 Thread Oleg Kostyuk
Hello subscribers,

On some pages I need to re-check user password (to be more concrete -
each time when user change any settings on "user settings" page). I
can't compare passwords directly (something like: $form->{password} eq
$c->user->password()), because in DB I have only hashed passwords.
Seems that I can try to authenticate user again, by calling
$c->authenticate(name=>$c->user->name, pass=>$form->{password}), but I
concerned is this acceptable - calling authenticate, when user is
already authenticated. And what will be if provided password is
incorrect - user will be auto-logout'ed or not?

May be there is some other way, that is not obvious to me?

Any thoughts is welcome,
Thanks.

-- 
Sincerely yours,
Oleg Kostyuk (CUB-UANIC)

___
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] What is correct way to re-check user password for authenticated user?

2009-08-25 Thread Matt Whipple

Oleg Kostyuk wrote:

Hello subscribers,

On some pages I need to re-check user password (to be more concrete -
each time when user change any settings on "user settings" page). I
can't compare passwords directly (something like: $form->{password} eq
$c->user->password()), because in DB I have only hashed passwords.
  

You could always just hash the supplied password and compare the hashes


Seems that I can try to authenticate user again, by calling
$c->authenticate(name=>$c->user->name, pass=>$form->{password}), but I
concerned is this acceptable - calling authenticate, when user is
already authenticated. And what will be if provided password is
incorrect - user will be auto-logout'ed or not?
  
I'd probably use the authentication again, but ensure that it treated 
logically as such and not lumped in with some CRUD (unless that's not 
how it's being used in which case you probably shouldn't use it).  I'm 
fairly sure a failed auth doesn't result in a logout, so you could use 
that as a means to redisplay the form with a message.



May be there is some other way, that is not obvious to me?

Any thoughts is welcome,
Thanks.

  



___
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] Problem flattening arrays in Catalyst/Helper/Model/DBIC/Schema

2009-08-25 Thread pablo marin-garcia
Hello,

Problem:
Can't call method "flatten" on unblessed reference at
/nfs/local_perl/perllib/Catalyst/Helper/Model/DBIC/Schema.pm line 165.

Preamble:
I was following the catalyst tutorial in a Debian etch, and when tried
 in tutorial_03 Create Static DBIx::Class Schema Files I had an error
with method "flatten"

$ script/myapp_create.pl model DB DBIC::Schema MyApp::Schema
create=static dbi:SQLite:myapp.db
 exists 
"/nfs/team108/pg4/webserver/catalyst/mytut/MyApp/script/../lib/MyApp/Model"
 exists "/nfs/team108/pg4/webserver/catalyst/mytut/MyApp/script/../t"
Can't call method "flatten" on unblessed reference at
/nfs/users/nfs_p/pg4/local_perl/perllib/Catalyst/Helper/Model/DBIC/Schema.pm
line 165.

I installed Catalyst in a macbook and this works OK. So seems that I
have a broken Moose module somewhere but I don't know how to find it.

Exploring:
The offending line:

"my @args   = $self->args->flatten if $self->args;"

if I unflatten the args with @{$self->args} the script works. It seems
that Moose is giving args a constrain isa=>ArrayRef but somewhere the
call to flatten (Moose::Autobox) is not properly handle.

I have no experience with Moose, and being the code metaprogramed is a
bit difficult follow the process with the debugger.

I would like to find out where I have the bad installed/missed module
(I assume that is part of Moose or Moose-catalyst). Could someone
point me in any interesting direction or how to keep in the search? I
have spent a day learning how Moose works but I run off ideas to fix
the issue.

Regards

PS: debugging oddity: in my macbook the scripts works ok but under the
debugger if the offending line

my @args   = $self->args->flatten if $self->args;

is run n by n it goes ok but if I evaluate with "x
$self->args->flatten" I have the same error than in my linux
installation about calling flatten in unblessed ref.

--
  - Pablo Marin-Garcia



-- 
   - Pablo Marin-Garcia

___
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] use base vs use parent

2009-08-25 Thread Tomas Doran
ccing in -dev, as this is relevant there, and and contains a brain  
dump :_)



If it's a Moose class should you always use "extends" over both?


Yep.

Hum, the CatalystAndMoose manual doesn't even show the application  
base class inheriting:


http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manual/CatalystAndMoose.pod#THE_CONTEXT_CLASS


I did mangle trunk to show it as inheriting recently.


Unlike in the Intro which shows "use parent."


Yes, lots of places (and the helpers) haven't been updated yet.

This work is underway (helpers haven't been done as I for one haven't  
wanted to work on the horrible crap that exists at the moment until  
the GSOC project is a bit more finished, and makes it less horrible)!



(The CatAndMoose page also shows $app, which isn't defined).


 yes, also fixed in trunk of the manual.

New -Manual release is waiting on some more fixes, which I'll try to  
get to in the next week or two.


Note that the tutorial being updated will wait until it can match what  
the helpers generate, without needing a 'and now we port to Moose'  
section...


use base and use parent are both still fully supported, including  
weird franken-combinations of 5.80 => use base => use Moose type  
inheritance..


Not sure if this is by design or not, but the application base class  
automatically inherits from Catalyst and Catalyst::Controller.


It was originally by design.

However the application class being @ISA ::Controller is bad, wrong  
and deprecated, and removing it wholesale is a prerequisite for the  
app/ctx split. Catalyst spitting out warnings when you have actions in  
your MyApp.pm class (and therefore need it to be @ISA Controller) will  
be appearing presently. (I.e. the code is present and commented out  
until the tests are fixed - which is happening right now in a branch) :)


You _can_ have action methods in your root MyApp.pm, but as noted  
above this a baaad and the scaffold has generated by   
a ::Controller::Root which configures itself into the root namespace  
for several years..


Cheers
t0m


___
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] What is correct way to re-check user password for authenticated user?

2009-08-25 Thread Jason Galea


Oleg Kostyuk wrote:

Hello subscribers,

On some pages I need to re-check user password (to be more concrete -
each time when user change any settings on "user settings" page). I
can't compare passwords directly (something like: $form->{password} eq
$c->user->password()), because in DB I have only hashed passwords.
  
how are you hashing your passwords? If using DBIx::Class::EncodedColumn 
you can get it to generate a 'check_password' method (see docs).

Seems that I can try to authenticate user again, by calling
$c->authenticate(name=>$c->user->name, pass=>$form->{password}), but I
concerned is this acceptable - calling authenticate, when user is
already authenticated. And what will be if provided password is
incorrect - user will be auto-logout'ed or not?

May be there is some other way, that is not obvious to me?

Any thoughts is welcome,
Thanks.

  


___
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 flattening arrays in Catalyst/Helper/Model/DBIC/Schema

2009-08-25 Thread Tomas Doran


On 26 Aug 2009, at 00:58, pablo marin-garcia wrote:


Hello,

Problem:
Can't call method "flatten" on unblessed reference at
/nfs/local_perl/perllib/Catalyst/Helper/Model/DBIC/Schema.pm line 165.


Your Moose::Autobox, or autobox modules are busted. At a guess, the  
latter, but it could be either.


How are you installing stuff in etch, as I have an install that works  
just fine on etch with autobox?


Cheers
t0m


___
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] Restarting Catalyst on request or doing something per request

2009-08-25 Thread Tomas Doran


On 25 Aug 2009, at 16:57, Matthias Dietrich wrote:


Hi Wade,

Am 25.08.2009 um 13:48 schrieb Wade Stuart:

Why cant you just do a:

# ... incrementally add new lexicons
   Locale::Maketext::Lexicon->import({
   de => [Gettext => 'local/hello/de.po'],

   })
... on change instead of reloading apache?


because this would only affect the current apache child process (at  
least under mod_perl).  All other clients will still have the old  
lexicon.



Right - so use some form of caching scheme to save a lexicon  
'generation' key.


Bump the value of that key when the lexicon is changed. The first time  
you use the lexicon in a hit (or just at the start of the hit), check  
the lexicon generation and reload if needed?


This approach is simpler than futzing around with process management,  
simpler than messing with multiple signals, simpler to scale to n  
boxen (just use memcache - can change this by config if you're using  
Catalyst::Plugin::Cache), etc...


Cheers
t0m




___
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] What is correct way to re-check user password for authenticated user?

2009-08-25 Thread Tomas Doran


On 26 Aug 2009, at 00:50, Matt Whipple wrote:



Seems that I can try to authenticate user again, by calling
$c->authenticate(name=>$c->user->name, pass=>$form->{password}),  
but I

concerned is this acceptable - calling authenticate, when user is
already authenticated. And what will be if provided password is
incorrect - user will be auto-logout'ed or not?


Yes, this is correct, no - the existing user will not be logged out - - 
>authenticate will just return false.


Please give a doc patch making this more clear wherever you looked and  
failed to find the information?


Cheers
t0m


___
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/