Re: [Catalyst] Tutorial (in VMware) keeps losing ability toauthenticate

2013-02-14 Thread Ben Vinnerd
That would work if the machine is always connected to a network.

I believe installing VMware tools fixes the clock sync problem though.

Ben


On 14 February 2013 14:27, Nicolas Vs  wrote:

> Install an ntp server on your host/vm and start it with its default
> configuration.
>
> Regards,
> Nicolas
> ------
> De : Ben Vinnerd
> Envoyé : 14/02/2013 11:00
> À : The elegant MVC web framework
> Objet : Re: [Catalyst] Tutorial (in VMware) keeps losing ability
> toauthenticate
>
>
> I seem to recall have authentication problems with a Catalyst app a while
> ago, but only in the IE browser.
>
> IIRC the problem was something to do with the VM's clock losing sync and
> an IE cookies clash.
>
> Check the clock on your VM is accurate - worth a go :)
>
> Ben
>
>
> On 30 January 2013 21:10, Dan Lowe  wrote:
>
>> I have been doing the Catalyst tutorial, at
>>
>> https://metacpan.org/module/Catalyst::Manual::Tutorial
>>
>> I am using the VMware virtual machine, as recommended. This is running in
>> VMware Fusion 5 Pro on a Mac. Overall it works perfectly fine, except that
>> periodically, I lose the ability to authenticate to the demo CRUD app
>> (MyApp). Based on observation, it seems that the only common factor is that
>> it works fine before my laptop is put to sleep for the night, and it is
>> broken in the morning. It doesn't seem to matter where in the tutorial I
>> am. VMware, and often the Catalyst app server, are running when the laptop
>> goes to sleep.
>>
>> (Arguably I should not do that, though the VM itself comes back just
>> fine, and the app server still responds, it's just that I am no longer able
>> to authenticate.)
>>
>> Things I have tried already:
>>
>> 1. Move the ~/MyApp/ directory aside, remove /tmp/myapp (session data
>> cache), and run the server from e.g. ~/Final/Chapter05/MyApp. This results
>> in the same behavior (app server runs, and response to http requests, but
>> when authenticating, all I ever get is the "Empty username or password"
>> error).
>>
>> 2. Reboot the VM
>>
>> 3. Reboot the Mac
>>
>> 4. Get to a working point, stop the app server, tar up ~/MyApp, and then
>> next time it breaks,
>>
>> (stop app server)
>> cd ~
>> rm -rf ~/MyApp /tmp/myapp
>> (untar the copy of ~/MyApp)
>> cd ~/MyApp ; script/myapp_server -r
>>
>> But that doesn't work, it exhibits the same behavior.
>>
>> 5. Delete ~/MyApp and /tmp/myapp and do the tutorial over again, pasting
>> in all of the code from the web page. (This is the only approach that has
>> worked so far, unfortunately.)
>>
>> I am just learning Catalyst (obviously), so I don't have any good
>> theories here except that sleeping the VMware VM is corrupting something in
>> its memory or filesystem, causing the trouble. Memory would not seem to be
>> a legitimate suspect though, because rebooting the VM does not fix the
>> problem. Whatever is wrong is persisting across reboots, i.e. it's probably
>> on the filesystem.
>>
>> Does the tutorial cache data other than in /tmp/myapp? I have tried to
>> find other caches, but since I am running unprivileged, it seems as if it
>> would not be able to write outside of my home directory or /tmp, and I've
>> already looked in both of those. I don't see anything under ~/MyApp that
>> appears to be dynamic data, only in /tmp/myapp.
>>
>> Thanks for any advice,
>> Dan
>>
>>
>> ___
>> 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/
>
>
___
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] Tutorial (in VMware) keeps losing ability to authenticate

2013-02-14 Thread Ben Vinnerd
I seem to recall have authentication problems with a Catalyst app a while
ago, but only in the IE browser.

IIRC the problem was something to do with the VM's clock losing sync and an
IE cookies clash.

Check the clock on your VM is accurate - worth a go :)

Ben


On 30 January 2013 21:10, Dan Lowe  wrote:

> I have been doing the Catalyst tutorial, at
>
> https://metacpan.org/module/Catalyst::Manual::Tutorial
>
> I am using the VMware virtual machine, as recommended. This is running in
> VMware Fusion 5 Pro on a Mac. Overall it works perfectly fine, except that
> periodically, I lose the ability to authenticate to the demo CRUD app
> (MyApp). Based on observation, it seems that the only common factor is that
> it works fine before my laptop is put to sleep for the night, and it is
> broken in the morning. It doesn't seem to matter where in the tutorial I
> am. VMware, and often the Catalyst app server, are running when the laptop
> goes to sleep.
>
> (Arguably I should not do that, though the VM itself comes back just fine,
> and the app server still responds, it's just that I am no longer able to
> authenticate.)
>
> Things I have tried already:
>
> 1. Move the ~/MyApp/ directory aside, remove /tmp/myapp (session data
> cache), and run the server from e.g. ~/Final/Chapter05/MyApp. This results
> in the same behavior (app server runs, and response to http requests, but
> when authenticating, all I ever get is the "Empty username or password"
> error).
>
> 2. Reboot the VM
>
> 3. Reboot the Mac
>
> 4. Get to a working point, stop the app server, tar up ~/MyApp, and then
> next time it breaks,
>
> (stop app server)
> cd ~
> rm -rf ~/MyApp /tmp/myapp
> (untar the copy of ~/MyApp)
> cd ~/MyApp ; script/myapp_server -r
>
> But that doesn't work, it exhibits the same behavior.
>
> 5. Delete ~/MyApp and /tmp/myapp and do the tutorial over again, pasting
> in all of the code from the web page. (This is the only approach that has
> worked so far, unfortunately.)
>
> I am just learning Catalyst (obviously), so I don't have any good theories
> here except that sleeping the VMware VM is corrupting something in its
> memory or filesystem, causing the trouble. Memory would not seem to be a
> legitimate suspect though, because rebooting the VM does not fix the
> problem. Whatever is wrong is persisting across reboots, i.e. it's probably
> on the filesystem.
>
> Does the tutorial cache data other than in /tmp/myapp? I have tried to
> find other caches, but since I am running unprivileged, it seems as if it
> would not be able to write outside of my home directory or /tmp, and I've
> already looked in both of those. I don't see anything under ~/MyApp that
> appears to be dynamic data, only in /tmp/myapp.
>
> Thanks for any advice,
> Dan
>
>
> ___
> 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] Unable to output anything in Root.pm -> 'auto'

2012-10-29 Thread Ben Vinnerd
Private methods have to return a true value to continue processing.

Try adding "return 1" at the end of the method.

Ben


On 29 October 2012 14:23, Craig Chant  wrote:

>  Hi,
>
>
>
> I seem to be going round in circles unable to get Catalyst to output
> anything via ‘auto’?
>
>
>
> I made a change to the Root.pm to try to add authentication via the ‘auto’
> method, but it does nothing?
>
>
>
> # always runs first!
>
> sub auto :Private {
>
> my ( $self, $c ) = @_;
>
>
>
> # Authenticate
>
> $c->response->body('Matched Members::Controller::Auto in Root.' .
> $c->sessionid);
>
>
>
> }
>
>
>
> This doesn’t output anything and I simply get the welcome screen, plus
> there is a warning in the devel server output of
>
>
>
> “Use of uninitialized value in concatenation (.) or string”
>
>
>
> I have ..
>
>
>
> use Catalyst qw/
>
> -Debug
>
> ConfigLoader
>
> Static::Simple
>
> StackTrace
>
> Session
>
> Session::Store::FastMmap
>
> Session::State::Cookie
>
> /;
>
>
>
> In my main MyApp.pm
>
>
>
> Why is $c->response->body not working and why is the sessionid empty?
>
>
>
> Thanks
>
>
>
> *Craig Chant*
>
> I.T. Manager
>
> [image: Description: cid:image001.png@01CD5F4A.17E848D0]
>
> Main Line01903 602664
>
> Direct Line   01903 227753
>
> Visit our website http://www.homeloanpartnership.com
>
> *HomeLoan Partnership have been named the Best Mortgage Network, 2012, at
> the myintroducer.com Industry Awards*
>
>
>  This Email and any attachments contain confidential information and is
> intended solely for the individual to whom it is addressed. If this Email
> has been misdirected, please notify the author as soon as possible. If you
> are not the intended recipient you must not disclose, distribute, copy,
> print or rely on any of the information contained, and all copies must be
> deleted immediately. Whilst we take reasonable steps to try to identify any
> software viruses, any attachments to this e-mail may nevertheless contain
> viruses, which our anti-virus software has failed to identify. You should
> therefore carry out your own anti-virus checks before opening any
> documents. HomeLoan Partnership will not accept any liability for damage
> caused by computer viruses emanating from any attachment or other document
> supplied with this e-mail. HomeLoan Partnership reserves the right to
> monitor and archive all e-mail communications through its network. No
> representative or employee of HomeLoan Partnership has the authority to
> enter into any contract on behalf of HomeLoan Partnership by email.
> HomeLoan Partnership is a trading name of H L Partnership Limited,
> registered in England and Wales with Registration Number 5011722.
> Registered office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership
> Limited is authorised and regulated by the Financial Services Authority.
>
> ___
> 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::ResultSet ] 'update' with 'where' clause

2010-03-23 Thread Ben Vinnerd
Hi David,

You need to call either update or update_all on the ResultSet. See docs:
http://search.cpan.org/~ribasushi/DBIx-Class-0.08120/lib/DBIx/Class/ResultSet.pm#update
http://search.cpan.org/~ribasushi/DBIx-Class-0.08120/lib/DBIx/Class/ResultSet.pm#update_all

Try something like this:

$c->model('DB::Test')->search({id => $c->user->get('id'))->update({lang =>
$lang->first->id});

Ben


On Tue, 23 Mar 2010 18:15:55 + (GMT), David 
wrote:
> Hi,
> 
> I can't find how to set 'where' clause in an update. I only want to
update
> rows depending on a condition. Is that possible? 
> I haven't this option in ResultSet documentation.
> 
> I try like next, but it doesn't work. It updates all table rows.
> 
> $c->model('DB::Test')->update({'lang' => $lang->first->id},{where =>
{'id'
> => $c->user->get('id')}});
> 
>  
> 
> Thanks in advanced,
> 
> David

___
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] ConfigLoader not looking at myapp.conf

2009-07-30 Thread Ben Vinnerd

Hi,

I'm using ConfigLoader with myapp.conf and myapp_local.conf in my app. 
myapp_local.conf is being read into $c->config fine, but anything in 
myapp.conf is being ignored.


I have the following in myapp.conf:


no_image_640x480 /images/unavailable.gif
no_image_320x240 /images/unavailable_320x240.gif
no_image_160x120 /images/unavailable_160x120.gif
no_image_80x60   /images/unavailable_80x60.gif


I have NOT put the above in myapp_local.conf.

Infact, _anything_ i put in myapp.conf (and _not_ in myapp_local.conf) 
is being ignored.


I thought that ConfigLoader was supposed to merge the 2 configs 
together, and effectively give precedence to whatever is in 
myapp_local.conf?


Note: that this is opposite to the problem i had on 17/06/2009 (see 
thread: ConfigLoader trouble).


Ben


___
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] How to sign up...

2009-07-28 Thread Ben Vinnerd

On 28/07/2009 14:29, Steve wrote:
Please help me figure out how I got signed up for this list.  There is 
another gentleman in our company who would like to get these posts, 
but I can't seem to figure out how I got signed up!



Click on  the Listinfo link at the bottom of this email!

Ben


___
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] RFC: Makefile warning in catalyst apps

2009-07-28 Thread Ben Vinnerd

On 28/07/2009 09:52, Devin Austin wrote:
I also thought --yarly (thanks rafl), --yesinstalldammit, 
--plztobeintallingz were excellent choices.


He he :)


___
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] RFC: Makefile warning in catalyst apps

2009-07-28 Thread Ben Vinnerd

On 28/07/2009 09:27, Devin Austin wrote:

okay, I got this right this time.

What are everyone's thoughts on including a warning and forced 
confirmation when a user  goes to "make install" an application, be it 
downloaded from cpan or elsewhere?


Something like, "you are running make install, are you REALLY sure you 
want to install this application system wide?  If you aren't sure, 
then CTRL + C.", or, make reallywantoinstall, etc.


Thoughts?

Can we have a reallyreallywanttoinstallplease ?

Ben


___
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] myapp_local.yml gets ignored

2009-06-18 Thread Ben Vinnerd

On 17/06/09 14:50, Jochen Luig wrote:

When the login request failed, I first thought it had to do with the
authentication process. But when there was a change in the db schema
that I hadn't made accordingly in my local mysql database, the test
script complained about the columns not present in the database. So the
myapp_local.yml seems to get ignored. OTOH, the test user is not created
in that database.
According to the ConfigLoader docs, 'local' is the default suffix for
files used to override the main config, so AFAIU the above code is
supposed to "just work".
Maybe I'm just not seeing the wood for the trees here, but are there any
prerequisites for this to work that I may have overlooked?

   


Jochen - have you deleted the Makefile.PL in the app dir? If so, put it 
back :)


Ben


___
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] ConfigLoader trouble

2009-06-18 Thread Ben Vinnerd

On 18/06/09 08:57, Tomas Doran wrote:


On 17 Jun 2009, at 11:16, Ben Vinnerd wrote:


It's like ConfigLoader's setup() isn't being run, or it's choosing to 
ignore the MYAPP_CONFIG_LOCAL_SUFFIX i'm setting.




I'm afraid the best way to debug this is likely to be brute force.

No need - i tried putting back the Makefile.PL i deleted (as per other 
thread), and ConfigLoader (as if by magic) started working again.


I really should read important notices a bit more :)

Ben


___
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] root dir location

2009-06-18 Thread Ben Vinnerd

On 18/06/09 08:51, Tomas Doran wrote:

At a guess, you deleted your Makefile.PL?



Yes :O

I didn't really want to bother with make on my webapp, so deleted that 
along with Changes and README.


Cheers t0m,

Ben


___
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] myapp_local.yml gets ignored

2009-06-17 Thread Ben Vinnerd

On 17/06/09 16:13, Carl Vincent wrote:

Are you sure that your config files are parsing correctly? I've had problems in 
the past (admittedly with YAML config files) with the files being silently 
ignored when there's a syntax error in them. This may be handled better in the 
latest versions.


Yeah i'm sure - if i load the config file manually from within 
lib/Myapp.pm, it works fine:


__PACKAGE__->config->{'Plugin::ConfigLoader'} = {file => 
'/home/motoring/Motoring/motoring_beta.conf'};


($ENV{MOTORING_CONFIG_LOCAL_SUFFIX} is set to "beta")

Ben


___
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] myapp_local.yml gets ignored

2009-06-17 Thread Ben Vinnerd

On 17/06/09 14:50, Jochen Luig wrote:

  So the
myapp_local.yml seems to get ignored. OTOH, the test user is not created
in that database.
According to the ConfigLoader docs, 'local' is the default suffix for
files used to override the main config, so AFAIU the above code is
supposed to "just work".
Maybe I'm just not seeing the wood for the trees here, but are there any
prerequisites for this to work that I may have overlooked?

   
This looks like the same problem i'm having (see thread "ConfigLoader 
trouble").


I did try myapp_local.conf and it was ignored.

Ben


___
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] root dir location

2009-06-17 Thread Ben Vinnerd
Where should the root dir (for templates) be? I thought it was at the 
same level as lib, script, and t.


I'm finding that when i create a view with:

myapp_create.pl view MyView TT

...the INCLUDE_PATH isn't setup, and i have to manually add:

INCLUDE_PATH => Myapp->path_to(qw/.. .. root/),



___
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] ConfigLoader trouble

2009-06-17 Thread Ben Vinnerd

On 17/06/09 11:15, Devin Austin wrote:
Paste your conf, connect_info actually has to be an array(ref?) and it 
has to be put together kinda funny in myapp.conf.





   connect_info dbi:mysql:motoring:localhost;mysql_client_found_rows=1
   connect_info 
   connect_info 


  AutoCommit 0
  PrintError 1
  RaiseError 1



  on_connect_do "set names utf8"




___
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] ConfigLoader trouble

2009-06-17 Thread Ben Vinnerd

On 17/06/09 11:02, Joel Bernstein wrote:

On 17 Jun 2009, at 10:52, Ben Vinnerd wrote:

Have got a problem with ConfigLoader not reading %ENV.

At the top of Myapp.pm i have:
use parent qw/Catalyst/;
use Catalyst qw/StackTrace ConfigLoader/;
...and i'm setting env var in httpd.conf:
PerlSetVar MYAPP_CONFIG_LOCAL_SUFFIX beta

^^^ is this intentional? Should be Env?


... but ConfigLoader will not load myapp_beta.conf from the 
application dir.


I have output the contents of %ENV to my Apache log, and 
MYAPP_CONFIG_LOCAL_SUFFIX is there.


I'm stumped, as i have this working on another machine.

If i manually set ConfigLoader's file option, it loads the config fine:

__PACKAGE__->config->{'Plugin::ConfigLoader'} = {file => 
'/home/ben/Myapp/myapp_beta.conf'};


Any ideas?


I've not run Catalyst under mod_perl in quite a while, but I would 
expect PerlSetEnv to definitely DTRT. Are PerlSetVar variables made 
available in %ENV under C::Engine::Apache? I don't believe so. Does 
switching to PerlSetEnv fix your issue?



Sorry, typo, yes i'm using PerlSetEnv, *not* PerlSetVar.

I have "PerlOptions +SetupEnv" in my apache config, and like i say i 
output %ENV and it's definately there.


It's like ConfigLoader's setup() isn't being run, or it's choosing to 
ignore the MYAPP_CONFIG_LOCAL_SUFFIX i'm setting.



___
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] ConfigLoader trouble

2009-06-17 Thread Ben Vinnerd

On 17/06/09 10:57, Devin Austin wrote:

What's the error you're getting?



The  config i'm putting in myapp_beta.conf isn't being read 
by ConfigLoader, so the error i'm getting is from DBIx::Class stating 
that it needs connect_info. But this error is irrelevant... it's 
ConfigLoader not reading the file that is the problem.


Ben

___
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] ConfigLoader trouble

2009-06-17 Thread Ben Vinnerd

Hi all,

Have got a problem with ConfigLoader not reading %ENV.

At the top of Myapp.pm i have:

use parent qw/Catalyst/;
use Catalyst qw/StackTrace ConfigLoader/;

...and i'm setting env var in httpd.conf:

PerlSetVar MYAPP_CONFIG_LOCAL_SUFFIX beta

... but ConfigLoader will not load myapp_beta.conf from the application dir.

I have output the contents of %ENV to my Apache log, and 
MYAPP_CONFIG_LOCAL_SUFFIX is there.


I'm stumped, as i have this working on another machine.

If i manually set ConfigLoader's file option, it loads the config fine:

__PACKAGE__->config->{'Plugin::ConfigLoader'} = {file => 
'/home/ben/Myapp/myapp_beta.conf'};


Any ideas?

Ben


___
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] Authorisation

2009-05-19 Thread Ben Vinnerd

Ivan Wills wrote:

user_model => 'DietDB',


Change this to:

user_model => 'DietDB::User'


(replace User with whatever you User table is called).

Ben


___
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] Which model is better, DBI or DBIC::Schema?

2009-04-29 Thread Ben Vinnerd




Malloy wrote:
Which model is
better, DBI or DBIC::Schema?
There's only one way to find out FIIIGHT

Sorry, couldn't resist :)

Ben




___
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] Final RFC for Press Release!

2009-04-29 Thread Ben Vinnerd

Joel Bernstein wrote:



Cheers Joel, couldn't have done it without you! What a star.


My sarcasm meter just went off the scale. Sorry if you were offended.

/joel



;-)

Ben

___
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] Final RFC for Press Release!

2009-04-28 Thread Ben Vinnerd

Joel Bernstein wrote:


On 28 Apr 2009, at 14:32, Ben Vinnerd wrote:


John Napiorkowski wrote:
There's a new edit of the Catalyst press release, which was 
graciously donated by a copy edit expert mst found for us.  mst++


Please take a look: 
http://dev.catalystframework.org/wiki/releaseannouncements/58pressrelease.edit 





No permissions to edit this page


So get rid of the .edit and it works..

http://dev.catalystframework.org/wiki/releaseannouncements/58pressrelease for 
the hard of thinking.



Cheers Joel, couldn't have done it without you! What a star.


___
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] Final RFC for Press Release!

2009-04-28 Thread Ben Vinnerd

John Napiorkowski wrote:

There's a new edit of the Catalyst press release, which was graciously donated 
by a copy edit expert mst found for us.  mst++

Please take a look: 
http://dev.catalystframework.org/wiki/releaseannouncements/58pressrelease.edit

  

No permissions to edit this page

___
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 with authentication

2009-04-22 Thread Ben Vinnerd




Should...

user_class: DB::grips_user

...be

user_model: DB::grips_user

???

Renee Bäcker wrote:

  Tomas Doran schrieb:
  
  
Nothing appears wrong with that code.

However you haven't shown us your authentication config, so we don't
know what you're authenticating with / against.

If you could also include the debug log of the hit which calls
$c->authenticate and then redirects, and the hit after that it would be
helpful.

  
  
Log output:

[info] *** Request 1 (0.167/s) [10155] [Wed Apr 22 12:56:43 2009] ***
[debug] Body Parameters are:
.-+--.
| Parameter   | Value
|
+-+--+
| password| secret
|
| username| reneeb
|
'-+--'
[debug] "POST" request for "root/login" from "127.0.0.1"
[debug] Path is "root/login"
[debug] login successful:
[debug] Finding template to render ...
[debug] Trying to render template
"/dir/templates/start.tmpl" ...
[debug] Redirecting to "http://localhost:3000/root/start"
[info] Request took 0.167890s (5.956/s)
.+---.
| Action | Time
|
++---+
| /root/login| 0.114807s
|
| /end   | 0.036004s
|
|  -> GriPS::View::TT->process   | 0.033808s
|
'+---'

[info] *** Request 2 (0.333/s) [10155] [Wed Apr 22 12:56:43 2009] ***
[debug] "GET" request for "root/start" from "127.0.0.1"
[debug] Path is "root/start"
[debug] Finding template to render ...
[debug] Trying to render template
"/dir/templates/start.tmpl" ...
[error] Caught exception in GriPS::Controller::Root->start "Can't call
method "user_id" on an undefined value at
/dir/../lib/GriPS/Controller/Root.pm
line 52."
[info] Request took 0.110155s (9.078/s)
.+---.
| Action | Time
|
++---+
| /root/start| 0.002196s
|
| /end   | 0.006856s
|
|  -> GriPS::View::TT->process   | 0.004974s
|
'+---'


and this is the configuration:

authentication:
  default_realm: default
  realms:
default:
  credential:
class: Password
password_field: passwd
password_type: clear
  store:
class: DBIx::Class
user_class: DB::grips_user
role_relation: rolenames
role_field: role

  
  
Cheers
t0m

  
  
Thanks!

- Renee

  
  
___
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] deployment with 3-tiered server setup: How to handle config?

2009-04-21 Thread Ben Vinnerd

I have a file /etc/httpd/host.conf, which contains the line:
PerlSetEnv CATALYST_CONFIG_LOCAL_SUFFIX live/dev/whatever

This host.conf file is different on each host, and gets included from 
the main httpd.conf. ConfigLoader picks this up, and it works for me - 
only 1 file to change on each host.


Ben


Jens Schwarz wrote:

Hi,

I am planing to have a 3-tiered catalyst setup: one development server, one 
test server and one production server. Each of those has of course different 
setups (mysql-users, hostnames, apache configs, etc). How can I create a 
catalyst application that can cope with these different settings without having 
to manually alter the settings on each system? (My app is under subversion 
control.). Is there a 'best practice'?

Thanks

Jens
  


___
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] Apache's

2009-04-15 Thread Ben Vinnerd

Thanks Charlie. That will do me  :)

Ben


Charlie Garrison wrote:

Good morning,

On 15/04/09 at 1:24 PM +0100, Ben Vinnerd  
wrote:


I pass a flag to Apache when i start it up, e.g. -Dhello. Any ideas 
how i can check this from within a Catalyst app?


If using mod_perl, then inside your IfDefine block, do a PerlSetEnv 
(or maybe a PerlSetVar), eg:


PerlSetEnv SERVER_MODE "test"

And then just check for key %ENV to see if the -D flag was applicable 
for that request.


The same technique should work with fast_cgi but you'll need to use 
SetEnv rather than PerlSetEnv (unless fast_cgi has PerlSetEnv 
equivalent).


Charlie



___
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] Apache's

2009-04-15 Thread Ben Vinnerd

Hi,

I pass a flag to Apache when i start it up, e.g. -Dhello. Any ideas how 
i can check this from within a Catalyst app?


Thanks,

Ben


___
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] Unknown error in Catalyst/Utils.pm line 272

2009-03-28 Thread Ben Vinnerd
Thanks very much, Kieren. This has been driving me insane, as i use 
Catalyst both at work and home, and only get this problem at home. Now i 
know the reason why.


Cheers :)

Ben


Kieren Diment wrote:

<@kd> purl, unknown error
22:32 < purl> well, unknown error is always caused by a syntax error 
in a controller or

 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=488088

On 29/03/2009, at 9:29 AM, Ben Vinnerd wrote:


Hi all,

I keep getting the following error when there's a problem with my code:

*Unknown error\nCompilation failed in require at 
/usr/local/lib/perl5/site_perl/5.10.0/Catalyst/Utils.pm line 272.*


I get this error in error_log when trying to start Apache with buggy 
code... not very helpful when trying to debug!


As an example, the following code (in my Root.pm):

sub test :Local
{
 my ($self, $c) = @_;
 my $this = 'hello world';
 $c->res->body($that);
}

...gives me the error. I'd expect the error message to be:Global 
symbol "$that" requires explicit package name


Is this a common gotcha?

Ben


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


___
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] Unknown error in Catalyst/Utils.pm line 272

2009-03-28 Thread Ben Vinnerd

Hi all,

I keep getting the following error when there's a problem with my code:

*Unknown error\nCompilation failed in require at 
/usr/local/lib/perl5/site_perl/5.10.0/Catalyst/Utils.pm line 272.*


I get this error in error_log when trying to start Apache with buggy 
code... not very helpful when trying to debug!


As an example, the following code (in my Root.pm):

sub test :Local
{
   my ($self, $c) = @_;
   my $this = 'hello world';
   $c->res->body($that);
}

...gives me the error. I'd expect the error message to be:Global symbol 
"$that" requires explicit package name


Is this a common gotcha?

Ben


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