[Catalyst] Url Encoded UTF8 parameters

2015-08-01 Thread Stefan
Hi,

if a URL parameter contains a Unicode character (e.g. 
www.example.com/?param=%D6lso%DF http://www.example.com/?param=%D6lso%DF  
which stands for param=Ölsoße), the parameter is not correctly parsed as 
Unicode.

 

I did the following to test it:

1.   Create a new Catalyst App: catalyst.pl UnicodeTest

2.   Set Root.pm Controller to correct encoding by adding ‘use utf8;’ at 
the top of the file

3.   Then add the following lines to the Root.pm Controller in the index 
function (don’t forget to use Data::Dumper):
$c-log-debug(Dumper($c-req-params));
$c-log-debug(Dumper(Ölsoße));

4.   This outputs for the example url: localhost:3000/?param=%D6lso%DF:



[debug] $VAR1 = {

  'param' = \x{fffd}lso\x{fffd}e

};

[debug] $VAR1 = '\x{d6}lso\x{df}e';

 

 

As you can see, the first output only contains one equal character: \x{fffd} 
which is obviously not the same as it should be: \x{d6}lso\x{df}e

 

I already tried adding the ‘encoding = 'UTF-8'’ config option, but this didn’t 
change anything.

 

Am I missing a specific setting?

 

My Catalyst version: 5.90097

Perl version: v5.18.2

 

Thanks for your help!

Stefan

___
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 I18N::DBI prevent connect at startup

2013-06-06 Thread Stefan
Hi!

 

I'm using Catalyst with the Catalyst::Plugin::I18N::DBI module.

 

The catalyst page is served through apache2 with mod_perl.

 

When starting apache2, the I18N module tries to connect immediately to the
MySQL server.

 

Here comes the problem:

At boot, apache2 tries to start before MySQL. Since MySQL is not yet
running, the I18N module fails with the following error (of course because
no MySQL):

DBI connect('database:localhost:3306','User',...) failed: Can't connect to
local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at
/usr/local/share/perl/5.10.1/Catalyst/Plugin/I18N/DBI.pm line 196.

 

This prevents apache2 to start correctly thus I have to start it always
manually after each boot which works fine because now mysql is running.

 

Is there a possibility to prevent this early connection or force a lazy
connection?

 

Thanks

Stefan

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


AW: [Catalyst] Catalyst I18N::DBI prevent connect at startup

2013-06-06 Thread Stefan
 Which OS/distribution do you use? If a Linux, do you have upstart jobs or
a SystemV-init-system?

Actually it's Ubuntu 10.04.4. Apache is started by SystemV-Init system
whereas mysql is an upstart script.
As far as I know there is no simple solution to define the dependency that
apache (or any sysvinit script) should start after mysql (any upstart
script).
If both would be of the same type, this would be fairly easy.
Additional discussion on this topic can be found here:
http://serverfault.com/questions/513526/force-apache-start-after-mysql
As you can see in the solution posted on Serverfault, it's not quite
optimal.

Thus I thought that it would be better to tell Catalyst or I18N somehow to
wait for the first Client-Request and THEN connect to mysql, instead of
connecting at startup.

---
Stefan


___
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] Taint mode -FormFu - Insecure dependency

2011-09-13 Thread Stefan
Hi,

I'm using Catalyst with FormFu in Apach2 and have switched on the taint mode
in Apache config:

 

PerlTaintCheck on

 

Pages without a form are working without problems.

 

Now I have a simple contact form created with FormFu which works fine in
Catalyst Development Server.

 

But in Apache I get the following error:

[error] Caught exception in MyApp::Controller::Contact-index Insecure
dependency in require while running with -T switch at
/usr/local/share/perl/5.10.1/HTML/FormFu/Util.pm line 371.

at /usr/local/share/perl/5.10.1/HTML/FormFu/Role/CreateChildren.pm line 136

at /usr/local/share/perl/5.10.1/HTML/FormFu/ObjectUtil.pm line 179

 

Now I've modified the Util.pm so that I get a more detailed view on the
tainted variable:

if ( !exists $::INC{$class} ) {
   #Added by myself:

if (tainted($class))

{

die This require is tainted:  . $class;

}

eval { require $class }; #This is line 371
   .

 

Now I get the following error message:

[error] Caught exception in MyApp::Controller::Contact-index This require
is tainted: HTML/FormFu/Element/Select.pm at
/usr/local/share/perl/5.10.1/HTML/FormFu/Util.pm line 376.

at /usr/local/share/perl/5.10.1/HTML/FormFu/ObjectUtil.pm line 179

 

I think, the problem is, that FormFu reads the .yml file and determines
which Modules to 'require'. Due to the require value is read from a file, I
get an Insecure Dependency Error.

 

One solution is to disable TaintMode, but I think this isn't recommended.

 

How can I solve this problem?

 

Sorry for my recently flood of questions but I can't find a solution by
googling.

Thanks a lot for your help!!

Stefan

___
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] FormFu missing Moose::Role

2011-09-12 Thread Stefan
Hi,

I've installed today the module HTML::FormFu with the command ,cpan
HTML::FormFu'.

 

But then I got the following error message:

 

Caught exception in MyApp::Controller::Contact-index Couldn't load class
(HTML::FormFu::Role::Element::Input) because: Invalid version format
(non-numeric data) at /usr/local/share/perl/5.10.1/MooseX/SetOnce.pm line
14.

 

After searching long time I've found out, that Moose::Role wasn't installed.
After I installed it, everything worked fine.

 

It seems, that somewhere is missing a 'require Moose::Role'.

 

Stefan

___
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] FormFu missing Moose::Role

2011-09-12 Thread Stefan
 Something must have gone wrong during the installation of Moose, as we
depend on Moose and Moose::Role is part of that package.

Yeah, now as you are saying, maybe I made a mistake when installing Catalyst
because there were a lot of questions if I want to install this or that.
Maybe I answered 'no' on Moose::Role.

But now it is fixed. Thanks anyway for your help!!

Stefan


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


AW: [Catalyst] Compress HTML

2011-09-11 Thread Stefan
Hi Bill,

I'm using the PageSpeed Plugin (from Google) in Firebug for Firefox. This
plugin measures the page speed and gives you some hint, how you can increase
the performance of your site.

And Google said, that they will also evaluate your page speed/performance
for page ranking because they want to make a faster internet.

 

One of the hints hint was, to minify the HTML source. So I did it and now
I've managed to get 100 points of 100 J

 

I'm also compressing with gzip (done by Apache), which is also a hint on
PageSpeed.

 

I think the combination of both is the best, because gzip compresses the
whole file to send over the net. And minify reduces the content which the
browser has to parse (also removes comments).

 

Stefan

 

 


use HTML::Packer;
use JavaScript::Packer;
use CSS::Packer;

my $html_packer = HTML::Packer-init();

sub process {
my ( $self, $c ) = @_;
my $rendered = $self-render($c, $c-stash-{template});
my $opts = {
remove_comments = 1,
remove_newlines = 1,
html5 = 1,
do_javascript = 'best',
do_stylesheet = 'minify',
};
$html_packer-minify( \$rendered, $opts );
$c-response-body($rendered);
}


___
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] Compress HTML

2011-09-08 Thread Stefan
Hi,

is there a module or a plugin to compress the html code?

 

I'm using Template Toolkit to generate the HTML. Now I want to remove all
useless chars from html (like comments, newline, tabulator, .) to improve
performance.

 

Does someone know, how this is possible?

 

Thanks

Stefan

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


AW: [Catalyst] Compress HTML

2011-09-08 Thread Stefan
Thanks Brian for the HTML::Packer link:
https://metacpan.org/module/HTML::Packer

I've now tested to implement the packer for each template parsing by
modifying the process function in my Catalyst::View::TT
(lib/MyApp/View/HTML.pm):

use HTML::Packer;

my $html_packer = HTML::Packer-init();

sub process {
my ( $self, $c ) = @_;
my $rendered = $self-render($c, $c-stash-{template});
my $opts = { 
remove_comments = 1,
remove_newlines = 1,
html5 = 1,
};
$html_packer-minify( $rendered, $opts );
$c-log-debug(Packed:  . $rendered);
$c-response-body($rendered);
}

But it seems that the html_packer has no effect, the debug output isn't
compressed.

Did I something wrong? Is the $opts hashref correct?

Thanks
Stefan



___
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] Compress HTML

2011-09-08 Thread Stefan
 Guess you should pass a ref to $rendered to minify(), not the string
itself.

Yes!!! Thanks a lot! This did it. Here is the complete code for others:

use HTML::Packer;
use JavaScript::Packer;
use CSS::Packer;

my $html_packer = HTML::Packer-init();

sub process {
my ( $self, $c ) = @_;
my $rendered = $self-render($c, $c-stash-{template});
my $opts = {
remove_comments = 1,
remove_newlines = 1,
html5 = 1,
do_javascript = 'best',
do_stylesheet = 'minify',
};
$html_packer-minify( \$rendered, $opts );
$c-response-body($rendered);
}

___
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] get_locale Bug

2011-08-29 Thread Stefan Profanter
Hi,

i've found a bug in CatalystX::I18N::Role::GetLocale when using the function

$c-get_locale();

 

If you set the User-Agent manually to something invalid with two words,
separated with a minus, the whole Server crashes.

Eg. use http://www.rexswain.com/httpview.html and set User-Agent to
hidden-agent and connect to a Server which is using get_locale(), Catalyst
crashes with an error (see below).

 

Could you help me correcting the bug?

 

Thanks

Stefan

 

Error Output:

Caught exception in MyApp::Controller::Root-auto Attribute
(browser_language) does not pass the type constraint because: Validation
failed for 'Maybe[CatalystX::I18N::Type::Language]' with value nagios at
accessor Moose::Meta::Class::__ANON__::SERIAL::19::browser_language (defined
at /usr/local/share/perl/5.10.1/CatalystX/I18N/TraitFor/Request.pm line 20)
line 18

 
Moose::Meta::Class::__ANON__::SERIAL::19::browser_language('Moose::Meta::Cla
ss::__ANON__::SERIAL::19=HASH(0x1b1b5508)') called at
/usr/local/share/perl/5.10.1/CatalystX/I18N/Role/GetLocale.pm line 74

 
CatalystX::I18N::Role::GetLocale::get_locale_from_browser('MyApp=HASH(0x1ae7
9638)') called at
/usr/local/share/perl/5.10.1/CatalystX/I18N/Role/GetLocale.pm line 153

 
CatalystX::I18N::Role::GetLocale::get_locale('MyApp=HASH(0x1ae79638)')
called at /home/stefan/MyApp/script/../lib/MyApp/Controller/Root.pm line 48

 
MyApp::Controller::Root::auto('MyApp::Controller::Root=HASH(0x1af57148)',
'MyApp=HASH(0x1ae79638)') called at
/usr/local/share/perl/5.10.1/Catalyst/Action.pm line 65

 
Catalyst::Action::execute('Catalyst::Action=HASH(0x1b07ee68)',
'MyApp::Controller::Root=HASH(0x1af57148)', 'MyApp=HASH(0x1ae79638)') called
at /usr/local/share/perl/5.10.1/Catalyst.pm line 1668

eval {...} called at
/usr/local/share/perl/5.10.1/Catalyst.pm line 1668

Catalyst::execute('MyApp=HASH(0x1ae79638)',
'MyApp::Controller::Root', 'Catalyst::Action=HASH(0x1b07ee68)') called at
/usr/local/share/perl/5.10.1/Catalyst/Action.pm line 60

 
Catalyst::Action::dispatch('Catalyst::Action=HASH(0x1b07ee68)',
'MyApp=HASH(0x1ae79638)') called at
/usr/local/share/perl/5.10.1/Catalyst/Controller.pm line 117

 
Catalyst::Controller::_AUTO('MyApp::Controller::Root=HASH(0x1af57148)',
'MyApp=HASH(0x1ae79638)') called at
/usr/local/share/perl/5.10.1/Catalyst/Action.pm line 65

 
Catalyst::Action::execute('Catalyst::Action=HASH(0x1b07cf58)',
'MyApp::Controller::Root=HASH(0x1af57148)', 'MyApp=HASH(0x1ae79638)') called
at /usr/local/share/perl/5.10.1/Catalyst.pm line 1668

eval {...} called at
/usr/local/share/perl/5.10.1/Catalyst.pm line 1668

Catalyst::execute('MyApp=HASH(0x1ae79638)',
'MyApp::Controller::Root', 'Catalyst::Action=HASH(0x1b07cf58)') called at
/usr/local/share/perl/5.10.1/Catalyst/Action.pm line 60

 
Catalyst::Action::dispatch('Catalyst::Action=HASH(0x1b07cf58)',
'MyApp=HASH(0x1ae79638)') called at
/usr/local/share/perl/5.10.1/Catalyst/Dispatcher.pm line 257

 
Catalyst::Dispatcher::_do_forward('Catalyst::Dispatcher=HASH(0x19ede418)',
'forward', 'MyApp=HASH(0x1ae79638)', '_AUTO') called at
/usr/local/share/perl/5.10.1/Catalyst/Dispatcher.pm line 237

 
Catalyst::Dispatcher::forward('Catalyst::Dispatcher=HASH(0x19ede418)',
'MyApp=HASH(0x1ae79638)', '_AUTO') called at
/usr/local/share/perl/5.10.1/Catalyst.pm line 377

Catalyst::forward('MyApp=HASH(0x1ae79638)', '_AUTO') called
at /usr/local/share/perl/5.10.1/Catalyst/Controller.pm line 99

 
Catalyst::Controller::_DISPATCH('MyApp::Controller::Root=HASH(0x1af57148)',
'MyApp=HASH(0x1ae79638)') called at
/usr/local/share/perl/5.10.1/Catalyst/Action.pm line 65

 
Catalyst::Action::execute('Catalyst::Action=HASH(0x1b06c4e0)',
'MyApp::Controller::Root=HASH(0x1af57148)', 'MyApp=HASH(0x1ae79638)') called
at /usr/local/share/perl/5.10.1/Catalyst.pm line 1668

eval {...} called at
/usr/local/share/perl/5.10.1/Catalyst.pm line 1668

Catalyst::execute('MyApp=HASH(0x1ae79638)',
'MyApp::Controller::Root', 'Catalyst::Action=HASH(0x1b06c4e0)') called at
/usr/local/share/perl/5.10.1/Catalyst/Action.pm line 60

 
Catalyst::Action::dispatch('Catalyst::Action=HASH(0x1b06c4e0)',
'MyApp=HASH(0x1ae79638)') called at
/usr/local/share/perl/5.10.1/Catalyst/Dispatcher.pm line 257

 
Catalyst::Dispatcher::_do_forward('Catalyst::Dispatcher=HASH(0x19ede418)',
'forward', 'MyApp=HASH(0x1ae79638)', '//_DISPATCH') called at
/usr/local/share/perl/5.10.1/Catalyst/Dispatcher.pm line 237

 
Catalyst::Dispatcher::forward('Catalyst::Dispatcher=HASH(0x19ede418)',
'MyApp=HASH(0x1ae79638)', '//_DISPATCH') called at
/usr/local/share/perl/5.10.1/Catalyst.pm line 377

Catalyst::forward('MyApp=HASH(0x1ae79638)', '//_DISPATCH')
called at /usr/local/share/perl/5.10.1/Catalyst/Dispatcher.pm line 105

 
Catalyst::Dispatcher::dispatch('Catalyst::Dispatcher=HASH(0x19ede418)',
'MyApp=HASH(0x1ae79638)') called at /usr/local/share/perl/5.10.1/Catalyst.pm
line 1614

[Catalyst] TT2 multiple subtemplates

2011-08-11 Thread Stefan Profanter
Hi Aristotele,
thanks for your answer.
The solution with the sidebar block seems also a good solution. I will take a 
loot at it!

Stefan


___
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] Remove X-Catalyst header (Apache)

2011-08-11 Thread Stefan Profanter
Hi,

i'm using Catalyst and Apache2 with mod_perl to create a new website.

But if I analyze the headers, there is always X-Catalyst 5.80033.

For security reasons I want to disable this header.

 

How can I remove it?

It seems that Catalyst adds it by default because in my files I can't find
anything like
$c-response-headers-header( 'X-Catalyst' = $Catalyst::VERSION );

or similiar.

 

Thanks!

Stefan

___
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] TT2 multiple subtemplates

2011-08-10 Thread Stefan
Hi,
I'm new at the catalyst framework and using Template Toolkit.

What is the best practice to load a template like the following:


html
body
div classleft
[% content %]
/div
div classright
[% right_content %]
/div
/body
/html

,content' should be replaced with left_content.tt2
,right_content' with right_content.tt2



If I use a Wrapper, only content is automatically replaced. How can I also
replace right_content?

 

Thanks for your Help!!

Stefan

___
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] TT2 multiple subtemplates

2011-08-10 Thread Stefan Profanter
Thank you a lot guys for your help!!
I've now find another solution by using the Wrapper directive
(http://template-toolkit.org/docs/manual/Directives.html#section_WRAPPER )
Where I can recursively parse the templates. I will now try to implement it
with one of your solutions or with WRAPPER.

Thanks!!
Stefan


___
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] Killing the standalone perl server programatically

2009-06-12 Thread Stefan Washietl
I'm developing a desktop application using Catalyst and the brand new 
Titanium framework (http://www.appcelerator.com/).


I need to start/stop the standalone server programatically. Starting is 
easy, but stopping the server (and its forks) again is tricky. I'd like 
a solution without keeping track of the PID and explicitely kill it from 
outside. I want to have something like


http://localhost:3000/kill

that calls something in the controller to shut down. The obvious thing

exit(0);

does not work. Any ideas how to do this?

Stefan

___
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] Killing the standalone perl server programatically

2009-06-12 Thread Stefan Washietl

 On Fri, Jun 12, 2009 at 6:50 AM, J. Shirley jshir...@gmail.com
 mailto:jshir...@gmail.com wrote:

ou'll have to grab Catalyst::Engine::HTTP::Prefork out of svn, or
prod andyg enough so he releases (HEY ANDY!)
http://dev.catalystframework.org/repos/Catalyst/trunk/Catalyst-Engine-HTTP-Prefork/


Thank you. I'll have a look at this solution. It is probably a good idea 
to use Engine::HTTP::Prefork anyway instead of the simple 
test/development-server.



J. Shirley wrote:
On Fri, Jun 12, 2009 at 6:50 AM, J. Shirley jshir...@gmail.com 
mailto:jshir...@gmail.com wrote:


On Fri, Jun 12, 2009 at 6:19 AM, Stefan Washietl w...@paperpile.org
mailto:w...@paperpile.org wrote:

I'm developing a desktop application using Catalyst and the
brand new Titanium framework (http://www.appcelerator.com/).

I need to start/stop the standalone server programatically.
Starting is easy, but stopping the server (and its forks) again
is tricky. I'd like a solution without keeping track of the PID
and explicitely kill it from outside. I want to have something like

http://localhost:3000/kill

that calls something in the controller to shut down. The obvious
thing

exit(0);

does not work. Any ideas how to do this?

Stefan


I just set this up with a combination of HTTP::Prefork and
FCGI::Engine::Manager.  I'm still floundering away a bit at a
refactor of FCGI::Engine::Manager that is semantically more sound,
but it works well enough right now.

You'll have to grab Catalyst::Engine::HTTP::Prefork out of svn, or
prod andyg enough so he releases (HEY ANDY!)

http://dev.catalystframework.org/repos/Catalyst/trunk/Catalyst-Engine-HTTP-Prefork/


Here's all the yummy bits from my setup: http://gist.github.com/128642

You can just run script/myapp_admin.pl start|stop

One thing, I copied the script/myapp_server.pl over to
script/myapp_prefork.pl and changed the default CATALYST_ENGINE to
HTTP::Prefork.

This is because I couldn't figure out a clean way to set the ENV in
FCGI::Engine::Manager::Server classes, but it's a temporary hack
until I wrap that up.

Hope this helps,


I forgot to finish this off, you can have the kill action then run the 
stop command and then everything is going from the same point.  Just 
executing a system call to kill it means that the current request should 
finish cleanly, along with everything else.


It may be overkill, but that's how I'd do it (just so any post-shutdown 
scripts are always executed, etc)


-J




___
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 on Windows: fork issues

2009-02-27 Thread Stefan Washietl
Thanks for all your tips. I will have a look at Apache. It also seems to 
be quite lightweight and it seems to be better supported under Windows 
than lighttpd.


Rodrigo wrote:
Stefan, I've had similar problems in windows with prefork, which can be 
started up after some tweaking, but will hang after a few requests. 
Perl's fork() is a no-no in windows. FCGI can be painful to setup, so I 
ended up giving up on it. I went on to use mod_perl with Apache, which 
has problems of its own too, but a more trivial setup. Finally, the 
approach I'm using right now is to setup a pool of single-threaded 
Catalyst dev servers, starting them up in a startup.bat such as this:


start /b perl script\myapp_server.pl -p 3000
start /b perl script\myapp_server.pl -p 3001
start /b perl script\myapp_server.pl -p 3002
...

If you wish to keep all your logs in one place:

startup.bat myapp.log 21

Then setup an Apache mod_proxy load-balancer (or lighttpd's, etc.) to 
balance the load among dev servers. Make sure you understand the 
drawbacks of using catalyst dev servers in this manner, even though they 
work superbly.


httpd.conf (or apache2.conf or etc.):

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so

Proxy balancer://cat
  BalancerMember http://localhost:3000
  BalancerMember http://localhost:3001
   BalancerMember http://localhost:3002
/Proxy

ProxyPass / balancer://cat/
ProxyPassReverse / balancer://cat/

Take a look around the web for other settings that you may need, such as 
catalyst's using_frontend_proxy and apache's static aliases, balancer 
features, etc. Apache is extremely lightweight if you only run it for 
reverse proxy load-balancing.


If you want to startup your catalyst server pool from a windows service 
using a configuration file, I have a perl script that does that 
somewhere. Just let me know.


Hope this works for you.

--rodrigo





___
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] problem installing Catalyst

2008-03-08 Thread stefan . petrea

Hi,

I've installed some time ago Catalyst on a server.
I've coded some bits of code with it and it worked okay.
After some time I decided to try a project from some site,
this one http://dab.free.fr/wp/?p=66
It has a .tgz with the code.

And I got some errors regarding the fact that I needed to
install some modules.
I did that via cpan until I got to this error.
If I delete the module cached in /root/.cpan as the error message
suggests and I retry to install the module this doesn't work either.
What should I do ?

cpan  force install Catalyst::Plugin::Authorization::Roles
Running install for module Catalyst::Plugin::Authorization::Roles
Running make for 
N/NU/NUFFIN/Catalyst-Plugin-Authorization-Roles-0.05.tar.gz
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
  
ftp://ftp.roedu.net/pub/CPAN/authors/id/N/NU/NUFFIN/Catalyst-Plugin-Authorization-Roles-0.05.tar.gz

Checksum mismatch for distribution file. Please investigate.

Distribution id = 
N/NU/NUFFIN/Catalyst-Plugin-Authorization-Roles-0.05.tar.gz
CPAN_USERID  NUFFIN (Yuval Kogman [EMAIL PROTECTED])
CALLED_FOR   Catalyst::Plugin::Authorization::Roles
CONTAINSMODS Catalyst::Plugin::Authorization::Roles
MD5_STATUS
force_update 2
incommandcolor 1
localfile
/root/.cpan/sources/authors/id/N/NU/NUFFIN/Catalyst-Plugin-Authorization-Roles-0.05.tar.gz

I'd recommend removing

/root/.cpan/sources/authors/id/N/NU/NUFFIN/Catalyst-Plugin-Authorization-Ro
les-0.05.tar.gz. Its MD5
checksum is incorrect. Maybe you have configured your 'urllist' with
a bad URL. Please check this array with 'o conf urllist', and
retry.



___
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] Google Summer of Code

2008-02-26 Thread Stefan Petrea
erm,I would like to ask the following:
Are you reffering to building a framework used to create social networking
sites ?
Or to create something that analyses the social network site which already
exists ?

On Tue, Feb 26, 2008 at 3:09 PM, Kieren Diment [EMAIL PROTECTED] wrote:

 On Wed, Feb 27, 2008 at 8:07 AM, Matt Pitts [EMAIL PROTECTED] wrote:
 
   I'm far from being a student, so I couldn't participate via SOC, but I
   did start to write an all-encompassing library to access Google's GData
   API a while back for a social networking site that I wanted to launch.
 I
   didn't get very far into the project before life took over, but I'd
   enjoy getting involved in something like that again.
 
   Add me to your list of interested folks.
 

 Now, we do need a sponsoring organisation for this, so non students
 who can claim to be an organisation who want to sponsor this need to
 step up too.  One of the disadvantages of not having a catalyst
 foundation :-(

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

2008-02-02 Thread Stefan Petrea
On Friday 01 February 2008 16:20, Jonathan Rockway wrote:

some people have done similar things.
maybe take a look here http://www.greenteapress.com/
they've written free books under GNU license and they charge
only for printed copies just as you say.

 * On Fri, Feb 01 2008, Matt Rosin wrote:
  Possibly companies that wish to give back to open source could
  contribute to a professional documentation fund. In this case digital
  publication will enable the money to be used most efficiently.
 
 Yes, this is a good idea.  We were talking about this on #moose
 yesterday and the idea of having TPF fund book writing via grants might
 be a good way to get docs.  The author gets $2000 for writing a
 half-length book (say, 150 pages), the community gets a freely-licensed
 book to do whatever they want with.  If you want a printed copy, you can
 donate money (say, $10) back to TPF.
 
 I will probably look into this more seriously in the near future.  Right
 now this is pure fantasy :)
 
 Regards,
 Jonathan Rockway
 
 ___
 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] Helper classes shared across multiple controllers - any recommendations?

2007-10-10 Thread Stefan Kühn
Yes, it looks nice.

But could you also add controller specific functionality, like so?

===
package TestApp::Controller::Adaptor;
use strict;
use warnings;

use base 'TestApp::BaseController::Adaptor';

__PACKAGE__-config( model = 'SomeClass' );

sub method_A : Local {
  my ( $self, $c ) = @_;
  # ...
}

sub method_B: Local {
  my ( $self, $c ) = @_;
  # ...
}

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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/