Re: [Catalyst] correct module name for generated tests when generating static schema/model?
actually it should be use_ok('Engoi::Schema::EngoiDb::Attributes'); On 7/3/06, Daniel McBrearty [EMAIL PROTECTED] wrote: I am trying to use this command script/engoi_create.pl model Schema DBIC::Schema Engoi::Schema::EngoiDb create=static ... to make my model with a seperate static schema. Everything seems AOK: exists /home/daniel/work/trunk/Engoi/script/../lib/Engoi/Model exists /home/daniel/work/trunk/Engoi/script/../t Dumping manual schema for Engoi::Schema::EngoiDb to directory /home/daniel/work/trunk/Engoi/script/../lib ... Schema dump completed. exists /home/daniel/work/trunk/Engoi/script/../lib/Engoi/Model/Schema.pm I find my generated Schema under lib/Engoi/Schema/EngoiDb, and it seems to work OK with teh generated model, ... BUT the generated tests contain this: use Test::More tests = 2; use_ok( Catalyst::Test, 'Engoi' ); use_ok('Engoi::Model::Schema::Attributes'); which fails because it should actually be use_ok('Engoi::Schema::Attributes'); what am I doing wrong ... ? cheers D -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] testing the model - example code please?
can someone point please me at an app that uses a static model MyApp::Schema::MyDB::Whatever and also does unit testing in the corresponding classes t/model_Schema-whatever.t I have the model generated and working, I've discovered how useful it can be to extend those classes ... but i have a bit of a mental block about writing test cases. I'd like to see some good examples to get the brain working ... thanks Daniel -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] [Announce] iusethis.org goes into public beta.
It looks neat. I'm not a mac user, so it isn't much use to me right now ... but I like the design of the site. I'll take a look at the mojo source soon - I think I looked at all the example apps on the wiki a week or so back, looking to see how people test the model part of there apps, but I think all I found were default generated model_blahblah.t files. But maybe that has changed ... or I didn't look hard enough ... good luck with that! D -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Sigh. How do we get on this list?
FWIW ... I looked at ROR about a year back for engoi. I thought it was kind of shiny, but not particularly flexible, and the unclear status of unicode support in Ruby made it all a no-no as far as I could tell. Cat is still in fairly early days, and teh learning curve is tough. But it looks well thought out and things are getting better. Once we sort our own stuff out a bit more, hopefully we'll be able to contribute to that. Sometimes it seems that the s/w business is a bit like the music one. Everyone is always chasing the latest thing. But is that what matters, or wins, in the long haul? Before you wish for something, it's worth asking yourself _why_ you want it. D -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] [OT] unified diffs
you mean to get as many chat windows as poss ;-) On 8/13/06, Matt S Trout [EMAIL PROTECTED] wrote: Rodney Broom wrote: The reason for -u diffs... Aha, -u. New patches atached. Right, since we ended up about 15 messages deep in a thread, can you re-post this as a diff -urP to a fresh thread so we can discuss it properly? The reason for the 80 char limit is effectively stylistic right up until something goes badly wrong and you have to fix a system on the fly over a bog-end console that does the traditional 80x25. Then anything 80 chars is a complete pain in the ass. It also annoys the living crap out of people like me who work at 80x25 anyway in order to get as many xterms on screen as possible (see http://trout.me.uk/screenshot.jpg for my development setup :) ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] ways to do stuff and why
following this with interest. I'm a beginner at this stuff, but the way I am seeing the problem goes something like this: 1. devise a schema for the data that needs storing that is as robust and future proof as I can make it. 2. figure out how the front end logic wants to see that data to make life easy. In other words, what interface objects/methods will make a decent job of hiding the internal complexities of the data from the Controller? What objects should exist? 3. have another look at the schema and align the two ways of looking at the data where appropriate. Then implement code on top of the model to bridge the two views, implement the API, and protect the db against crap data ... -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] how to get started?
FWIW I'd agree with what Max said. The first time I installed cat on a fresh system it drove me nuts. The second time it was alot easier. I'm just using normal CPAN. The biggest hassle is normally an external xxx-dev library that is needed, it can be a bit of detective work to discover which (installing apt-file helps). I have also had one issue with something that wouldn't install due to a bug in a module that got fixed wthin a day. Anyhow, you regularly need to install or update various packages off of CPAN, so I figure its worth knowing what is what, and also being there to keep an eye on what os going in there. Next time I do it I will use a fresh system and make a vmware image of the raw system. I regret not doing that this time. D On 8/21/06, A. Pagaltzis [EMAIL PROTECTED] wrote: * Steve Atkins [EMAIL PROTECTED] [2006-08-21 20:20]: No. I really don't like using anything other than cpan to install perl modules if I can possibly avoid it. I'm close to making an exception for catalyst, though, so I may give cat-install a try. You didn't even look at it, did you? (IIRC it's basically a wrapper script around CPAN ?) I don't know if I'd call it a wrapper. I suppose you could. It sets up some overrides to automatically answer the setup questions of some of the modules involved and then uses the CPAN.pm API to drive an automatic installation. Works flawlessly for me every time. Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Can't find 'Catalyst::Plugin::SessionStateTest'
it's usually easier to let cpan find the distribution itself. try : cpan install My::Module it will usually then try to install dependencies after asking you Daniel On 8/22/06, Samuel Baechler [EMAIL PROTECTED] wrote: hi guys it was a hard work for me too to get Catalyst to work, :). now i am going through some tutorials. currently i'm going through 'Catalyst::Manual::Tutorial'. when i do a 'script/myapp_server.pl' my computer complains that some plugins are missing. so i went to install them. but now i reached a point where i don't know what to do. the trouble began when i wanted to install 'Catalyst-Plugin-Session-Store-FastMmap' manually (before i tried also 'cpan install Catalyst-Plugin-Session-Store-FastMmap'). i downloaded 'Catalyst-Plugin-Session-Store-FastMmap' from the web, unpacked it and did 'perl Makefile.PL'. as i typed 'make test' my computer said 'Couldn't load plugin Catalyst::Plugin::SessionStateTest'[1]. when i go to search.cpan.org i am not able to find any plugin with the name 'Catalyst::Plugin::SessionStateTest'. could anybody give me a hint what i can try next. thanks in advance for your help. sam [1] ~/Catalyst-Plugin-Session-Store-FastMmap-0.02# make test PERL_DL_NONLAZY=1 /usr/bin/perl -MExtUtils::Command::MM -e test_harness(0, 'blib/lib', 'blib/arch') t/*.t t/01useok t/02podskipped all skipped: set TEST_POD to enable this test t/03podcoverageskipped all skipped: Test::Pod::Coverage 1.04 required t/basicok 1/19Couldn't load plugin Catalyst::Plugin::SessionStateTest, Can't locate Catalyst/Plugin/SessionStateTest.pm in @INC (@INC contains: /home/samuel/Desktop/Catalyst-Plugin-Session-Store-FastMmap-0.02/blib/lib /home/samuel/Desktop/Catalyst-Plugin-Session-Store-FastMmap-0.02/blib/arch /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 .) at /usr/local/share/perl/5.8.8/Catalyst.pm line 2099. at t/basic.t line 10 BEGIN failed--compilation aborted at t/basic.t line 15. # Looks like you planned 19 tests but only ran 2. # Looks like your test died just after 2. t/basicdubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 3-19 Failed 17/19 tests, 10.53% okay Failed Test Stat Wstat Total Fail Failed List of Failed --- t/basic.t255 6528019 34 178.95% 3-19 2 tests skipped. Failed 1/4 test scripts, 75.00% okay. 17/20 subtests failed, 15.00% okay. make: *** [test_dynamic] Error 255 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Can't find 'Catalyst::Plugin::SessionStateTest'
h. thanks. as it happens, I *did* wonder what all that juno crap was about :-) On 8/22/06, A. Pagaltzis [EMAIL PROTECTED] wrote: * Jonathan Rockway [EMAIL PROTECTED] [2006-08-22 20:00]: cpan My::Module Another::Module is the correct invocation. Or you can pass `-i` to be explicit: cpan -i My::Module Another::Module Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Multilanguage application
sub lang : Chained('/') CaptureArgs(1) PathPart(''){ my ($self, $c, $lang) = @_; # need to check that $lang is valid and handle that here if (valid($lang)) { } else { } } sub doit : Chained('lang') Args(0) { my ($self, $c) = @_; } this now matches /*/doit, and doit needs to be able to rely on the language being in the stash. in fact there are a number of ways the language can be detected. For me, these are (highest priority first) ... : 1. the uri 2. the session (maybe, i'm thinking about this ... the argument is that the user shouldn't have to manually set the language twice while a cookie persists). 3. the browser settings. so we need to try these in turn ... as soon as we get a valid value, set it in the session/stash where all downstream actions get it. On 8/10/06, Matt S Trout [EMAIL PROTECTED] wrote: Renaud Drousies wrote: On Thu, August 10, 2006 4:39 pm, Matt S Trout said: sub lang :Chained('/') :CaptureArgs(1) :PathPart('') { my ($self, $c, $lang) = @_; set lang appropriately } sub foo :Chained('/lang') :Args(0) { # /en/foo etc. Chained was designed to support this sort of stuff without the need for prepare_path hacks, which I've used before but always found a tad ugly. But then I am not sure to understand how to dispatch actions correctly to different controllers. This looks like all actions must be defined in the same controller. No, that sub foo could be in any controller. If I have that 'sub lang' in my Root controller, how can I reach my original 'sub index: Private' in MyApp::C::Foo (or any other action defined there) so that the Foo controller is used when I request /en/foo? read the Catalyst::DispatchType::Chained POD first. If you still have questions, ask 'em then :) ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Multilanguage application
that's what I'm thinking AP. cheers. lang Chained('/) looks in the uri. If it succeeds, it sets stash/session too. If it fails it redirects to /default which checks session and redirects, or browser then set session and redirect. If all else fails show a chooser page. On 8/25/06, A. Pagaltzis [EMAIL PROTECTED] wrote: * Daniel McBrearty [EMAIL PROTECTED] [2006-08-25 12:10]: in fact there are a number of ways the language can be detected. For me, these are (highest priority first) ... : 1. the uri 2. the session (maybe, i'm thinking about this ... the argument is that the user shouldn't have to manually set the language twice while a cookie persists). 3. the browser settings. Using the session and browser settings are fine; but best is if you implement them using redirection. Ie. when someone visits the site, and their session says they want French, you redirect them to `/fr/$whatever`. Ideally, only the front page of the site has a language-less URI, and only there do you redirect. Then whatever other URI they might bookmark will always have a language code, so on subsequent pages the problem doesn't come up at all. Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Spending time with Catalyst (slightly OT)
damn. I was looking at GWT this morning and thinking a bit the same. But we will likely end up writing js/css/html by hand. any tips, shortcuts, experiences would be interesting to read though. On 9/9/06, Matthieu Codron [EMAIL PROTECTED] wrote: Hi everyone, I routinely develop Catalyst stuff for my own purposes and I find out that I am spending much more time actually working on the client side stuff ( HTML, CSS and Javascript ) than on the server side. Have some of you the same feeling? Ever since playing with Ajax stuff, I have the firm impression that while I now have a decent framework on the server side, the client side is now where I spend most of my development time ... Can (or will) Catalyst encompass some client-side aspects? I have been using HTML::Prototype but I have not found any added value. As for javascript frameworks, I use Prototype and script.aculo.us. I have considered Dojo but the documentation is kind of lacking ... I seek therefore your advice, because I want to develop mostly Perl stuff and not spend days writing (unmaintaineable) Javascript. To me Google's approach (in GWT) with the Java to Javascript seems like a one (somewhat elegant) way to handle this ... What do you think? -- Matthieu ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Hosting options, please recommend
get a virtual machine at bytemark.co.uk slightly more than el cheapo shared hosting but root access and do what the hell you like with it. good customer service too. On 9/10/06, Kieren Diment [EMAIL PROTECTED] wrote: It recently came up on IRC, and Dreamhost aside there seems to be a lack of information on who will host catalyst on FastCGI in a shared environment. Please can you use this thread to provide your recommendation/warning. Bear in mind that this is likely to become a page on the wiki if we get a response. Personally I'm particularly interested if I can get catalyst hosting in a green data centre, but that's my boat that I've got to float. Your replies here please ladies and gentlemen. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Hosting options, please recommend
haven't tried it yet. at the moment i run cgis under mod_perl processes (15MB each), and an sql server. no problem. I don't expect things to get *that* huge under cat. i guess you'll do a test deploy on your dev box and see how big things get before you make any fimal decisions? On 9/13/06, Nigel Metheringham [EMAIL PROTECTED] wrote: On Sun, 2006-09-10 at 14:46 +0200, Daniel McBrearty wrote: get a virtual machine at bytemark.co.uk slightly more than el cheapo shared hosting but root access and do what the hell you like with it. Have you run cat on one of their servers? I'm interested to know how well a cat app would run in 80MB... [I guess I can experiment in a vmware environment, but UML has a different memory profile] Nigel. -- [ Nigel Metheringham [EMAIL PROTECTED] ] [ - Comments in this message are my own and not ITO opinion/policy - ] -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Hosting options, please recommend
do you run under mod_perl or fastcgi? On 9/13/06, Nigel Metheringham [EMAIL PROTECTED] wrote: On Wed, 2006-09-13 at 11:00 +0200, Daniel McBrearty wrote: haven't tried it yet. at the moment i run cgis under mod_perl processes (15MB each), and an sql server. no problem. I don't expect things to get *that* huge under cat. i guess you'll do a test deploy on your dev box and see how big things get before you make any fimal decisions? I've got an app running on a home box. I'll instrument it a bit better and work out what its up to (currently theres a python app running in mod_python as well, so need to split that out). Cheers Nigel. On 9/13/06, Nigel Metheringham [EMAIL PROTECTED] wrote: On Sun, 2006-09-10 at 14:46 +0200, Daniel McBrearty wrote: get a virtual machine at bytemark.co.uk slightly more than el cheapo shared hosting but root access and do what the hell you like with it. Have you run cat on one of their servers? I'm interested to know how well a cat app would run in 80MB... [I guess I can experiment in a vmware environment, but UML has a different memory profile] Nigel. -- [ Nigel Metheringham [EMAIL PROTECTED] ] [ - Comments in this message are my own and not ITO opinion/policy - ] -- [ Nigel Metheringham [EMAIL PROTECTED] ] [ - Comments in this message are my own and not ITO opinion/policy - ] ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] [OT] building perl with threads
now I have the hang of building apache/perl from source ... what's the rationale behind the perl is normally built with thread support OFF in a production environment? is that what is recommended for cat under mod_perl / fastcgi? -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] [OT] building perl with threads
thanks Toby. On 9/30/06, Tobias Kremer [EMAIL PROTECTED] wrote: Daniel McBrearty schrieb: now I have the hang of building apache/perl from source ... what's the rationale behind the perl is normally built with thread support OFF in a production environment? is that what is recommended for cat under mod_perl / fastcgi? AFAIK, if you don't really need threads you should not enable them because this could have an impact on the overall performance of your webapp. So to answer your questions: Yes, it's recommended to compile perl without any kind of thread-support for best Catalyst performance. --Toby ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] getting the db connection used by catalyst
if you have a (dbix) database, and use it as a model, you generally end up doing this : $c-model- and the database connection is handled internally. I now want to write another model which uses the db. It would be better to use the existing connection that cat has created, rather than create another one. If I write a new() method for this model, does it have access to the context? what is a good way to do this? -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] getting the db connection used by catalyst
basically it does some fancy processing on the db and caches the results. initially, that will be it. It will present a number of convenience methods, which can be used to access either the db or cached data. There will likely be some methods to write to the db, again convenience stuff. On 10/4/06, Brandon Black [EMAIL PROTECTED] wrote: On 10/3/06, Daniel McBrearty [EMAIL PROTECTED] wrote: if you have a (dbix) database, and use it as a model, you generally end up doing this : $c-model- and the database connection is handled internally. I now want to write another model which uses the db. It would be better to use the existing connection that cat has created, rather than create another one. If I write a new() method for this model, does it have access to the context? what is a good way to do this? What kind of model is your new model, and how will it use/store/whatever the $dbh? There are a lot of ways to do what you're talking about in general, it all depends on what's right for your design. Be aware that once you take the raw $dbh from DBIC and start using it yourself, you lose all of its fancy connection management. -- Brandon ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] getting the db connection used by catalyst
I have. Could do it either way, but on the whole I prefer to seperate the two. Even if I did that, I think I'd have the same question - how to get a connection without creating a new one. On 10/4/06, Andreas Marienborg [EMAIL PROTECTED] wrote: I assume you have considered adding this to your dbic-schema? If it is all to deal with the same DB, and the same structures, you might benefit from that. andreas On 4. okt. 2006, at 04.27, Daniel McBrearty wrote: basically it does some fancy processing on the db and caches the results. initially, that will be it. It will present a number of convenience methods, which can be used to access either the db or cached data. There will likely be some methods to write to the db, again convenience stuff. On 10/4/06, Brandon Black [EMAIL PROTECTED] wrote: On 10/3/06, Daniel McBrearty [EMAIL PROTECTED] wrote: if you have a (dbix) database, and use it as a model, you generally end up doing this : $c-model- and the database connection is handled internally. I now want to write another model which uses the db. It would be better to use the existing connection that cat has created, rather than create another one. If I write a new() method for this model, does it have access to the context? what is a good way to do this? What kind of model is your new model, and how will it use/store/ whatever the $dbh? There are a lot of ways to do what you're talking about in general, it all depends on what's right for your design. Be aware that once you take the raw $dbh from DBIC and start using it yourself, you lose all of its fancy connection management. -- Brandon ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/ catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] getting the db connection used by catalyst
maybe I'm worrying too much about reusing the catalyst connection - I could just get a connection in new() and keep a ref to it there, and use that whenever needed. I don't know much about what goes on internally, or how much overhead each connection has with it ... On 10/4/06, Daniel McBrearty [EMAIL PROTECTED] wrote: I have. Could do it either way, but on the whole I prefer to seperate the two. Even if I did that, I think I'd have the same question - how to get a connection without creating a new one. On 10/4/06, Andreas Marienborg [EMAIL PROTECTED] wrote: I assume you have considered adding this to your dbic-schema? If it is all to deal with the same DB, and the same structures, you might benefit from that. andreas On 4. okt. 2006, at 04.27, Daniel McBrearty wrote: basically it does some fancy processing on the db and caches the results. initially, that will be it. It will present a number of convenience methods, which can be used to access either the db or cached data. There will likely be some methods to write to the db, again convenience stuff. On 10/4/06, Brandon Black [EMAIL PROTECTED] wrote: On 10/3/06, Daniel McBrearty [EMAIL PROTECTED] wrote: if you have a (dbix) database, and use it as a model, you generally end up doing this : $c-model- and the database connection is handled internally. I now want to write another model which uses the db. It would be better to use the existing connection that cat has created, rather than create another one. If I write a new() method for this model, does it have access to the context? what is a good way to do this? What kind of model is your new model, and how will it use/store/ whatever the $dbh? There are a lot of ways to do what you're talking about in general, it all depends on what's right for your design. Be aware that once you take the raw $dbh from DBIC and start using it yourself, you lose all of its fancy connection management. -- Brandon ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/ catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] getting the db connection used by catalyst
ok. thanks. what is the magic? is its behaviour in one of the perldocs? On 10/4/06, Matt S Trout [EMAIL PROTECTED] wrote: Daniel McBrearty wrote: I have. Could do it either way, but on the whole I prefer to seperate the two. Even if I did that, I think I'd have the same question - how to get a connection without creating a new one. $storage-dbh DO NOT CACHE THAT Grab it each time, then you benefit from all of DBIC's reconnection magic. -- Matt S Trout Offering custom development, consultancy and support Technical Directorcontracts for Catalyst, DBIx::Class and BAST. Contact Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ + ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Is Catalyst what I want?
solve the problem you have today ... On 10/27/06, Marcello Romani [EMAIL PROTECTED] wrote: Jeremiah Foster ha scritto: Hi there, I discovered catalyst while looking for a simple JavaScript code snippet to activate a checkbox immediately. I read a bit on cpan and Catalyst seems to use some of my favorite perl glue, like DBI, CGI, and Template toolkit. But do I want a full blown framework? Or do I just want a simple JavaScript function? -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] using Plugin::Singleton and testing
I have a method in a model that goes like this: sub do_something { my ($self, $my_var) = @_; $my_var = MyApp-context-stash-{my_var} unless defined $my_var; die my_var not defined unless defined $my_var; . . . } so my_var gets it's value by the arg, the stash or gives up and causes an error. This seems to work fine. Now in my test script, I use the app ... use MyApp; and I want to set the stash in test code. I don't want to mock the whole of MyApp, because that is being used to get the database via the model elsewhere my $schema = MyApp-model('Db')-schema; and I'd rather leave that in place. How can I just mock the context/stash but leave the rest of MyApp in place? -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Announce. Catalyst::Plugin::I18N::DBIC 0.01
Hi Ian We seem to be on the same lines. We already have an app that allows translators to work online and so on - it's crap, but we learnt some useful stuff, and the next (cat based) one will be way better. I'll drop you a line off-list when I can and we'll discuss it further. cheers On 11/15/06, Ian Docherty [EMAIL PROTECTED] wrote: Daniel We are still at an early stage in terms of learning how to provide i18n and I produced this module as much as a 'proof of concept' as anything else. I would be very interested in discussing what you have been doing but it may be best to move the discussion out of this forum unless it is specific about Catalyst. Do you, or anyone else interested in this discussion, want to reply to me directly? As you say, the plugin to get information from the database is easy. What is difficult is the way that the data in the schema is maintained and updated and how translation is managed etc. I presume that this is what you are referring to. I anticipate creating a mini-app that will allow a translator to make changes to the database code and view the result immediately in the application. Regards Ian C. Docherty (ICD) Daniel McBrearty wrote: I'm sorry I didn't see this earlier. We also have translated text stored in the db, and have evolved a schema to cope with that. We are not using the cat-i18n plugin at the moment though - we wrote our own to use our schema. At some point though we'd like to share some of the stuff that we've learned and use the communal code where possible. I'd be interested to see the schema and see how it compares with what we are doing. This was the area that I found trickiest - the plugin to grap stuff out of the schema is realatively easy. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: using Plugin::Singleton and testing
A global is something that is in the global namespace. A singleton isn't, any more than other class is. You have to import the class to which it belongs to use it. Noone mentioned making the *stream* a singleton. I'd expect to find teh *stream* at OS level. It's just that an audio *player* is a better example of something that you might want to be assured that there can only be one *instance* of. Until someone actually presents a solid reason why you should *never* have a class which can only have a single instance, the argument is going nowhere, as far as I can see. (apologies for polluting the list with this rather OT stuff ...) On 11/17/06, Adam Clarke [EMAIL PROTECTED] wrote: On 17/11/2006, at 4:37 PM, Jonathan Rockway wrote: On Thursday 16 November 2006 20:08, A. Pagaltzis wrote: A singleton is nothing but a global variable, except the identifier comes from the class namespace rather than the variable namespace. Put it in a global variable already. Not entirely true. Try this: $global = Oops, accidentally overwrote the instance with garbage.; vs. Singleton-get_instance() = Oops, accidentally overwrote the instance.; Not really, because ... use Readonly; Readonly my $global = Warming; print Before = $global\n\n; eval { $global = Oops, accidentally overwrote the instance with garbage.; }; if ($@) { print Error (would have died if uneval'd) = [EMAIL PROTECTED]; }; print After = $global\n; produces ... Before = Warming Error (would have died if uneval'd) = Modification of a read- only value attempted at t.pl line 8 After = Warming No matter what my prime minister says. Cheers -- Adam Clarke www.strategicdata.com.au ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: using Plugin::Singleton and testing
On 11/17/06, A. Pagaltzis [EMAIL PROTECTED] wrote: * Daniel McBrearty [EMAIL PROTECTED] [2006-11-17 12:00]: A global is something that is in the global namespace. A singleton isn't, any more than other class is. You have to import the class to which it belongs to use it. That might be true in Java. It's patently false in Perl. (file MySingleton.pm) package MySingleton; ... sub get_instance { # the standard stuff ... } 1; (EOF) please explain how it is possible to get hold of this object without doing use MySingleton; my $s = MySinglton-get_instance; (assuming that you don't deliberately export into the global namespace, which can be the case with any class) Until someone actually presents a solid reason why you should *never* have a class which can only have a single instance, the argument is going nowhere, as far as I can see. No, I think the onus is the other way around. I'd like to hear about a case that is much more sensibly be solved using a singleton class rather than by other means of ensuring uniqueness in a higher level of the infrastructure. I don't want to claim that there is no circumstance in which singletons are useful; I argue with people who claim that every use of GOTO is evil, too. But I doubt that singletons are even as useful as GOTO, in practice. So my original example : say we have an application that streams audio, and only one source may be streamed at a time. Having more than one player instance in existence could violate this on many OS's. Even if the OS would cause an error (due to more the resource being busy when it starts up), you just don't want it to happen. How would you design this? Or are we arguing about definitions? By my thinking, any class which can have only one instance is, by definition, a singleton. Are you arguing against this ever being done, or against certain implementations of this? -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: using Plugin::Singleton and testing
You generally design systems with initial constraints in mind. You might very well design an application with the idea that there is one control surface (keyboard), one (visual) monitor and one set of speakers which will receive one signal. It would really not be uncommon in some apps to take this view, the cost of hardware being what it is. It's not about having a number of soundcards - one soundcard can mix many sources anyhow. In this type of app it would be about restricting the number of signals that can be heard, and knowing that you will never have more speakers than you will have PCs/applications. And I don't see why a singleton is not a proper object; it hides it's implementation from the outside, encapsulates data and code, presents an API which can be used to control or restrict the way it is used, and so on. The fact that the number of instances is limited is neither here nor there. Are there no real world classes of objects of which there are only one instance? The point is not that the idea may be open to abuse - all tools are. (We've all seen OO systems that are terrible just because of clueless design.) The point is not throwing out the baby with bathwater. There is a world of difference between singleton open to misuse and singleton considered a bad idea. I don't see one argument in that article that is powerful enough to wish to throw the tool away. In some ways the argument is similar to the arguments often given against perl by those that dislike it (funny syntax ... encourages poor code ... ) when those that know better know that the bad code comes out of the coder, not the language. On 11/17/06, Nilson Santos Figueiredo Junior [EMAIL PROTECTED] wrote: On 11/17/06, Daniel McBrearty [EMAIL PROTECTED] wrote: So my original example : say we have an application that streams audio, and only one source may be streamed at a time. Having more than one player instance in existence could violate this on many OS's. Even if the OS would cause an error (due to more the resource being busy when it starts up), you just don't want it to happen. How would you design this? Right. But then you are on system with two sound cards and suddenly you're able to stream two sources at the same time. Suddenly, you'll find the need for proper objects, since now you'd need one instance per sound card. I think this is the point the guy who wrote the linked rant was trying to get at. People use Singletons due to lack of foresight since, eventually, they will need to have more than one instance. Of course this is not always true and you might really only need one instance ever, but since using Singletons inherently breaks some cases of reusability and is against fundamental OO theory, it's a practice that should be avoided. -Nilson Santos F. Jr. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] use MyApp without console output in script?
ahhh ... yes. silly me. (it was only the sane bit that was hard to do ... ;) On 11/29/06, Matt S Trout [EMAIL PROTECTED] wrote: Daniel McBrearty wrote: Hi if I use MyApp; in a script, is there a way to stop all the usual console out that happens ? Take -Debug out of the use line and enable it selectively like a sane person. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] RE: setting up project where web application (Catalyst) is only a part
I am using the layout as setup by the catalyst.pl script. I put modules as needed in the MyApp space under lib. Any extra scripts for generating static stuff or whatever lives in scripts. I add a db directory that has a schema and other stuff like a script for migrating db's in it. I add test scripts to the t dir as I go. What the script gives is quite a good template IMO, and it is close to that used by many cpan modules and all. What confused me at first was that I was not that familiar with that way of working, I had my own odd ways. I'm slowly getting to know and use the conventions more. HTH Daniel On 12/4/06, Hermida, Leandro [EMAIL PROTECTED] wrote: Hello, Sorry for sending this post again but I got zero responses to it. Does anyone have any advice for setting up the folder layout for a self-contained Perl project where the Catalyst app is only part and I have external scripts, programs, services that would need to reference libraries which catalyst also references? From: Hermida, Leandro Sent: Friday, November 24, 2006 17:48 To: 'The elegant MVC web framework' Subject: setting up project where web application (Catalyst) is only a part Hello again, Sorry more questions on layout of a project which involves Catalyst. I have done previous projects where the mod_perl web app is only one piece of the project which has other programs, scripts, services etc. Here is what my project root directory would typically look like: conf C_progs data dev_tests htdocs lib logs perl R_progs sql tmp web_perl web_startup It seems so far from the tutorial that the layout for a catalyst app is tied to the web application (I could be completely wrong) and it would get crazy to start adding external things. Changes lib Makefile.PL myapp.yml README root script t Is there a different layout that one could use? Leandro ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: Last Chance /LastDay:Webdevelopmentplatformcontestand Perl / Catalyst
to run an individual test : perl -Ilib t/some_test_module.t On 12/5/06, Dave Howorth [EMAIL PROTECTED] wrote: Octavian Rasnita wrote: Yesterday I have installed Catalyst and Task::Catalyst under Linux, using the CPAN shell. The process gave many errors, but they disappeared beeing replaced by the new lines printed, so I don't know how to find them. I have tried install Catalyst again, thinking that I could see those errors again, but I received the message that Catalyst is up to date, so I don't know which were those errors, and which modules were not installed. Go into the cpan build directory for the distribution (typically under ~root/.cpan/build) and type 'make test'. Then you can see errors and warnings. You can save the output in the normal way. You can also run the individual tests from there (perl t/some-test.t) Cheers, Dave ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] {OT] protecting against attacks with multilingual input
yes, I would know the language being supported. There are a lot of languages though. Does it work with Chinese, or Marathi (Devanagari)? I didn't know that \W did that though. guess I need to look into it. Never seen that in the perldocs - any idea where I can look for the small print? On 12/5/06, Joel Bernstein [EMAIL PROTECTED] wrote: On Tue, Dec 05, 2006 at 01:10:35PM +0100, Daniel McBrearty wrote: How does one do this? If you have a text input field which can be in *any* language, which will get stored in the db, how do you protect against script injection? If it's just english, I normally only accept characters from a given list (something like /[A-Za-z0-9]/ , plus whitespace and punctuation). But if the input can be in any language ?? Isn't there any way you could require the input to be associated with a particular language? Perl supports locale definitions which modify, for example, the set of 'word' characters matched by the \w regular expression escape. If you could dynamically switch locales to the correct one for your input text then you could trivially s/\W//g to sanitize strings. If you really have to accept input in any language without knowing what language it is, then perhaps you should take the opposite approach and test for the presence of certain characters which you can be sure would occur in program code but not typically in text. Of course, English might suffer without the dollar-sign and semicolon, and you may decide that this is overly restrictive on your users... /joel ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] {OT] protecting against attacks with multilingual input
If you're talking about sql injection then presumably you could do this exactly the same as you would any other input field - use sql placeholders in a prepared query rather than blindly pasting untrusted input as sql. This is what I'm talking about. I don't know this technique - I thought the only approach was to filter input. I'm using DBIx, AFAIK it does use placeholders ... ? If so, I can just take input, do some basic sanity filtering, and store? XSS is not such a worry - I'm not dealing with financial transactions or such. It's more people being able to compromise the server that I am thinking of. Phaylon : sure. A simple example would be, say, a multilingual web forum. A text field would have a size limit, but other than that most any utf8 character could be input. -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] {OT] protecting against attacks with multilingual input
thanks people, this is very helpful. Well, everything is postgresql / linux, so MSSQL will never be an issue. Also I only ever use utf8 ... so I guess I'm home and dry. It would be very neat to be able to do this without locale-switching (and installing). as a matter of interest, does anyone have a reference on why placeholders protect against injection attacks ? If that is the case, maybe I can even leave out \w filtering where that is appropriate to do that. thanks! D On 12/5/06, Brandon Black [EMAIL PROTECTED] wrote: On 12/5/06, Daniel McBrearty [EMAIL PROTECTED] wrote: This is what I'm talking about. I don't know this technique - I thought the only approach was to filter input. I'm using DBIx, AFAIK it does use placeholders ... ? If so, I can just take input, do some basic sanity filtering, and store? Yes, DBIC does use placeholders in most situations. However, the NoBindVars-based Storage classes do not. This includes the notable example of MSSQL via DBD::Sybase, which uses NoBindVars to work around issues with FreeTDS and/or DBD::Sybase. The only really good way to fix this is to fix the DBD's or underlying DB libraries to properly support bind variables in all cases. Phaylon : sure. A simple example would be, say, a multilingual web forum. A text field would have a size limit, but other than that most any utf8 character could be input. If your encoding is utf-8, you'll read in the perl i18n/l10n docs that UTF-8 has universal definitions for \w, \W, etc. Thus you don't really even need to know the language to safely validate for word vs non-word chars, just the encoding. -- Brandon ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] {OT] protecting against attacks with multilingual input
I'll never forget the hours I spent discovering that mysql needs some little-documented command on connect, even though all tables are declared as UTF8 ... one of the factors that decided me on postgresql for the next version. In the first implementation of engoi, I was pretty paranoid about these things - there is some fairly draconian filtering going on. However, if I can relax and let people use usernames and passwords in their own character sets for the future, that would be a nice change to make. It *is* supposed to be multilingual, after all ... many thanks for the help. On 12/5/06, Steve Atkins [EMAIL PROTECTED] wrote: On Dec 5, 2006, at 5:28 AM, Daniel McBrearty wrote: If you're talking about sql injection then presumably you could do this exactly the same as you would any other input field - use sql placeholders in a prepared query rather than blindly pasting untrusted input as sql. This is what I'm talking about. I don't know this technique - I thought the only approach was to filter input. I'm using DBIx, AFAIK it does use placeholders ... ? If so, I can just take input, do some basic sanity filtering, and store? Yes. It's something you should trust your ORM to get right, rather than doing things at the application level. Some databases don't really support placeholders, though, so the DBD drivers fake up support instead. I'm not sure whether I'd trust that quite as much, so it depends on the database you're using. Postgresql or Mysql should be fine, I've no idea about others. There can be a lot of other pain with dealing with i18n user data in the database, but sql injection problems shouldn't be one of them (well, they might be occasionally, but at the sort of level it's hard for anyone other than the DB and ORM developers to deal with). Cheers, Steve ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] AJAX best practices, maximum availability
boing ... On 11/29/06, Drew Taylor [EMAIL PROTECTED] wrote: On 11/21/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On 11/21/06, Chisel Wright [EMAIL PROTECTED] wrote: Have you anything that deomstrates this and is publically viewable? I know I'd be interested in see how this all gels together in real-life. I'm with Chisel on this... if it's not painful, I'd love to see some example of what you are describing. Sounds pretty interesting. What they said++ :-) I seem to learn best with concrete examples. Drew -- Drew Taylor * Web development consulting Email: [EMAIL PROTECTED] * Site implementation hosting Web : www.drewtaylor.com * perl/mod_perl/DBI/mysql/postgres ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Authentication - unix crypt
which bit is a problem? I have this working AOK at home, don't have the source right in front of me. But IIRC all we had to do was tell the Auth module to use crypt ... When I get home I'll post the source. Anyhow, it seems to work out of the box ... also with passwords that were previously in an apache style password file, that have been moved into the db. when you store the password, just pass crypt 'xx', $password to the db ... On 12/12/06, upb [EMAIL PROTECTED] wrote: I've built an app using the Tutorial as a guide. I'm authenticating with a user table using plain text passwords (just as in the tutorial). Now I'd like to use existing user data that has passwords stored using unix Crypt (with the crypt function in Perl). After reading the docs, it looks like I can use Catalyst::Plugin::Authentication::Credential::Password but I'm unclear exactly what I need to do. From the docs, I see this goes somewhere... $user-supported_features(qw/password crypted/); and that there is an expected method - crypted_password - which returns the user's crypted password as a string, with the salt as the first two chars. Our passwords are crypted using the example in the Perl Cookbook (or Camel book)... my $salt = join '', ('.','/',0..9,'A'..'Z','a'..'z')[rand 64,rand 64]; my $crypt_pwd = crypt($plain_pwd,$salt); I've just started using Catalyst, and this is the first thing that's tripped me up. Thank you. Need a quick answer? Get one in minutes from people who know. Ask your question on www.Answers.yahoo.com ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Supporting multiple password types with C::P::Auth::Store::DBIC
or maybe it's even simpler ... it looks like C::P::A::Password::_check_password tries all methods until it succeeds, depending on User::supports ... so I guess that saying $user::supports( qw/crypted hashed/) somewhere should do it? sorry for clogging up the list with my ramblings ... perhaps I should have dug into the sauce first ... On 12/13/06, Daniel McBrearty [EMAIL PROTECTED] wrote: or reading C::P::Auth docs, maybe it's better to write a helper _login method in my controller, and let that handle things ... On 12/13/06, Daniel McBrearty [EMAIL PROTECTED] wrote: Am migrating from an old system which used Basic Auth, to this plugin. As mentioned in a previous post, using password_type = crypted means that the old passwords still work. Nice ... But reading the docs for crypt I just noticed that it can screw up on unicode wide chars, so it looks like a good idea to migrate away from crypt to hashed. The best way to do this would be to make the plugin support both ... something like : if (length($user-password) == 14) { # use crypt } else { # use hash } and just hash new passwords. I hope this shouldn't too hard, if I know where to start ... I guess I need to subclass the class that does the actual decode. Any pointers or big gotchas that anyone can see? thanks Daniel -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Supporting multiple password types with C::P::Auth::Store::DBIC
although ... there might be a related problem that makes restricting to ASCII make sense. If usernames are also UTF8, will there be potential problems using them in URLs? I know UTF8 in urls have been discussed a lot, but I've no idea what the current state of play is (does it work well on all platforms). thanks. On 12/13/06, Daniel McBrearty [EMAIL PROTECTED] wrote: the site is available in about 15 languages, including Chinese, Japanese, Greek ... it doesn't make any sense to restrict to [A-Z][a-z]. Some users may be hardly using those. If people lock themeselves out, they can get a reminder emailed (which will use those characters). On 12/13/06, Marc Espie [EMAIL PROTECTED] wrote: On Wed, Dec 13, 2006 at 12:16:30AM +0100, Daniel McBrearty wrote: Am migrating from an old system which used Basic Auth, to this plugin. As mentioned in a previous post, using password_type = crypted means that the old passwords still work. Nice ... But reading the docs for crypt I just noticed that it can screw up on unicode wide chars, so it looks like a good idea to migrate away from crypt to hashed. The best way to do this would be to make the plugin support both ... something like : I really don't think it's a good idea to allow non-ascii characters into passwords. People will screw themselves over: choose a password with an é, change machines, and realize you don't know how to enter an é from the new setup. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Supporting multiple password types with C::P::Auth::Store::DBIC
thanks Jonathan. I looked up on the W3C site and saw that this was how it should work, and had it on my list to see if cat would be all right with it. I'd have been surprised if it wouldn't, TBH ... it's taken me quite a while to get up to speed on cat/dbix/tt ... a lot of new stuff to learn, and I've only been able to concentrate on it intermittently, but it's starting to pay off now. This is really a very powerful and flexible framework. Should have engoi running on it by Jan/Feb now. On 12/13/06, Jonathan Rockway [EMAIL PROTECTED] wrote: I know UTF8 in urls have been discussed a lot, but I've no idea what the current state of play is (does it work well on all platforms). Yes. http://host/path/to/something/%xx%xx%xx%xx%xx%xx%xx%xx%xx/... The %xx's are the utf-8 octets. Catalyst will understand this just fine; we even have some automatic tests to make sure. -- package JAPH;use Catalyst qw/-Debug/;($;=JAPH)-config(name = do { $,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //, ;$;]-[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;-setup; ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] C::P::Email and testing
if you have an action that sends an email, how do you write tests for it? perhaps print the email to a temp file in test mode? what do you guys do? -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] C::P::Email and testing
you just want to see the text that you are generating the for the email, make some kind of sanity check on it, just before it hits the email module. I'll check it out. On 12/16/06, Ash Berlin [EMAIL PROTECTED] wrote: Daniel McBrearty wrote: if you have an action that sends an email, how do you write tests for it? perhaps print the email to a temp file in test mode? what do you guys do? Send it to a locally delivered address and check the mbox? use Net::IMAP module. It depends what you want to check - but I'd avoid testing other ppls code - assume they are right unless you have a good reason not to. Ash ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] C::P::Email and testing
that's a nice idea. thanks Perrin. On 12/18/06, Perrin Harkins [EMAIL PROTECTED] wrote: Daniel McBrearty wrote: if you have an action that sends an email, how do you write tests for it? We do it by subclassing Net::SMTP::Server to write all mail to files in a temp directory. Then we send the mail to it and check the contents in the temp file. That way the whole code path gets executed and we don't depend on the local machine having working SMTP and IMAP servers. - Perrin ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] C::P::Email and testing
I'm not completely following the action class thing, but the way that seems most logical to me is to write a plugin C::P::EmailTestable that subclasses C::P::Email sub email { if (my $location = $c-config-{test_email}) { # write a temporary file into $location, and put the filename on the stash # so the view can link to it . . } else { # just defer to C::P::Email $self-super(@_); } } ... but I'm thinking, how can one plugin inherit from another? $self isn't passed ... not that it's a problem. There are bunch of other ways to do it. Maybe just a simple helper method somewhere that does the same. D On 12/16/06, Jonathan Rockway [EMAIL PROTECTED] wrote: On Saturday 16 December 2006 03:08, Sébastien Wagener wrote: On Sat, 2006-12-16 at 07:45 +0100, Daniel McBrearty wrote: if you have an action that sends an email, how do you write tests for it? perhaps print the email to a temp file in test mode? what do you guys do? I am currently considering writing tests for my e-mails too. You could set __PACKAGE__-config-{email} to Test if some env variable is set, and dump Email::Send::Test-emails to a file in an end action. Or you could provide a testing action to display (and clear) the sent e-mails. I have a similar problem with the values of my captchas. Btw.: Are there any best practices to hide an action unless in testing mode? Protect it by an ACL rule if an environment variable is set? I'm not aware of anything that does this now (but I don't look at the ACL stuff very often), but you could implement this as an ActionClass: package MyApp::Action::Testing; use base 'Catalyst::Action'; sub execute { my $self = shift; die You can't use this action! unless $ENV{MYAPP_TESTING}; return $self-NEXT::execute( @_ ); } 1; then package MyApp::Controller::Whatever; # ... sub foo : Local : ActionClass('Testing') { $c-response-body('All tests successful.'); } Completely untested, but it should work. Assuming this is useful, I'll CPAN it. -- package JAPH;use Catalyst qw/-Debug/;($;=JAPH)-config(name = do { $,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //, ;$;]-[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;-setup; ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] C::P::Email and testing
OK. That does work if I use : $c-SUPER::email($c, @_); to call the superclass. Interestingly, if I use SUPER.pm ... : package Catalyst::Plugin::EmailTestable; use strict; use warnings; use base qw ( Catalyst::Plugin::Email ); use SUPER; sub email { my $c = shift; my $super = $c-super('email'); $c-log-dumper($super); } 1; and I get ... : [debug] $VAR1 = sub { DUMMY }; and if I try $super-($c, @_); the app hangs. Is this a known problem? cheers D On 12/18/06, Jonathan Rockway [EMAIL PROTECTED] wrote: Daniel McBrearty wrote: ... but I'm thinking, how can one plugin inherit from another? $self isn't passed ... Your plugin ISA Catalyst, so instead of $self, you get a $c. Subclassing should work. $c-next::method(@_) or whatever; -- package JAPH;use Catalyst qw/-Debug/;($;=JAPH)-config(name = do { $,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //, ;$;]-[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;-setup; ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] templates
I have my templates at the same level as root as you mention, I've not come across any problems. On 12/20/06, John Napiorkowski [EMAIL PROTECTED] wrote: --- Octavian Rasnita [EMAIL PROTECTED] wrote: Hi, Could you please tell me why the templates should be put under the /root directory? Well, the only good reason I can think of is that since it's the default all other Catalyst developers will look for them there first. Otherwise I know the whole directory structure best practices thing is an ongoing debate. I don't think we've really figured it out yet :) Personally I don't like /root either but just grew used to it. Wouldn't be more appropriate to have a templates directory on the same directory where /root is? You can do that if you want; I can't judge what is more appropriate. Can I create a separate directory with templates which are not under /root (for not allowing accessing the templates from the web)? Sure, you can create a directory called /templates at the same level as root, and if you are using template toolkit for your view you can set the search path to find your new directory. Here's what I did (assuming you have a TT view called TT.pm) in my myapp.yml file. 'View::TT': INCLUDE_PATH: - __path_to(templates)__ You might need to check the docs, I grabbed this from a project I played with almost a year ago when I started with Catalyst. Although you can also configure static simple or apache to not serve your template extensions, if you'd rather keep it all in root. static: no_logs: 0 #I like to see logs ignore_extensions: - tmpl - tt - tt2 # or whatever extension you use Thanks. Octavian ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] VMware Image
does anyone have workable hosting for such a thing? I do my dev on an Ubuntu VM running on an XP host. It wouldn't be *that* much hassle for me to clone what I have, clean up a bit, and put a basic cat install on there. might have to wait a few weeks though, all the spare time I have goes into doing dev work at the mo. But I'd be glad to do it. On 12/21/06, Brian [EMAIL PROTECTED] wrote: If that is so you can download the image and have a working development system, I'd love it. I want to look into Catalyst (currently use PHP / Smarty), but don't have a lot of spare time right now to research it. A ready to run image would make it way easier to get started, especially if it had some sample applications already in place. I learn really fast from seeing complete sample applications. Thanks, Brian Rhett Creighton wrote: Is anyone working on a vmware image for Catalyst like the docs say? I'm starting to make one for myself, maybe with damn small linux. Though, I've never done this before. Let me know if anyone has suggestion, or wants to help, or already did this. Rhett ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] VMware Image
Not sure. I've never tried before. I'm just cloning my m/c now. All I have to do then would be to remove all my working source and so on from my home, and change the password. That should leave you with a working cat install plus all the DBIx, TT, as well as apache, postgres and mysql. It might be a bit chunky though ... we'll see what happens ... On 12/21/06, Brian [EMAIL PROTECTED] wrote: Do you know what the approximate filesize would be (zipped or RAR'd)? Ubuntu would be great. Thanks, Brian Daniel McBrearty wrote: does anyone have workable hosting for such a thing? I do my dev on an Ubuntu VM running on an XP host. It wouldn't be *that* much hassle for me to clone what I have, clean up a bit, and put a basic cat install on there. might have to wait a few weeks though, all the spare time I have goes into doing dev work at the mo. But I'd be glad to do it. On 12/21/06, Brian [EMAIL PROTECTED] wrote: If that is so you can download the image and have a working development system, I'd love it. I want to look into Catalyst (currently use PHP / Smarty), but don't have a lot of spare time right now to research it. A ready to run image would make it way easier to get started, especially if it had some sample applications already in place. I learn really fast from seeing complete sample applications. Thanks, Brian ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] VMware Image
the clone I made last night was pretty big --- 5GB or so. When I get some time I'll take a look to see where that is coming from. On 12/21/06, Thomas Hartman [EMAIL PROTECTED] wrote: There's also pimpmycat. Takes a while to install, but more or less all you have to is keep hitting the return key until it's done. Puts everything (including local perl) under whatever directory you specify. http://code.google.com/p/pimpmycat/ 2006/12/21, Daniel McBrearty [EMAIL PROTECTED]: Not sure. I've never tried before. I'm just cloning my m/c now. All I have to do then would be to remove all my working source and so on from my home, and change the password. That should leave you with a working cat install plus all the DBIx, TT, as well as apache, postgres and mysql. It might be a bit chunky though ... we'll see what happens ... On 12/21/06, Brian [EMAIL PROTECTED] wrote: Do you know what the approximate filesize would be (zipped or RAR'd)? Ubuntu would be great. Thanks, Brian Daniel McBrearty wrote: does anyone have workable hosting for such a thing? I do my dev on an Ubuntu VM running on an XP host. It wouldn't be *that* much hassle for me to clone what I have, clean up a bit, and put a basic cat install on there. might have to wait a few weeks though, all the spare time I have goes into doing dev work at the mo. But I'd be glad to do it. On 12/21/06, Brian [EMAIL PROTECTED] wrote: If that is so you can download the image and have a working development system, I'd love it. I want to look into Catalyst (currently use PHP / Smarty), but don't have a lot of spare time right now to research it. A ready to run image would make it way easier to get started, especially if it had some sample applications already in place. I learn really fast from seeing complete sample applications. Thanks, Brian ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] VMware Image
it's all yours ;-) if you have time to sort this from a clean system, it likely makes more sense than me messing around with a copy of my working system which has all manner of stuff on it. cheers D I think as long as it has cat, TT, DBIX and mysqlite, that's enough. On 12/21/06, Rhett Creighton [EMAIL PROTECTED] wrote: I'm probably going to make a few vmware images for myself to use that will be on the larger side (more than 300 MB compressed). To give people an idea of the minimum possible filesize, here is a standard install of ubuntu 6.10-server in a 63 MB package: http://www.jcinacio.com/stuff/VMware-UbuntuServer-6.10/ The actual extracted size is 365MB. I just took his image, installed cat-in-a-box, made a sample catalyst app, ran the server, and used the app from another machine on the local network. Without doing anything tricky, I simply zipped up that image and it came out to be 96 MB. If I used strong compression, it came out to 76 MB. However, I think stronger compression defeats the point of this being a susposedly easy package to deploy. I'll see if I can put together a nice ~150MB package. I don't know if the catalyst site can host that, or wants to, but I'll send it to whoever wants it. Rhett On Thu, 21 Dec 2006, Daniel McBrearty wrote: the clone I made last night was pretty big --- 5GB or so. When I get some time I'll take a look to see where that is coming from. On 12/21/06, Thomas Hartman [EMAIL PROTECTED] wrote: There's also pimpmycat. Takes a while to install, but more or less all you have to is keep hitting the return key until it's done. Puts everything (including local perl) under whatever directory you specify. http://code.google.com/p/pimpmycat/ 2006/12/21, Daniel McBrearty [EMAIL PROTECTED]: Not sure. I've never tried before. I'm just cloning my m/c now. All I have to do then would be to remove all my working source and so on from my home, and change the password. That should leave you with a working cat install plus all the DBIx, TT, as well as apache, postgres and mysql. It might be a bit chunky though ... we'll see what happens ... On 12/21/06, Brian [EMAIL PROTECTED] wrote: Do you know what the approximate filesize would be (zipped or RAR'd)? Ubuntu would be great. Thanks, Brian Daniel McBrearty wrote: does anyone have workable hosting for such a thing? I do my dev on an Ubuntu VM running on an XP host. It wouldn't be *that* much hassle for me to clone what I have, clean up a bit, and put a basic cat install on there. might have to wait a few weeks though, all the spare time I have goes into doing dev work at the mo. But I'd be glad to do it. On 12/21/06, Brian [EMAIL PROTECTED] wrote: If that is so you can download the image and have a working development system, I'd love it. I want to look into Catalyst (currently use PHP / Smarty), but don't have a lot of spare time right now to research it. A ready to run image would make it way easier to get started, especially if it had some sample applications already in place. I learn really fast from seeing complete sample applications. Thanks, Brian ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] creating a model
that's pretty interesting Octavian. What do you use to read the screen as a blind user? On 12/22/06, Octavian Rasnita [EMAIL PROTECTED] wrote: Just learn and use Linux :) (Oops did I say that out loud?) I use Linux for running the created application, but not for developing it. I need to develop it under Windows, because Linux is a very poor operating system, good for running servers, but not very good as a desktop. I am blind, and the accessibility of Linux GUIS are very poor, the screen readers that work under Linux cannot compare with those that run under Windows. I think the fact that the perl programs need to be ported to other operating system sometimes with a pretty big effort, make it a less and less popular language. Maybe perl6 will solve this, but I hope to live until then. :-) Happy Holidays everyone! Thank you and I wish you the same. Happy holidays! Octavian ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: Accessing $c from Model
FWIW ... : what I've noticed about using models (or not) ... : 1. the advantage of using a model mostly seems to be that it autoloads, and then is accessible everywhere from $c. Otherwise, there doesn't seem to be much difference from just having a normal perl library. 2. so if you just need data/logic for use in one controller, a standard library may be better. 3. usually, I'm finding its better to try to keep the models as pure data sources, and not have them interact, or be context dependent. So I try to make it the controllers job to do anything that involves context, or to connect different models together where necessary. That seems to result in a cleaner API. I have started writing modules that took $c as an argument, but generally took it out later. 4. of course there are exceptions ... which is why a framework that has flexibility and power is worth investing time to learn, even if it takes longer than one that says we do it this way around here ... this is just ideas that I've seen starting to emerge from many learner's mistakes ... others will know different / better ... On 12/28/06, A. Pagaltzis [EMAIL PROTECTED] wrote: * Jonathan Rockway [EMAIL PROTECTED] [2006-12-27 21:25]: No, it's not. Creating an object in Perl amounts to setting a flag (the OBJECT flag in subclasses of SvPVMG, to be exact). See illguts: http://gisle.aas.no/perl/illguts/ Are you being too literal on purpose? Yeah blessing a ref is just setting a flag but you need a referee for that ref and people don't consider its creation a separate step in general. * Mark Zealey [EMAIL PROTECTED] [2006-12-27 17:20]: On Wednesday 27 December 2006 1:01 pm, Ash Berlin wrote: Very very *VERY* bad idea. __PACKAGE__-mk_accessors(context); sub ACCEPT_CONTEXT { my ($self, $c, @args) = @_; my $new = bless({ %$self }, ref $self); $new-context($c); return $new; } Isn't that really really slow though? Constructing a new object for each call? Well, it depends. If you call `$c-Model('Log')` a ton of times, then it will indeed be slow. If you don't, you won't notice. If you've *determined* from profiling that `$c-Model('Log')` is called enough to be a bottleneck, you have two options. The trivial one is that to store the object returned in a variable and then make your logging calls on that variable, so you don't go through `ACCEPT_CONTEXT` constantly. The other is to memoise `ACCEPT_CONTEXT` so when it's passed the same `$c`, it always returns the same copy. You'll have to be very careful about your cache though; it's easy to introduce leaks. If Catalyst depends critically on object destruction timing, you might even break the whole thing alltogether. In summary: avoid caring too much without specific reason to. Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Article on web frameworks ommits Catalyst
I tried a few times to figure what continuations are, and why I might want them, and I never succeeded. I usually like things as simple as possible ... but I'd still like to get it. On 1/2/07, John Napiorkowski [EMAIL PROTECTED] wrote: --- Kieren Diment [EMAIL PROTECTED] wrote: Hey, There's an article, Web Framework Manifesto here: http://blog.lostlake.org/index.php?/archives/16-Web-Framework-Manifesto.html I've written a comment in the article suggesting that this is a pretty major ommission and that he might want to evaluate Catalyst and do an update. The author seems coherent and reasonably knowledgable to me, so how bout it guys? Maybe you should let him know his mistake too? This is actually quite an interesting thoughtdump on what we'd like in a web development framework. Some of the things mentioned, such as a great dispatching system, straightforward ORM support and easy to extend APIS (Plugins, customized Controllers, Views or Models) we have. However some of the things mentioned I don't see as current strong points of Catalyst, such as the idea of web pages being highly componentized and capable of managing their own state. This could just be my ignorance though. The article is big on continuations. Catalyst has a plugin for this but I'm not sure many people know what to do with it or what the advantages could be. To be honest I'm not someone that could answer that question. One thing not mentioned as a strong point for a framework is something that is a big plus for perl, which is the size of CPAN. --john ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] questions on Reaction
I took a look, I got it to run, I went ... ah ... now it's silly questions time ... 1. Where does Reaction score over Cat, as a web framework? I get that it is domain/interface more than straight MVC ... 2. For the example code, it seems to do the crud style stuff pretty well - I also get (I think) that this is actually functionality of the framework, not code that has been generated ... to quote the FAQ :: At the moment, Reaction runs on Catalyst for web development. ... so is it possible to use this part of reaction within a cat app? is Reaction running *within* catalyst? If I have an existing cat app but think I might fancy a bit of R in there, am I going to want to shoot myself later ... ;-? cheers. I hope I can get enough of this to make some simple cruddish stuff I need happen, and hope fully take advantage of Reaction as it evolves ... D -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Re: questions on Reaction
ok, answered my own question, partly. Reaction::Controller isa Cat::C::Bindlex, which is a Cat::C so I can use a Reaction::Controller as a souped up Cat::C, I guess ... On 1/2/07, Daniel McBrearty [EMAIL PROTECTED] wrote: I took a look, I got it to run, I went ... ah ... now it's silly questions time ... 1. Where does Reaction score over Cat, as a web framework? I get that it is domain/interface more than straight MVC ... 2. For the example code, it seems to do the crud style stuff pretty well - I also get (I think) that this is actually functionality of the framework, not code that has been generated ... to quote the FAQ :: At the moment, Reaction runs on Catalyst for web development. ... so is it possible to use this part of reaction within a cat app? is Reaction running *within* catalyst? If I have an existing cat app but think I might fancy a bit of R in there, am I going to want to shoot myself later ... ;-? cheers. I hope I can get enough of this to make some simple cruddish stuff I need happen, and hope fully take advantage of Reaction as it evolves ... D -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: questions on Reaction
The only thing to remember is that it expects the I18N plugin to be loaded since all text is run through that before display Hmmm. I specifically don't want to use that plugin, as we have our own version which is similar but different. We may be a bit wrongheaded about this at the moment, but I've not yet found any practical reason to change it ... I don't need any transation of text for the crud stuff anyhow - it's all purely admin functions, which are English only. But I guess all it really wants is to see methods with the appropriate names in the $c namespace ... so no problem. cheers D On 1/2/07, Matt S Trout [EMAIL PROTECTED] wrote: On 2 Jan 2007, at 16:12, Daniel McBrearty wrote: ok, answered my own question, partly. Reaction::Controller isa Cat::C::Bindlex, which is a Cat::C so I can use a Reaction::Controller as a souped up Cat::C, I guess ... Precisely. Reaction drops in happily to any existing Cat app, we've done hybrids and gradual ports already. The only thing to remember is that it expects the I18N plugin to be loaded since all text is run through that before display, and you need to have a Reaction::UI::Renderer::XHTML subclass under MyApp::View for it to use. Reaction also pretty much solely uses Chained, so sticking R-based controllers off under a prefix of some sort isn't an issue. -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: questions on Reaction
OK. It is a good idea to make sure everything in the view goes through the I18N code, for sure. I'd like to merge what we are doing there with the cat plugin, but tat can wait ... next questions, about the Root.pm of the example app ... : 1. use base 'Reaction::UI::RootController'; use Reaction::Class; use aliased 'Reaction::UI::ViewPort'; do these HAVE to be in Root.pm? I just want to use this stuff in my admin code at the moment ... say it all sits in under MyApp::Controller::Admin ... can I just put these there? 2. __PACKAGE__-config( view_name = 'XHTML', window_title = 'Reaction Test App', namespace = '', ); sub base :Chained('/') :PathPart('') :CaptureArgs(0) { my ($self, $c) = @_; $self-push_viewport(ViewPort, layout = 'xhtml'); } I'm just not getting this bit. WHy do I want your XHTML view (it happens that I use xhtml anyway ... ) but what's it all about? 3. the root action is using a viewport, pushing the template name onto it ... what does a viewport actually do over, say, a standard TT template? thanks. I'll prod about with it anyway and see what happens ... On 1/2/07, Matt S Trout [EMAIL PROTECTED] wrote: On 2 Jan 2007, at 18:52, Daniel McBrearty wrote: The only thing to remember is that it expects the I18N plugin to be loaded since all text is run through that before display Hmmm. I specifically don't want to use that plugin, as we have our own version which is similar but different. We may be a bit wrongheaded about this at the moment, but I've not yet found any practical reason to change it ... I don't need any transation of text for the crud stuff anyhow - it's all purely admin functions, which are English only. But I guess all it really wants is to see methods with the appropriate names in the $c namespace ... so no problem. Yep, absolutely. But it was kinda critical to our use to enable L10N from the ground up so we used the standard approach. I explicitly -don't- check to see if the plugin's loaded though and never will - I might need to implement something completely different myself one day too :) -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: questions on Reaction
to be specific, I'm now getting : Caught exception in Engoi::Controller::Admin-end Can't call method render on an undefined value at /home/daniel/work/engoi/trunk/Engoi/script/../lib/Reaction/UI/Window.pm line 63. which I guess is caused by the fact that I have not put those templates ... somewhere ... On 1/2/07, Daniel McBrearty [EMAIL PROTECTED] wrote: gotcha. The only part I had to put in Root.pm was the __PACKAGE__-config( ... ), which is logical. I found a lot of templates under root/base ... including 'xhtml' which at some point calls [% INCLUDE header; window.render_viewport(self.inner); %] which I guess then runs down the various objects that were added with $self-push_viewport(ViewPort, 'blah') in the controllers. These templates have lots of apparently widget-orientated stuff ... is this library code or app code used to generate the crud stuff? how do I set up where it lives in my app? On 1/2/07, Matt S Trout [EMAIL PROTECTED] wrote: On 2 Jan 2007, at 20:10, Daniel McBrearty wrote: OK. It is a good idea to make sure everything in the view goes through the I18N code, for sure. I'd like to merge what we are doing there with the cat plugin, but tat can wait ... next questions, about the Root.pm of the example app ... : 1. use base 'Reaction::UI::RootController'; use Reaction::Class; use aliased 'Reaction::UI::ViewPort'; do these HAVE to be in Root.pm? I just want to use this stuff in my admin code at the moment ... say it all sits in under MyApp::Controller::Admin ... can I just put these there? They need to be in an appropriate namespace to supply begin and end actions. If all your reaction controllers are under ::Admin:: then that's fine - that's usually where we start when doing conversions (or where we stop when writing hybrids :) 2. __PACKAGE__-config( view_name = 'XHTML', window_title = 'Reaction Test App', namespace = '', ); sub base :Chained('/') :PathPart('') :CaptureArgs(0) { my ($self, $c) = @_; $self-push_viewport(ViewPort, layout = 'xhtml'); } I'm just not getting this bit. WHy do I want your XHTML view (it happens that I use xhtml anyway ... ) but what's it all about? You need to be using a view that inherits from Reaction::UI::Renderer::XHTML; it does a few bits and pieces above and beyond the standard TT view that are required for everything to work, and will likely soon to rather more above and beyond as layout classes get added to help extract even more logic out of the templates. 3. the root action is using a viewport, pushing the template name onto it ... what does a viewport actually do over, say, a standard TT template? A viewport is nothing like a template - a viewport object provides a viewport onto a particularly model display or mutation and encapsulates all the logic required for handling events from the user and altering the data visible to the view/layout stuff appropriately. In this case the viewport doesn't actually provide any data in and of itself - it's there as a placeholder for the xhtml document layout to hang off. The ListView and ActionForm viewports are probably more educational in terms of the point of such objects. -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: questions on Reaction
ok ... but I have /root as my site base (static files), all my tempates are in /templates ... can I put them in /templates/base somehow? On 1/2/07, Matt S Trout [EMAIL PROTECTED] wrote: On 2 Jan 2007, at 21:20, Daniel McBrearty wrote: gotcha. The only part I had to put in Root.pm was the __PACKAGE__-config( ... ), which is logical. I found a lot of templates under root/base ... including 'xhtml' which at some point calls [% INCLUDE header; window.render_viewport(self.inner); %] which I guess then runs down the various objects that were added with $self-push_viewport(ViewPort, 'blah') in the controllers. Basically, yes. These templates have lots of apparently widget-orientated stuff ... is this library code or app code used to generate the crud stuff? how do I set up where it lives in my app? Currently, using a symlink, because I've not come up with a general solution and wanted something trivial to rip out once I do. To add your own templates, stick 'em in root/ of your app, do an INCLUDE on whichever base template you're subclassing and then define BLOCKS appropriately plus setting the appropriate foo_block var to the name of your own blocks - ISTR listview subclasses listview_base in the default stuff as a reasonably simple example. -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: questions on Reaction
OK, this is a little odd ... adding MyApp::View::XHTML.pm with contents package Engoi::View::XHTML; use Reaction::Class; extends 'Reaction::UI::Renderer::XHTML'; 1; somehow stamps on the config for my TT view, which is in yaml and looks like this: View::TToolkit: INCLUDE_PATH: 'templates' TEMPLATE_EXTENSION: '.tt' is the template path somehow hardcoded into Reaction::UI::Renderer::XHTML.pm ? I looked at the source, and I didn't see anything that looks like that ... On 1/2/07, Daniel McBrearty [EMAIL PROTECTED] wrote: On 1/2/07, Matt S Trout [EMAIL PROTECTED] wrote: On 2 Jan 2007, at 21:26, Daniel McBrearty wrote: to be specific, I'm now getting : Caught exception in Engoi::Controller::Admin-end Can't call method render on an undefined value at /home/daniel/work/engoi/trunk/Engoi/script/../lib/Reaction/UI/ Window.pm line 63. That's failure to find the view. gottit. Add MyApp::View::XHTML.pm as per the example. now I get file error - component: not found ... -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: questions on Reaction
to give the extra info ... if I have just my Admin controller with just: package Engoi::Controller::Admin; use strict; use warnings; #use base 'Catalyst::Controller'; use base 'Reaction::UI::RootController'; use Reaction::Class; use aliased 'Reaction::UI::ViewPort'; 1; (no actions ...) and the Engoi::View::XHTML.pm exists, I get an error that the template is not found. If I rename to Engoi::View::XHTML.pm.blah ... the error goes. (The extra bit of config info in ENgoi.pm is also commented out.) Hence, I'm thinking that the one view is somehow messing with the other. I'll take another look at it tomorrow. thanks for the help. On 1/2/07, Daniel McBrearty [EMAIL PROTECTED] wrote: OK, this is a little odd ... adding MyApp::View::XHTML.pm with contents package Engoi::View::XHTML; use Reaction::Class; extends 'Reaction::UI::Renderer::XHTML'; 1; somehow stamps on the config for my TT view, which is in yaml and looks like this: View::TToolkit: INCLUDE_PATH: 'templates' TEMPLATE_EXTENSION: '.tt' is the template path somehow hardcoded into Reaction::UI::Renderer::XHTML.pm ? I looked at the source, and I didn't see anything that looks like that ... On 1/2/07, Daniel McBrearty [EMAIL PROTECTED] wrote: On 1/2/07, Matt S Trout [EMAIL PROTECTED] wrote: On 2 Jan 2007, at 21:26, Daniel McBrearty wrote: to be specific, I'm now getting : Caught exception in Engoi::Controller::Admin-end Can't call method render on an undefined value at /home/daniel/work/engoi/trunk/Engoi/script/../lib/Reaction/UI/ Window.pm line 63. That's failure to find the view. gottit. Add MyApp::View::XHTML.pm as per the example. now I get file error - component: not found ... -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] IMPORTANT: Catalyst::Plugin::FormBuilder obsoleted by ::Controller::FormBuilder
what happens if you need to deprecate it ... ? (I'm only half joking ... ) On 1/3/07, Robert 'phaylon' Sedlacek [EMAIL PROTECTED] wrote: Matthieu Codron wrote: On 1/2/07, Joe Landman [EMAIL PROTECTED] wrote: Might be a good thing to have an MODULES_CURRENT/MODULES_OBSOLETE list, or ask the module authors to simply note the obsolescence in an updated POD. I think it is a terrific idea. Catalyst is a lot about choice and flexibility, but reading the list makes me really think that there are good choices, bad choices, and even good ones that become bad. I remember an effort for making a DeprecatedPlugins Plugin, but I don't know where that stands. A plugin emmitting warnings based on a list in the module (deprecated modules and replacements, specific versions, etc) sounds easier to manage and keep up-to-date than a wiki page. -- # Robert 'phaylon' Sedlacek # Perl 5/Catalyst Developer in Hamburg, Germany { EMail = ' [EMAIL PROTECTED] ', Web = ' http://474.at ' } ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] IMPORTANT: Catalyst::Plugin::FormBuilder obsoleted by ::Controller::FormBuilder
another thing : doesn't that imply that you have to install the deprecated plugin before the DepPlugins Plugin jumps up an says you shouldn't ha' done that jimmy ... (presumably before breathing alcohol at you and pissing in your flower pots). All that is really needed is that instead of installing something and having the Cat::Plugin::MST say don't use that on this list, there is a master list someplace. At least then, a noob should only make the mistake once ... and I don't see why it's harder, frankly, to maintain such a list on a wiki than in the code of a plugin. I really dislike the idea of allocating memory to code that is just stopping me do something that I ought to know about anyway. On 1/3/07, Daniel McBrearty [EMAIL PROTECTED] wrote: what happens if you need to deprecate it ... ? (I'm only half joking ... ) On 1/3/07, Robert 'phaylon' Sedlacek [EMAIL PROTECTED] wrote: Matthieu Codron wrote: On 1/2/07, Joe Landman [EMAIL PROTECTED] wrote: Might be a good thing to have an MODULES_CURRENT/MODULES_OBSOLETE list, or ask the module authors to simply note the obsolescence in an updated POD. I think it is a terrific idea. Catalyst is a lot about choice and flexibility, but reading the list makes me really think that there are good choices, bad choices, and even good ones that become bad. I remember an effort for making a DeprecatedPlugins Plugin, but I don't know where that stands. A plugin emmitting warnings based on a list in the module (deprecated modules and replacements, specific versions, etc) sounds easier to manage and keep up-to-date than a wiki page. -- # Robert 'phaylon' Sedlacek # Perl 5/Catalyst Developer in Hamburg, Germany { EMail = ' [EMAIL PROTECTED] ', Web = ' http://474.at ' } ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] IMPORTANT: Catalyst::Plugin::FormBuilder obsoleted by ::Controller::FormBuilder
I'd make that optional, per config or environment variable. Just loading stuff off the net by default seems bad to me. Also, devs without internet connection could get in trouble. IMO it also shouldn't update itself, but rather just tell the user if there's a newer version. yup, makes sense. -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] sane AJAX strategy
On 1/6/07, Bill Moseley [EMAIL PROTECTED] wrote: On Fri, Jan 05, 2007 at 12:24:37PM +0100, Daniel McBrearty wrote: I just started using AJAX (or AHAH actually ... ) a little. I like the lightness it gives but I've been slow to pick up because I want to be sure that pages work without js, and I haven't figured out a generic method yet. I'm sure others are ahead of me on this ... Typical scenario without AJAX : form button submits to URL, which triggers a single Cat action, which is rendered by a single template, usually of the same name. That's simple, just a one-to-one relationship. When we use AJAX, things look very similar, EXCEPT that only a part of a page is loaded. This implies that for the non-js user of the same page, multiple actions and templates have been combined so that the result is identical, even though the whole page loaded. When you say above only part of a page is loaded are you talking about the content part and not the headers, footers, and menus -- or talking about part of the content such as just a new row in a table or updating a single field in a form? It could be either ... usually some part of the content, but it could be all of it. I am talking here though about scenarios where it's more AHAH than AJAX ... the function that makes the request just sticks it as-is into the page, rather than doing some kind of decode on it. Mostly because that seems simpler, and I like simple ... Not sure exactly what you are asking for, but I'll explain what I do if that helps -- and besides I'm no fan of being warnocked. Ha ... I had to look that up, I'd not heard of Warnock before. I ask silly questions sometimes, but silly questions sometimes turn out to be useful, so I don't take it personally ... (grin) ... though I appreciate the response. I don't use that much AJAX, but I do use it for, say, displaying the next page of a list or sorting a table by a column by clicking on a column heading, or selecting a different tab to limit a table's display to a category of some type. My templates are already split up quite a bit. So, I have templates that know how to display tabs, table column headings, and how to build the table. When I update a table (e.g. next page) the same controller code is called for both AJAX and for non-ajax requests (it's the same request url) and the same template is called (derived from the controller's action name). ok ... so does the the controller know that the req is ajax? how? an added argument like ?ajax=true perhaps ... ? I use the typical TT wrapper method to build my entire page from headers, footers, banners, menus, etc. But, the TT wrapper code can detect it's an AJAX request from the request headers and knows to only build the content (i.e. the table with data I'm sorting), but not the entire page. Then my end action also knows it's an ajax request and then returns using JSON. right. so in this case there is a generic [% IF ajax %] in your template code that suppresses headers, footers and so on? which will be fine if you are getting all the content, but not part of it, I guess ? Since I use common template code for generating tabs and table headers and use the same urls for my ajax requests it's easy for javascript to search the DOM and create the events for the ajax requests. That way my HTML markup doesn't have to do anything specific for the ajax calls. That's the commonly recommended method, of course, keeping the behavior and html separate. For AJAX requests that don't update the entire page content, like an auto-complete search box, I still use the same controller as for the non-ajax request but then the controller has a little extra code to return just the search results not the entire new content -- it's just one extra line of code in most cases. Not always the most efficient method (since I end up returning more columns than is really needed for the ajax update), but so far has not been an problem. so do you typically use the same controller action, and have a flag to tell it to act differently? Of course, for updating a single field in a form (e.g. type in a zip code and city and state are automatically filled in) I use a separate controller that just handles the ajax code. In that case there's no need for an extra template since it's just updating existing markup -- the controller just returns JSON. So, I try to write as much as possible without coding specifics for the ajax calls. It's the standard recommendation to write the code for non-ajax usage, then add that behavior on page load. And, then I divide my templates into small enough parts that can be used for ajax and non-ajax calls based on how the request comes in. Thanks for the feedback. It's been enough to feed my thoughts a bit. I'll go and have a play with the code and see what comes out. Daniel -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131
Re: [Catalyst] Re: Preferred Ajax framework
another + for jquery. just because I got going so quickly and easily, i have to say. On 1/9/07, Kieren Diment [EMAIL PROTECTED] wrote: On 10/01/07, A. Pagaltzis [EMAIL PROTECTED] wrote: * John Napiorkowski [EMAIL PROTECTED] [2007-01-09 22:50]: I prefer Jquery. Another vote for jQuery. The docs for jquery are very good. See http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/JQChat for a very simple example. There's a few Prototype examples in the example directory as well. Mind you, other people prefer Dojo or YUI. Basically it's up to you ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] faking $c-user in tests
in test scripts I am able to (for instance) mess with the config my doing my $config = MyApp-config; $config-{some_val} = 'test value'; given that I am happy that my Authentication code is well tested in some other test script, is there a way to somehow bypass it, forcing calls to $c-user_exists and $c-user in the module I'm testing to return values which I directly control in the test script? thanks Daniel -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] faking $c-user in tests
heh ... cheers ... think I've sussed it : my $ue = 1; my $username = 'NotAnAdmin'; use Test::MockObject; my $user = Test::MockObject-new; $user-mock( 'id', sub {return $username} ); package MyApp; sub user { return $user; } sub user_exists { return $ue; } package main; ... at least it looks sane at the mo ... On 1/13/07, Ash Berlin [EMAIL PROTECTED] wrote: Daniel McBrearty wrote: in test scripts I am able to (for instance) mess with the config my doing my $config = MyApp-config; $config-{some_val} = 'test value'; given that I am happy that my Authentication code is well tested in some other test script, is there a way to somehow bypass it, forcing calls to $c-user_exists and $c-user in the module I'm testing to return values which I directly control in the test script? thanks Daniel Slightly hacky but something like: { no warnings 'redefine'; # Not sure if this will be needed in this case *MyApp::user = sub { return bless {id='foo'}, MyApp::UserClass }; } Might work. Or it might blow up in your face cos you looked at it funny - YMMV. -ash ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] [OT] what would constitute a sensible set of benchmarks?
completely academic at the moment, but it would be interesting to see the benchmark comparison thing done properly. If it were, the way would be to specify a set of application functions, let people within the various projects implement them as they wish, then benchmark. I suppose ... so what would be a decent set of tests? I'll have a stab ... 1. no db, no templating. Just have the app respond to a uri for a random number n, and respond with the random number in a plain text doc. so /text_string/abcde would expect to get back the string abcde in a text doc this could measure the ability of the app to parse the uri, and process it. 2. same with templating. Now we could expect the string back in a simple html template ... although that doesn't expect the template system to do much work ... /html_string/xyz ... 3. db access, no templating. The db type, config, schema and dataset should be spec'd as part of the tests, to factor this out as far as possible. Then we could have several tests: - just retrieve a row and display results /db_retrieve - same with one or more joins required /db_join - write/update a row /db_write 4. a random mix of all the above. Could use siege to actually do the tests. Of course, we might just end up proving that the db makes more difference than anything else ... This is just mindblobs at the moment, but the other thread made me think, and I wondered if something like this has been done already. Would be interesting D -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] [OT] what would constitute a sensible set of benchmarks?
e ability of the app to parse the uri, and process it. I think this is a bit too simple. We should probably look at usual kinds of URIs used in applications here. / /foo/bar/baz /foo/1/bar/2/baz/3/4 /foo?bar=baz ...and probably more... Also, there should be more than one action. I would say about 50 might be a good measure, though my current app has a lot more of them... sure. It would certainly be possible to start simple and then get more complicated ... Personally, I don't care about templating and ORM benchmarks, why not? -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst vs Rails vs Django Cook off
they are not, but when you choose a framework you don't just choose a dispatcher. You choose all the other design options that go with it. On 1/15/07, Perrin Harkins [EMAIL PROTECTED] wrote: On Mon, 2007-01-15 at 11:35 +0100, Robert 'phaylon' Sedlacek wrote: To summarize (again): The benchmark doesn't benchmark Catalyst, only it's dispatcher I think it's a lame benchmark too, but isn't a dispatcher mostly what Catalyst is? DBIx::Class and TT are not Catalyst, as people often mention on the list. - Perrin ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: Catalyst vs Rails vs Django Cook off
Like what? And what about those other design options is benchmarkable? 1. the language. For instance, a key factor against RoR for me was the fact that Ruby doesn't know where its going w.r.t. unicode. Perl has mature support for that. There are multiple other reasons why people like/dislike various langauges, and a lot of it, if we are honest, is taste, or factors specific to that project. 2. the library support in the language. Ditto. 3. as a subset of 2, templating systems, ORM's ... It may be that the differences between these things, platform to platform, are insignificant compared to other factors. OK. But if I was setting out to do this exercise (which I'm not, right now ...) I would make some basic measurements anyhow, at least as a start point. snip Because as long as the framework is not improbably slow, its contribution to an app's performance characteristics will just be noise in any realworld scenario. /snip So what are the key factors that influence performance? Why not design a benchmark such that it can show up those differences? I'm not pretending to know in advance what makes the difference. I don't. I just don't think that saying there's no point measuring it ... and expecting the world to just believe is a very realistic combination. Hence the question I was trying to ask in the other thread - what DOES make a realistic benchmark? snip Does that include dynamic content caching wizardry ? It is meaningless if you don't take into account real-life scenarios like reverse proxy cache invalidation policies (and tricks). This is just to say that all this perf talk is meaningless : sometimes the power you get from a well thought out framework allows you to do things that are close to magick, speed-wise among others. Comparing simple setups is ridiculous IMHO. /snip Fair enough. So why not try to design a benchmark in such a way that those techniques can be exploited? What is the simplest set of tests that has some meaning for you? -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] [OT] what would constitute a sensible set of benchmarks?
so a set of benchmarks would give you the chance to show that TIMTOWTDI, and the trade offs that exist between them. That would be pretty interesting to someone trying to compare frameworks. That's where having simple tests that exercise one aspect of the framework in isolation, as far as is possible, might have advantages. You see the differences between techniques, you see the effect they have, you have the opportunity to try to extrapolate what that actually means in terms of your app. At least, that's a technique that has served well in other branches of engineering - you reduce complexity to it's simplest cases, then wotk back maybe this is fundamentally different and that can't work, but at the moment I don't see why. Or any documented attempts to do it that have clearly failed ... On 1/16/07, Robert 'phaylon' Sedlacek [EMAIL PROTECTED] wrote: Perrin Harkins wrote: On Mon, 2007-01-15 at 13:24 +0100, Robert 'phaylon' Sedlacek wrote: Well, templating benchmarks maybe, but for an ORM I just have the feeling the larger factor is how you use it, not which. This is true, but the SQL generated by an ORM can have a big effect on performance. I usually hand-code the parts where I need the most performance, but many people will just rely on their ORM and hope for the best, and that can vary quite a bit between implementations (e.g. deleting multiple rows in one statement vs. thousands). And you can do both in DBIC. That's why benchmarking is so hard, TIMTOWTDI, which one will you benchmark? Same with Catalyst. For my apps, I use uri_for massively, some people don't, which way are we going to benchmark? Same with controller base classes vs action classes vs external modules. IMHO you can only really benchmark developers together with their framework of choice. -- # Robert 'phaylon' Sedlacek # Perl 5/Catalyst Developer in Hamburg, Germany { EMail = ' [EMAIL PROTECTED] ', Web = ' http://474.at ' } ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst vs Rails vs Django Cook off
I looked for that discussion - didn't find it. Do you have a pointer? In your experience, what is accounting for the other 99.9% fo runtime? Db access? templates? other? On 1/16/07, Matt S Trout [EMAIL PROTECTED] wrote: On 14 Jan 2007, at 15:26, Octavian Rasnita wrote: Hi, Here is ablog I just found. Is it true that Catalyst is so slow comparing with other frameworks? http://letsgetdugg.com/category/rails Is it true that for incredibly trivial applications Catalyst might serve less rps? Yes. Have I ever seen a real-world scenario where the things this benchmarks account for more than 0.1% of runtime? No. We discussed this. Re-read the old discussion. Thread over :) -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst vs Rails vs Django Cook off
forget that ... found it http://www.gossamer-threads.com/lists/catalyst/users/10756?search_string=data%20retrieval;#10756 On 1/16/07, Daniel McBrearty [EMAIL PROTECTED] wrote: I looked for that discussion - didn't find it. Do you have a pointer? In your experience, what is accounting for the other 99.9% fo runtime? Db access? templates? other? On 1/16/07, Matt S Trout [EMAIL PROTECTED] wrote: On 14 Jan 2007, at 15:26, Octavian Rasnita wrote: Hi, Here is ablog I just found. Is it true that Catalyst is so slow comparing with other frameworks? http://letsgetdugg.com/category/rails Is it true that for incredibly trivial applications Catalyst might serve less rps? Yes. Have I ever seen a real-world scenario where the things this benchmarks account for more than 0.1% of runtime? No. We discussed this. Re-read the old discussion. Thread over :) -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] plat_forms contest started -- user feedback requested
neat. any idea what if any teams are using cat? On 1/25/07, Boris Ćeranić [EMAIL PROTECTED] wrote: Hi, Thank you for giving me a reminder :) I was certainly going to be available for reviews today. Best luck to our teams :) Regards, Boris On 25/01/07, Alvar Freude [EMAIL PROTECTED] wrote: Hi all, as mentioned some time ago, there is the plat_forms contest, see http://www.plat-forms.org/ All teams got their task two hours ago and now have 28 hours left ;-) You can support the teams by user feedback. The teams will post the URLs of their work on the plat_forms blog: http://www.plat-forms.org/2007/blog Perl teams are: Team 1 (Etat de Genève/Optaros) Team 2 (plusW) Team 5 (Revolution Systems) http://www.plat-forms.org/2007/the-teams There are also three PHP and Java teams. No Ruby, Python and .NET teams, because there where not enough teams. From the task description: PbT (People by Temperament) is a simple community portal where members can find others with whom they might like to get in contact: people register to become members, take a personality test, and then search for others based on criteria such as personality types, likes/dislikes etc. Members can then get in contect with one another if both choose to do so. The system has both an interactice user interface via HTML pagesand a WDL/SOAP-based programmatic interface. The intro slides with some information are here: http://www.plat-forms.org/2007/documents/task-intro The community may help the teams by giving user feedback and usual community support. Helping coding is not allowed ;-) Ciao Alvar -- ** Alvar C.H. Freude, http://alvar.a-blast.org/ ** http://www.wen-waehlen.de/ ** http://odem.org/ **http://www.assoziations-blaster.de/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: plat_forms contest started -- user feedback requested
well, it's easy to id the cat team :-) http://team1.plat-forms.org/ theirs is up and looks already partly functional. On 1/25/07, Daniel McBrearty [EMAIL PROTECTED] wrote: after about 20 you get this weird sense of actually being really really alert ... and never wrong ... On 1/25/07, A. Pagaltzis [EMAIL PROTECTED] wrote: * Matt S Trout [EMAIL PROTECTED] [2007-01-25 18:20]: On 25 Jan 2007, at 16:50, Boris Ćeranić wrote: It would be interesting to see how are they going to survive 30 hours of work... Are they going to catch some sleep at all, etc... 30hrs isn't really that much for a dev burn - I've pulled shifts that long pretty often during heavy hacking without a problem. It's when you get to around the 3 day mark without having had more than a couple hours sleep that it starts to get painful. The really bad thing is not a single 30-hour day, it's when you're doing a long string of 12- to 18-hour days. Sleep deprivation when well rested is actually documented to have a bunch of psychotropic effects including mild euphoria. Anyone who has stayed up long enough to get a weird sense of humour knows this first hand. Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] O’Reilly migh t yet be interested after all
it would be great. I agree, not just DBIx but also TT. The great thing about cat is it's flexibility. But as a beginner it can also be the worst thing. The teaching style needs to be something like look, it's modular, you can bolt just about anything you want to onto this once you understand how that works, but in the beginning, this is a good starting setup, which most people use at least for a while ... cheers On 2/6/07, A. Pagaltzis [EMAIL PROTECTED] wrote: Hi, I just had the following exchange on reddit: * a-p http://programming.reddit.com/info/12u8e/comments/c12vm0: There's a book in the making. Unfortunately, O'Reilly won't be the one publishing it. When the Catalyst devs approached them about a book, O'Reilly basically stated that they want only a single web framework in their lineup, and they've settled on Rails, and that's that. Short-sighted if you ask me (and I'm not just saying that because of Catalyst, there's also Django), but there ya go. To which Tim O'Reilly replied: * timoreilly http://programming.reddit.com/info/12u8e/comments/c131n8: I don't know who was supposed to have made that statement, but it doesn't make any sense to me. I'll look into it. That being said, I can imagine that an editor might have said that he or she thought that Rails had the ruby framework market wrapped up for now, and that there wasn't room for a book on another framework till said framework had proved to have strong adoption. That's a potentially legitimate market assessment – the computer book market is pretty brutal these days, and topics that once would have made for a successful book now don't sell enough copies to recover their costs – but even then, that would be a for now. A lot of publishers still throw stuff at the wall to see what sticks. We tend to publish books that we believe will succeed. And often, that means waiting till a new tool or framework has stood the test of time, and is at the right place on the adoption curve. It doesn't do anyone – the author, readers, bookstores, or the publisher – to publish a book that doesn't sell. Bookstores will give it a few months, and if it doesn't do well, it will be returned, and that's the end of that. Waiting a bit longer may actually increase your chances of success. It's a bit like surfing. Paddling too early is as bad as paddling too late – you have to catch the wave. O'Reilly has a history of publishing books before anyone else – we published the first commercial book on the internet, published about Perl in 1991, Linux in 1993 – but these technologies were actually not new when we published about them. They had proven themselves. They were just under the radar of other publishers. As to publishing too early, Ruby itself is a good example. We published our first Ruby books way too early, they flopped, and then we took our eye off the ball. Sounds good to me. I think where Perl is concerned, Catalyst has definitely shown to be sticky, and it seems to me that it's also stable enough at this point that a book about it has hope of being useful. (Book publishing is a slow process, and if the thing's still evolving rapidly, the book will be obsolete by the time it's on the shelves. Actually, I think a book about Catalyst would have to be a book about DBIx::Class as well, partially anyway, and that too is now at the point of having stabilised enough.) Time is right, I think; the strong response to the advent calendar is probably a good gauge for that. Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] O’Reilly migh t yet be interested after all
indeed ... I stand corrected. On 2/6/07, Matt S Trout [EMAIL PROTECTED] wrote: On 6 Feb 2007, at 12:30, Daniel McBrearty wrote: it would be great. I agree, not just DBIx DBIx is the namespace for DBI extensions. I think you meant to say DBIx::Class. -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: Why I chose Perl and Catalyst
perl : - massive library support via CPAN - very powerful, flexible language, supports many styles of programming - mature UTF8/unicode support - expert developer community - great runtime performance - has stood the test of time catalyst : - open architecture that allows leverage of above factors - dev community is general pretty expert, and very active -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: Why I chose Perl and Catalyst
Basically, this is a good list if you want to argue Perl vs. another contemporary dynamic language, but it makes little distinction when you're trying to contrast Perl against Java. fair point, but I don't see the point in that battle. There *is* an element of taste to programming language choice, and so it should be; who will write the code and what they like using *is* a substantial input into the decision process. If we are having this discussion from a how can we get java heads to use perl POV, I think we are wasting our time ... :-) - if not, what is your point? -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: Why I chose Perl and Catalyst
ah, sorry. I didn't pick up that bit of $c ... I wish him luck anyway. People are generally so polarised over the issue. On 2/14/07, A. Pagaltzis [EMAIL PROTECTED] wrote: * Daniel McBrearty [EMAIL PROTECTED] [2007-02-14 16:55]: fair point, but I don't see the point in that battle. I dunno about battle, but this subthread started with Leandro asking how to explain to his boss why they should pick Perl (and Catalyst, and DBIC, etc) over a Java stack. Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] unicode best practices
other stuff I've found: http://search.cpan.org/~bricas/DBIx-Class-0.07003/lib/DBIx/Class/UTF8Columns.pm - utf8 text fields in the db are automatically flagged as such when retrieved I also found once I started using the above, I needed to install http://search.cpan.org/~lyokato/Catalyst-View-TT-ForceUTF8-0.06/lib/Catalyst/View/TT/ForceUTF8.pm to avoid garbled output. There is also somewhere a module which causes stash to be flagged utf8, but I haven't needed it. Yet ... On 2/15/07, Richard Jolly [EMAIL PROTECTED] wrote: Hi, The crux of this question is what is best practice for a catalyst/DBIC app to have it fully unicode aware. We've got: MySQL with charset defined as UTF8 DBIC with on connect do SET NAMES and SET CHARSET and UTF8Columns Catalyst::Plugin::Unicode End actions specify content type as including charset utf8 Then, finally, making sure any files (which include log files and fixture files for tests) opened use the utf8 io layer. Should this be enough? Thanks, Richard ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] confused about file locations when running under apache/mod_perl
I have my complete apache/mod_perl install built under a single directory (/usr/local/apache2) and I normally stop/start apache from there using ./bin/apachectl start etc My app runs fine on the machine using the test server. I have various static files under Engoi/root, and templates are in Engoi/templates - Engoi/engoi.yaml tells TT where they are. (I also keep debug off normally, I set an env variable to turn it on, so I often start the test server with export ENGOI_DEBUG=1; ./script/engoi_server.pl -r ... ) So now I try to run it under apache2/mod_perl (which I know runs fine as my old site has used it for more than a year). The problem I get is that the templates directory is not seen. I have tried (as a temp thing while I work out what is happening) to symlink them into /usr/local/apache2, that doesn't help. (I also can't seem to set the env variable to turn on debug for the server process, which I can't currently figure out ... ) So my question is : when I start/stop apache, where will it look for the config file? and when it finds it, if there are relative paths to other stuff like templates, where does it expect them to be relative to? I expected that answer to be where you issue the command to start the server from, but that seems not to be the case. In the end I *might* migrate to fastcgi, so what would the answer be to this in that case? I guess, wherever you start the fastcgi server process from? cheers Daniel -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] insecure deps with Module::Pluggable::Fast
bit of a head scratcher ... : trying to boot my app under apache2/mod_perl. 2 boxes, each have the same codebase, exactly, including apache config files. One boots OK, the other says : [Mon Feb 26 20:28:50 2007] [error] Couldn't load Catalyst::Plugin::ConfigLoader::YAML, Insecure dependency in require while running with -T switch at /usr/local/lib/perl5/site_perl/5.8.8/Module/Pluggable/Fast.pm line 82.\n at /usr/local/lib/perl5/site_perl/5.8.8/Module/Pluggable/Fast.pm line 84.\nCompilation failed in require at (eval 4) line 3.\n when I try to start. Both have $Module::Pluggable::Fast::VERSION=0.18 The one that is OK didn't have M::P::F at all and was still running fine - I expected the problem to appear when I installed it. That box has not been used for dev at all, I just use it as a test server. It's possible that some module, somewhere, on the other is slightly older, but if so it's not one of the obvious ones ... any ideas? I can turn off taint for a bit, but it's odd. D -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] insecure deps with Module::Pluggable::Fast
one without a version string - but when I to cpan C::P::C::Y: it says its up to date ... that explains why it didn't even get on the one box. still not sure why the taint error though - guess I can remove M::P::F though, see if that fixes things thanks Brian On 2/26/07, Brian Cassidy [EMAIL PROTECTED] wrote: Daniel McBrearty wrote: [Mon Feb 26 20:28:50 2007] [error] Couldn't load Catalyst::Plugin::ConfigLoader::YAML, Insecure dependency in require while running with -T switch at /usr/local/lib/perl5/site_perl/5.8.8/Module/Pluggable/Fast.pm line 82.\n at /usr/local/lib/perl5/site_perl/5.8.8/Module/Pluggable/Fast.pm line 84.\nCompilation failed in require at (eval 4) line 3.\n when I try to start. Both have $Module::Pluggable::Fast::VERSION=0.18 What version of ConfigLoader do you have? Version 0.1 (from july of last year) removed the dep on M::P::F. -Brian ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] insecure deps with Module::Pluggable::Fast
you're right, sorry, my bad ... It was 0.06 - I just updated to 0.13, and that's fixed. Now I have a similar error in my schema ... anyone know the cpan command to globally update my libraries ... !? thanks again. On 2/26/07, Brian Cassidy [EMAIL PROTECTED] wrote: Daniel McBrearty wrote: one without a version string - but when I to cpan C::P::C::Y: it says its up to date ... that explains why it didn't even get on the one box. still not sure why the taint error though - guess I can remove M::P::F though, see if that fixes things You're looking at the wrong thing. Look at Catalyst::Plugin::ConfigLoader -- not ConfigLoader::YAML. Anyway, i know it's got to be old, because, since August of '06, the loader formats are stored in Config::Any (i.e. Catalyst::Plugin::ConfigLoader::YAML no longer exists). -Brian ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] insecure deps with Module::Pluggable::Fast
sorted. just needed to update DBIx::Class. thanks again. On 2/26/07, Daniel McBrearty [EMAIL PROTECTED] wrote: you're right, sorry, my bad ... It was 0.06 - I just updated to 0.13, and that's fixed. Now I have a similar error in my schema ... anyone know the cpan command to globally update my libraries ... !? thanks again. On 2/26/07, Brian Cassidy [EMAIL PROTECTED] wrote: Daniel McBrearty wrote: one without a version string - but when I to cpan C::P::C::Y: it says its up to date ... that explains why it didn't even get on the one box. still not sure why the taint error though - guess I can remove M::P::F though, see if that fixes things You're looking at the wrong thing. Look at Catalyst::Plugin::ConfigLoader -- not ConfigLoader::YAML. Anyway, i know it's got to be old, because, since August of '06, the loader formats are stored in Config::Any (i.e. Catalyst::Plugin::ConfigLoader::YAML no longer exists). -Brian ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] www.engoi.com nearly migrated to catalyst
Hi, The port of www.engoi.com (currently a collection of cgi's under apache/mod_perl) to cat is nearly there. You can take a look at http://www.sodabean.net Note: 1. some pages are very slow. But they will be served as static pages in production, so no problem for now. (They are served dynamically here so that translators can see what is going on as they make edits.) 2. some CSS problems in IE to fix, as usual ... It doesn't look much different to the existing site, but under the hood it's a whole new app. The biggest thing we now have that was much missing is a way of managing the workflow of translations from dev to production via the translation server. This was a huge issue in the old site that made continuous development and upgrade of the site almost impossible. The flexibility of cat's MVC architecture has made this possible; multiple models to get data from the database, have a specialist api over the db, and to add new English text to the site in development without having the problem of keeping databases in sync. By grepping for text tags in templates feeding that back into the db, translators can now see the text tags for the site grouped by the pages in which they appear. The chained feature has been fantastic both for dividing the namespace by language (both the native language AND the language being learned), and also for providing access control to admin and translator functions by role. All of this has been so that we have a decent platform to add new features to the site in future (there's a lot of new stuff to add). It's been so busy doing this in my spare time that I have not thought much about making any of this available back to the community. I hope that that will change in future, and that one day engoi will have some nicely matured features to put back into cat. (First we have to get this thing off teh ground though ;-) ) lots of thanks to this list for immeasurable help in getting this job (nearly) done, and helping me along that never-ending learning curve. Daniel -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] unicode best practices
hmmm. I got round to this today. Installed e::w, put it at the top of the code ... but it's not saying anything at all (I guess I should be looking for warnings in the debug output?) On 2/15/07, Jonathan Rockway [EMAIL PROTECTED] wrote: Daniel McBrearty wrote: I also found once I started using the above, I needed to install C::V::TT::ForceUTF8 to avoid garbled output. This means you're probably not encoding octets to characters properly. See what encoding::warnings says about your code. Also, read http://www.catalystframework.org/calendar/2006/21 for unicode details. There is also somewhere a module which causes stash to be flagged utf8, but I haven't needed it. Yet ... Shouldn't be necessary if you're writing correct code. -- package JAPH;use Catalyst qw/-Debug/;($;=JAPH)-config(name = do { $,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //, ;$;]-[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;-setup; ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] putting an object in the stash
On 3/13/07, Kiki [EMAIL PROTECTED] wrote: Simon Wilcox wrote: Not necessarily, you can also bless scalars and arrays. A blessed array, in particular can be a very effective way of improving performance for certain types of data structures. Strictly speaking you can bless any reference, although the most useful are hashes and arrays. true. So it's perhaps more accurate to say you can put a ref to anything ([EMAIL PROTECTED], blessed or not ... ) on the stash. -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] putting an object in the stash
If I do that, the values from $obj hash reference are not put in the template like when $obj is a reference to a common hash. Impossible to know what you mean here without an example of the template, but I commonly put DBIC objects on the stash, and call methods on them with the dot operator in TT. TT is smart enough to work out what needs to be done and do it so whether the underlying code is $obj-element; or $obj-{element}; [%- obj.element -%] works. (Maybe it always uses the second version - as I've never had a problem, I've never looked ... So I don't really get what the problem is here. -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] putting an object in the stash
Hi, The problem appears when I want to use only [% element %] and not [% obj.element %] in templates. And I want to use the first way because there are very many variables and it is more simple. As others have said, I think this is going to bite you in the arse later. K-I-S-S. It seems we have differing definitions of simple though. -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Apache2+fcgid or Lighttpd
I thought of using fcgi also, but wondered if the fact that lighty doesn't make the fcgi connection persistent was significant. On 3/15/07, Michele Beltrame [EMAIL PROTECTED] wrote: Hello! I'm about to deploy an application, and this time I can choose to use Lightpd instead of Apache+fcgid, which I commonly use. I have no problem with the latter configuration, but I was wondering if someone has comments/experience about Lighttpd for running Catalyst applications, i.e. speed, memory footprint, etc... I'm on a VPS environment, so speed can be an import factor for choice. Thanks, Michele. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Apache2+fcgid or Lighttpd
no, I'm wrong - I read it *somewhere*, but it was likely an out of date doc ... I just googled and found this: http://blog.lighttpd.net/articles/2006/11/29/faster-fastcgi (scroll down or search romauld to see that it's persistent since 1.5.0) On 3/19/07, Toby Corkindale [EMAIL PROTECTED] wrote: Daniel McBrearty wrote: I thought of using fcgi also, but wondered if the fact that lighty doesn't make the fcgi connection persistent was significant. Are you sure? It looked persistent to me. On 3/15/07, Michele Beltrame [EMAIL PROTECTED] wrote: I'm about to deploy an application, and this time I can choose to use Lightpd instead of Apache+fcgid, which I commonly use. I have no problem with the latter configuration, but I was wondering if someone has comments/experience about Lighttpd for running Catalyst applications, i.e. speed, memory footprint, etc... I swapped over to lighttpd and am currently impressed - it seems to perform better than Apache under high numbers of concurrent connections due to its non-forking architecture. ie. Where apache would spawn more and more processes, chew loads of memory, and then hit MaxClients and stop accepting connections, Lighttpd seems to keep on truckin' and queuing them up. Toby ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Is it time for a Catalyst Conference yet?
FWIW (an aside really) there will be some kind of perl conference here in Belgium this year, I should be talking something about how we used Catalyst to rebuild our site. We're still not online with the cat version due to delays with translators, but that will get fixed soon. Anyhow, the cat architecture has been a godsend, especially the ability to support anything you can think of as a model, and lots of 'em On 5/9/07, John Napiorkowski [EMAIL PROTECTED] wrote: --- Thomas Klausner [EMAIL PROTECTED] wrote: Hi! On Tue, May 08, 2007 at 05:13:03PM -0500, Dave Rolsky wrote: Just a general question to the list to see if there is interest in getting together a conference dedicated to Catalyst developers. Or is the feeling that the normal Perl conferences cover all our needs? .. One possibility might be to try to piggyback a Catalyst day before/after an existing Perl conference like YAPC or OSCON. That way you don't have to work as hard to get an audience. BTW, this is basically what we try to achieve with the Hackathons at YAPC::Europe: Give certain projects time and place to do a Mini-Conference / Workshop embedded in the YAPC: http://vienna.yapceurope.org/ye2007/cfh.html I was thinking something like this, something with a hackthon feel and maybe one or two lightning talks and some words from the Catalyst main developers about future thoughts, etc. I'll check the list of upcoming YAPCs. Thanks for the idea. I just thought to float the idea on the list and see if there is more than tepid interest. --john __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com www.danmcb.com BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: Shoot out -- Catalyst / RoR / Other MVC apps --
you could probably google for google and it would be on about page 2 ... On 5/11/07, Michael Reece [EMAIL PROTECTED] wrote: now the next time this happens, googling for cpantools.org will find this thread and all will be clear! ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] debug mode
FWIW I just turn debug off, and do export MYAPP_DEBUG=1; script/myapp_server.pl -r; as I am developing. As that line is always there in the command buffer it's no hassle. If I want I can have BEGIN { $ENV{MYAPP_DEBUG} = 1; } in test scripts. Basically i find just using one mechanism is easier, less to worry about later on. as they say, it works for me ... -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com danmcb.vox.com danmcb.blogger.com BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] flexible attributes on db objects
thanks Perrin. The wikipedia article covers it well. On 6/8/07, Perrin Harkins [EMAIL PROTECTED] wrote: On 6/8/07, Daniel McBrearty [EMAIL PROTECTED] wrote: Comments? horrendous hackery? laziness? a landmine? ok in some cases? It's pretty well covered by Wikipedia here: http://en.wikipedia.org/wiki/Entity-Attribute-Value_model I sometimes use this in places where I have to let end users add attributes to objects, but the poor performance and lack of integrity constraints make it a poor choice for anything else in my opinion. - Perrin ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com danmcb.vox.com danmcb.blogger.com BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Forms generation
i took a look at the Reaction repo yesterday. I see the docs and examples have come a long way. When you first showed me I was quite new to cat and it was young, so I was just baffled. I'm looking forward to having time to play with it again. On 6/15/07, Matt S Trout [EMAIL PROTECTED] wrote: On Thu, Jun 14, 2007 at 08:03:53PM -0700, [EMAIL PROTECTED] wrote: i'll probably realize that as soon as i try to swap DFV for RHTMF or other, and wish i had abstracted or adopted a general API, but until then i'm happy enough with models returning DFV validation closures, et al.. but only if that also supports my goal of not having the authoritative list of fields to be rendered defined in a .pm or .yml file, but in the .html template where it belongs imho. I'm not sure it always does. In fact, I don't think it always belongs anywhere :) Sometimes you'll want to select the fields in the view (not necessarily the template itself, but at least in something that belongs to the view, not anything else). But equally, sometimes you'll want to be able to say just render all applicable fields - for e.g. for uniform CRUD type stuff, so when the model changes you don't have to run round updating all the templates. Getting DRY and clean factoring for this stuff can be ... interesting. I think the Reaction model is a damn good stab at this with the new widget-oriented view layer I've checked in recently; I'll try and post some examples to the list soon so people can see what I'm gibbering about. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical DirectorWant a managed development or deployment platform? Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote http://chainsawblues.vox.com/ http://www.shadowcatsystems.co.uk/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com danmcb.vox.com danmcb.blogger.com BTW : 0873928131 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/