Permalink
Browse files

Catalyst application skeleton

  • Loading branch information...
1 parent 7d44c25 commit 3c724240417778931fb35c473a4929e27aa5dca9 @DimaD DimaD committed Sep 20, 2008
View
@@ -0,0 +1,4 @@
+This file documents the revision history for Perl extension Perlflow.
+
+0.01 2008-09-20 18:52:45
+ - initial revision, generated by Catalyst
View
@@ -0,0 +1,19 @@
+# IMPORTANT: if you delete this file your app will not work as
+# expected. you have been warned
+use inc::Module::Install;
+
+name 'Perlflow';
+all_from 'lib/Perlflow.pm';
+
+requires 'Catalyst::Runtime' => '5.7014';
+requires 'Catalyst::Plugin::ConfigLoader';
+requires 'Catalyst::Plugin::Static::Simple';
+requires 'Catalyst::Action::RenderView';
+requires 'parent';
+requires 'Config::General'; # This should reflect the config file format you've chosen
+ # See Catalyst::Plugin::ConfigLoader for supported formats
+catalyst;
+
+install_script glob('script/*.pl');
+auto_install;
+WriteAll;
View
@@ -0,0 +1 @@
+Run script/perlflow_server.pl to test the application.
View
@@ -0,0 +1,69 @@
+package Perlflow;
+
+use strict;
+use warnings;
+#I use catamoose here, so the path is custom
+use lib '/Users/dzema/src/Catalyst-Runtime/lib/';
+
+use Catalyst::Runtime '5.70';
+
+# Set flags and add plugins for the application
+#
+# -Debug: activates the debug mode for very useful log messages
+# ConfigLoader: will load the configuration from a Config::General file in the
+# application's home directory
+# Static::Simple: will serve static files from the application's root
+# directory
+
+use parent qw/Catalyst/;
+use Catalyst qw/-Debug
+ ConfigLoader
+ Static::Simple/;
+our $VERSION = '0.01';
+
+# Configure the application.
+#
+# Note that settings in Perlflow.conf (or other external
+# configuration file that you set up manually) take precedence
+# over this when using ConfigLoader. Thus configuration
+# details given here can function as a default configuration,
+# with a external configuration file acting as an override for
+# local deployment.
+
+__PACKAGE__->config( name => 'Perlflow' );
+
+# Start the application
+__PACKAGE__->setup();
+
+
+__PACKAGE__->config->{static}{ignore_dirs} = [qw/.svn .git/];
+__PACKAGE__->config->{static}{include_path} = [ __PACKAGE__->config->{root} ];
+
+=head1 NAME
+
+Perlflow - Catalyst based application
+
+=head1 SYNOPSIS
+
+ script/Perlflow_server.pl
+
+=head1 DESCRIPTION
+
+[enter your description here]
+
+=head1 SEE ALSO
+
+L<Perlflow::Controller::Root>, L<Catalyst>
+
+=head1 AUTHOR
+
+Dmitriy Dzema
+
+=head1 LICENSE
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+1;
View
@@ -0,0 +1,68 @@
+package Perlflow;
+
+use strict;
+use warnings;
+use lib '/Users/dzema/src/Catalyst-Runtime/lib/';
+
+use Catalyst::Runtime '5.70';
+
+# Set flags and add plugins for the application
+#
+# -Debug: activates the debug mode for very useful log messages
+# ConfigLoader: will load the configuration from a Config::General file in the
+# application's home directory
+# Static::Simple: will serve static files from the application's root
+# directory
+
+use parent qw/Catalyst/;
+use Catalyst qw/-Debug
+ ConfigLoader
+ Static::Simple/;
+our $VERSION = '0.01';
+
+# Configure the application.
+#
+# Note that settings in Perlflow.conf (or other external
+# configuration file that you set up manually) take precedence
+# over this when using ConfigLoader. Thus configuration
+# details given here can function as a default configuration,
+# with a external configuration file acting as an override for
+# local deployment.
+
+__PACKAGE__->config( name => 'Perlflow' );
+
+# Start the application
+__PACKAGE__->setup();
+
+
+__PACKAGE__->config->{static}{ignore_dirs} = [qw/.svn .git/];
+__PACKAGE__->config->{static}{include_path} = [ __PACKAGE__->config->{root} ];
+
+=head1 NAME
+
+Perlflow - Catalyst based application
+
+=head1 SYNOPSIS
+
+ script/Perlflow_server.pl
+
+=head1 DESCRIPTION
+
+[enter your description here]
+
+=head1 SEE ALSO
+
+L<Perlflow::Controller::Root>, L<Catalyst>
+
+=head1 AUTHOR
+
+Dmitriy Dzema
+
+=head1 LICENSE
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+1;
@@ -0,0 +1,47 @@
+package Perlflow::Controller::Root;
+
+use strict;
+use warnings;
+use parent 'Catalyst::Controller';
+
+__PACKAGE__->config->{namespace} = '';
+
+=head1 NAME
+
+Perlflow::Controller::Root - Root Controller for Perlflow
+
+
+=cut
+
+sub index :Path :Args(0) {
+ my ( $self, $c ) = @_;
+
+
+}
+
+sub default :Path {
+ my ( $self, $c ) = @_;
+ $c->response->body( 'Page not found' );
+ $c->response->status(404);
+}
+
+=head2 end
+
+Attempt to render a view, if needed.
+
+=cut
+
+sub end : ActionClass('RenderView') {}
+
+=head1 AUTHOR
+
+Dmitriy Dzema
+
+=head1 LICENSE
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+1;
View
@@ -0,0 +1,42 @@
+package Perlflow::View::TT;
+
+use strict;
+use base 'Catalyst::View::TT';
+
+__PACKAGE__->config(
+ {
+
+ CATALYST_VAR => 'C',
+ INCLUDE_PATH => [ Perlflow->path_to('tpl') ],
+ DEBUG => undef, #all, service, context, parser, provider,
+ PRE_CHOMP => 3,
+ POST_CHOMP => 3,
+ TRIM => 1,
+ TEMPLATE_EXTENSION => '.tt'
+ }
+);
+
+=head1 NAME
+
+Perlflow::View::TT - TT View for Perlflow
+
+=head1 DESCRIPTION
+
+TT View for Perlflow.
+
+=head1 AUTHOR
+
+=head1 SEE ALSO
+
+L<Perlflow>
+
+Dmitriy Dzema
+
+=head1 LICENSE
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+1;
View
@@ -0,0 +1,15 @@
+name: perlflow
+Model::DB:
+ connect_info:
+ - "DBI:mysql:host=localhost;database=perlflow;mysql_enable_utf8=1"
+ - "perlflow"
+ - "perlflow"
+ -
+ AutoCommit: 1
+ quote_char: '`'
+ name_sep: '.'
+ -
+ quote_char: '`'
+ name_sep: '.'
+session:
+ expires: 2592000
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
Binary file not shown.
View
@@ -0,0 +1,37 @@
+#!/usr/bin/perl -w
+
+BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }
+
+use strict;
+use warnings;
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+use Perlflow;
+
+Perlflow->run;
+
+1;
+
+=head1 NAME
+
+Perlflow_cgi.pl - Catalyst CGI
+
+=head1 SYNOPSIS
+
+See L<Catalyst::Manual>
+
+=head1 DESCRIPTION
+
+Run a Catalyst application as a cgi script.
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
View
@@ -0,0 +1,74 @@
+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+use Getopt::Long;
+use Pod::Usage;
+use Catalyst::Helper;
+
+my $force = 0;
+my $mech = 0;
+my $help = 0;
+
+GetOptions(
+ 'nonew|force' => \$force,
+ 'mech|mechanize' => \$mech,
+ 'help|?' => \$help
+ );
+
+pod2usage(1) if ( $help || !$ARGV[0] );
+
+my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } );
+
+pod2usage(1) unless $helper->mk_component( 'perlflow', @ARGV );
+
+1;
+
+=head1 NAME
+
+perlflow_create.pl - Create a new Catalyst Component
+
+=head1 SYNOPSIS
+
+perlflow_create.pl [options] model|view|controller name [helper] [options]
+
+ Options:
+ -force don't create a .new file where a file to be created exists
+ -mechanize use Test::WWW::Mechanize::Catalyst for tests if available
+ -help display this help and exits
+
+ Examples:
+ perlflow_create.pl controller My::Controller
+ perlflow_create.pl controller My::Controller BindLex
+ perlflow_create.pl -mechanize controller My::Controller
+ perlflow_create.pl view My::View
+ perlflow_create.pl view MyView TT
+ perlflow_create.pl view TT TT
+ perlflow_create.pl model My::Model
+ perlflow_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
+ dbi:SQLite:/tmp/my.db
+ perlflow_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
+ dbi:Pg:dbname=foo root 4321
+
+ See also:
+ perldoc Catalyst::Manual
+ perldoc Catalyst::Manual::Intro
+
+=head1 DESCRIPTION
+
+Create a new Catalyst Component.
+
+Existing component files are not overwritten. If any of the component files
+to be created already exist the file will be written with a '.new' suffix.
+This behavior can be suppressed with the C<-force> option.
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
Oops, something went wrong.

0 comments on commit 3c72424

Please sign in to comment.