SlideShare ist ein Scribd-Unternehmen logo
1 von 328
Downloaden Sie, um offline zu lesen
Mojolicious.
                         The web in a box!
                               Perlburg 2010
                               English version




пятница, 26 февраля 2010 г.
http://mojolicious.org/
пятница, 26 февраля 2010 г.
Sebastian Riedel
                                 автор Catalyst и Mojo
                                  http://labs.kraih.com/




пятница, 26 февраля 2010 г.
http://twitter.com/kraih
пятница, 26 февраля 2010 г.
Sebastian Riedel
                                 автор Catalyst и Mojo
                                  http://labs.kraih.com




пятница, 26 февраля 2010 г.
Sebastian Riedel
                              creator of Catalyst and Mojolicious
                                     http://labs.kraih.com




пятница, 26 февраля 2010 г.
Catalyst + Mojo = ?
пятница, 26 февраля 2010 г.
What is
                              Mojolicious?


пятница, 26 февраля 2010 г.
What is Mojolicious?
                  • Pure Perl amazing web framework, without
                         any hidden magiс
                  • No requirements besides Perl 5.8.1
                  • Very clean and object oriented API
                  • Full stack HTTP 1.1, WebSocket, IPv6, SSL
                  • CGI, FastCGI, PSGI, Daemon and Prefork
                  • There are 3 frameworks:
                              Mojo, Mojolicious and Mojolicious::Lite
пятница, 26 февраля 2010 г.
«Fresh code,
                           based upon years of
                          experience developing
                                Catalyst»

пятница, 26 февраля 2010 г.
пятница, 26 февраля 2010 г.
Pure Perl
                              web framework


пятница, 26 февраля 2010 г.
• Mojo::Base
                   • Mojo::ByteStream
                   • Mojo::Template, Mojo::JSON
                   • Mojo::Loader, Mojo::Log, Mojo::Path
                   • Mojo::URL, Mojo::Parameters, Mojo::Content
                   • Mojo::Message::Request,
                              Mojo::Message::Response,
                              Mojo::Headers, Mojo::Cookie, Mojo::Date


пятница, 26 февраля 2010 г.
• Mojo::Base
                   • Mojo::ByteStream
                   • Mojo::Template, Mojo::JSON
                   • Mojo::Loader, Mojo::Log, Mojo::Path
                   • Mojo::URL, Mojo::Parameters, Mojo::Content
                   • Mojo::Message::Request,
                              Mojo::Message::Response,
                              Mojo::Headers, Mojo::Cookie, Mojo::Date


пятница, 26 февраля 2010 г.
Mojo::Base
                              Minimal Base Class For Mojo Projects




пятница, 26 февраля 2010 г.
package App;
               use base ‘Mojo::Base’;

               __PACKAGE__->attr(conf => sub {
               	

 return do ‘conf/app.conf’;
               });
               __PACKAGE__->attr(db => sub {
               	

 my $self = shift;
               	

 return Util->db($self->conf->{'db'});
               });

               sub dispatch { ... }
пятница, 26 февраля 2010 г.
package App;
               use base ‘Mojo::Base’;

               __PACKAGE__->attr(conf => sub {
               	

 return do ‘conf/app.conf’;
               });
               __PACKAGE__->attr(db => sub {
               	

 my $self = shift;
               	

 return Util->db($self->conf->{'db'});
               });

               sub dispatch { ... }
пятница, 26 февраля 2010 г.
package App;
               use base ‘Mojo::Base’;

               __PACKAGE__->attr(conf => sub {
               	

 return do ‘conf/app.conf’;
               });
               __PACKAGE__->attr(db => sub {
               	

 my $self = shift;
               	

 return Util->db($self->conf->{'db'});
               });

               sub dispatch { ... }
пятница, 26 февраля 2010 г.
• Mojo::Base
                   • Mojo::ByteStream
                   • Mojo::Template, Mojo::JSON
                   • Mojo::Loader, Mojo::Log, Mojo::Path
                   • Mojo::URL, Mojo::Parameters, Mojo::Content
                   • Mojo::Message::Request,
                              Mojo::Message::Response,
                              Mojo::Headers, Mojo::Cookie, Mojo::Date


пятница, 26 февраля 2010 г.
Mojo::ByteStream
                                   ByteStream




пятница, 26 февраля 2010 г.
use Mojo::ByteStream;
               my $s = Mojo::ByteStream->new('foo_bar');

               $s->camelize; $s->decamelize;
               $s->b64_encode; $s->b64_decode;
               $s->encode('utf8'); $s->decode('utf8');
               $s->html_escape; $s->html_unescape;
               $s->qp_encode; $s->qp_decode;
               $s->quote; $stream->unquote;
               $s->url_escape; $s->url_unescape;
               $s->xml_escape;
               $s->punycode_encode; $s->punycode_decode
пятница, 26 февраля 2010 г.
use Mojo::ByteStream;
               my $s = Mojo::ByteStream->new('foo_bar');

               $s->camelize; $s->decamelize;
               $s->b64_encode; $s->b64_decode;
               $s->encode('utf8'); $s->decode('utf8');
               $s->html_escape; $s->html_unescape;
               $s->qp_encode; $s->qp_decode;
               $s->quote; $stream->unquote;
               $s->url_escape; $s->url_unescape;
               $s->xml_escape;
               $s->punycode_encode; $s->punycode_decode
пятница, 26 февраля 2010 г.
use Mojo::ByteStream;
               my $s = Mojo::ByteStream->new('foo_bar');

               $s->camelize; $s->decamelize;
               $s->b64_encode; $s->b64_decode;
               $s->encode('utf8'); $s->decode('utf8');
               $s->html_escape; $s->html_unescape;
               $s->qp_encode; $s->qp_decode;
               $s->quote; $stream->unquote;
               $s->url_escape; $s->url_unescape;
               $s->xml_escape;
               $s->punycode_encode; $s->punycode_decode
пятница, 26 февраля 2010 г.
use Mojo::ByteStream;
               my $s = Mojo::ByteStream->new('foo_bar');

               $s->camelize; $s->decamelize;
               $s->b64_encode; $s->b64_decode;
               $s->encode('utf8'); $s->decode('utf8');
               $s->html_escape; $s->html_unescape;
               $s->qp_encode; $s->qp_decode;
               $s->quote; $stream->unquote;
               $s->url_escape; $s->url_unescape;
               $s->xml_escape;
               $s->punycode_encode; $s->punycode_decode
пятница, 26 февраля 2010 г.
use Mojo::ByteStream;
               my $s = Mojo::ByteStream->new('foo_bar');

               $s->camelize; $s->decamelize;
               $s->b64_encode; $s->b64_decode;
               $s->encode('utf8'); $s->decode('utf8');
               $s->html_escape; $s->html_unescape;
               $s->qp_encode; $s->qp_decode;
               $s->quote; $stream->unquote;
               $s->url_escape; $s->url_unescape;
               $s->xml_escape;
               $s->punycode_encode; $s->punycode_decode
пятница, 26 февраля 2010 г.
use Mojo::ByteStream;
               my $s = Mojo::ByteStream->new('foo_bar');

               $s->camelize; $s->decamelize;
               $s->b64_encode; $s->b64_decode;
               $s->encode('utf8'); $s->decode('utf8');
               $s->html_escape; $s->html_unescape;
               $s->qp_encode; $s->qp_decode;
               $s->quote; $stream->unquote;
               $s->url_escape; $s->url_unescape;
               $s->xml_escape;
               $s->punycode_encode; $s->punycode_decode
пятница, 26 февраля 2010 г.
use Mojo::ByteStream;
               my $s = Mojo::ByteStream->new('foo_bar');

               $s->camelize; $s->decamelize;
               $s->b64_encode; $s->b64_decode;
               $s->encode('utf8'); $s->decode('utf8');
               $s->html_escape; $s->html_unescape;
               $s->qp_encode; $s->qp_decode;
               $s->quote; $stream->unquote;
               $s->url_escape; $s->url_unescape;
               $s->xml_escape;
               $s->punycode_encode; $s->punycode_decode
пятница, 26 февраля 2010 г.
use Mojo::ByteStream;
               my $s = Mojo::ByteStream->new('foo_bar');

               $s->camelize; $s->decamelize;
               $s->b64_encode; $s->b64_decode;
               $s->encode('utf8'); $s->decode('utf8');
               $s->html_escape; $s->html_unescape;
               $s->qp_encode; $s->qp_decode;
               $s->quote; $stream->unquote;
               $s->url_escape; $s->url_unescape;
               $s->xml_escape;
               $s->punycode_encode; $s->punycode_decode
пятница, 26 февраля 2010 г.
use Mojo::ByteStream;
               my $s = Mojo::ByteStream->new('foo_bar');

               $s->camelize; $s->decamelize;
               $s->b64_encode; $s->b64_decode;
               $s->encode('utf8'); $s->decode('utf8');
               $s->html_escape; $s->html_unescape;
               $s->qp_encode; $s->qp_decode;
               $s->quote; $stream->unquote;
               $s->url_escape; $s->url_unescape;
               $s->xml_escape;
               $s->punycode_encode; $s->punycode_decode
пятница, 26 февраля 2010 г.
use Mojo::ByteStream;
               my $s = Mojo::ByteStream->new('foo_bar');

               $s->camelize; $s->decamelize;
               $s->b64_encode; $s->b64_decode;
               $s->encode('utf8'); $s->decode('utf8');
               $s->html_escape; $s->html_unescape;
               $s->qp_encode; $s->qp_decode;
               $s->quote; $stream->unquote;
               $s->url_escape; $s->url_unescape;
               $s->xml_escape;
               $s->punycode_encode; $s->punycode_decode
пятница, 26 февраля 2010 г.
• Mojo::Base
                   • Mojo::ByteStream
                   • Mojo::Template, Mojo::JSON
                   • Mojo::Loader, Mojo::Log, Mojo::Path
                   • Mojo::URL, Mojo::Parameters, Mojo::Content
                   • Mojo::Message::Request,
                              Mojo::Message::Response,
                              Mojo::Headers, Mojo::Cookie, Mojo::Date


пятница, 26 февраля 2010 г.
Mojo::Template
                                 Perlish Templates!




пятница, 26 февраля 2010 г.
% my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <%= $_->{title} %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
% my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <%= $_->{title} %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
% my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <%= $_->{title} %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
%= my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <%= $_->{title} %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
%== my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <%= $_->{title} %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
% my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <%= $_->{title} %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
% use Foo::Bar;

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <%= $_->{title} %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
% my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <%= $_->{title} %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
% my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <%= $_->{title} %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
% my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <%= $_->{title} %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
% my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <%= $_->{title} %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
% my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <%== $_->{title} %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
% my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <% my $foo = $_->{id} + 100_500; %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
% my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <% my $foo = $_->{id} + 100_500; %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
% my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <%= $_->{title} %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
% my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <%= $_->{title} %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
% my $list = $self->stash(‘list’);

               <ul>
               % for (@$list) {
               	

 <li>
               	

 	

 <%= $_->{title} %>
               	

 </li>
               %}
               </ul>

               <p><%# comment %></p>
пятница, 26 февраля 2010 г.
Easy as PHP,
                              but cool as Perl
                                  Mojo::Template




пятница, 26 февраля 2010 г.
• Mojo::Base
                   • Mojo::ByteStream
                   • Mojo::Template, Mojo::JSON
                   • Mojo::Loader, Mojo::Log, Mojo::Path
                   • Mojo::URL, Mojo::Parameters, Mojo::Content
                   • Mojo::Message::Request,
                              Mojo::Message::Response,
                              Mojo::Headers, Mojo::Cookie, Mojo::Date


пятница, 26 февраля 2010 г.
Mojo::JSON
                               Minimalistic JSON




пятница, 26 февраля 2010 г.
my $json = Mojo::JSON->new;

               my $string = $json->encode({foo => ‘bar’});

               my $hash = $json->decode(‘{"foo":"bar"}’);




пятница, 26 февраля 2010 г.
my $json = Mojo::JSON->new;

               my $string = $json->encode({foo => ‘bar’});

               my $hash = $json->decode(‘{"foo":"bar"}’);




пятница, 26 февраля 2010 г.
my $json = Mojo::JSON->new;

               my $string = $json->encode({foo => ‘bar’});

               my $hash = $json->decode(‘{"foo":"bar"}’);




пятница, 26 февраля 2010 г.
• Mojo::Base
                   • Mojo::ByteStream
                   • Mojo::Template, Mojo::JSON
                   • Mojo::Loader, Mojo::Log, Mojo::Path
                   • Mojo::URL, Mojo::Parameters, Mojo::Content
                   • Mojo::Message::Request,
                              Mojo::Message::Response,
                              Mojo::Headers, Mojo::Cookie, Mojo::Date


пятница, 26 февраля 2010 г.
Mojo::Loader
                              Class loader: load, reload, search




пятница, 26 февраля 2010 г.
Mojo::Loader
                              Class loader: load, reload, search




пятница, 26 февраля 2010 г.
• Mojo::Base
                   • Mojo::ByteStream
                   • Mojo::Template, Mojo::JSON
                   • Mojo::Loader, Mojo::Log, Mojo::Path
                   • Mojo::URL, Mojo::Parameters, Mojo::Content
                   • Mojo::Message::Request,
                              Mojo::Message::Response,
                              Mojo::Headers, Mojo::Cookie, Mojo::Date


пятница, 26 февраля 2010 г.
• Mojo::Base
                   • Mojo::ByteStream
                   • Mojo::Template, Mojo::JSON
                   • Mojo::Loader, Mojo::Log, Mojo::Path
                   • Mojo::URL, Mojo::Parameters, Mojo::Content
                   • Mojo::Message::Request,
                              Mojo::Message::Response,
                              Mojo::Headers, Mojo::Cookie, Mojo::Date


пятница, 26 февраля 2010 г.
• Mojo::Base
                   • Mojo::ByteStream
                   • Mojo::Template, Mojo::JSON
                   • Mojo::Loader, Mojo::Log, Mojo::Path
                   • Mojo::URL, Mojo::Parameters, Mojo::Content
                   • Mojo::Message::Request,
                              Mojo::Message::Response,
                              Mojo::Headers, Mojo::Cookie, Mojo::Date


пятница, 26 февраля 2010 г.
• Mojo::Trasaction, Mojo::Stateful
                   • Mojo::IOLoop
                   • Mojo::Client, Mojo::Server
                    • Mojo::Server::CGI, Mojo::Server::FastCGI
                    • Mojo::Server::PSGI
                    • Mojo::Server::Daemon and ::Prefork
                   • Mojo::Command
                    • Mojo::Command::Generate and ~ Server
пятница, 26 февраля 2010 г.
• Mojo::Trasaction, Mojo::Stateful
                   • Mojo::IOLoop
                   • Mojo::Client, Mojo::Server
                    • Mojo::Server::CGI, Mojo::Server::FastCGI
                    • Mojo::Server::PSGI
                    • Mojo::Server::Daemon and ::Prefork
                   • Mojo::Command
                    • Mojo::Command::Generate and ~ Server
пятница, 26 февраля 2010 г.
• Mojo::Trasaction, Mojo::Stateful
                   • Mojo::IOLoop
                   • Mojo::Client, Mojo::Server
                    • Mojo::Server::CGI, Mojo::Server::FastCGI
                    • Mojo::Server::PSGI
                    • Mojo::Server::Daemon and ::Prefork
                   • Mojo::Command
                    • Mojo::Command::Generate and ~ Server
пятница, 26 февраля 2010 г.
• Mojo::Trasaction, Mojo::Stateful
                   • Mojo::IOLoop
                   • Mojo::Client, Mojo::Server
                    • Mojo::Server::CGI, Mojo::Server::FastCGI
                    • Mojo::Server::PSGI
                    • Mojo::Server::Daemon and ::Prefork
                   • Mojo::Command
                    • Mojo::Command::Generate and ~ Server
пятница, 26 февраля 2010 г.
my $client = Mojo::Client->new;

               $client->get(
               	

 ‘http://goo.gl’ => sub {
               	

 	

 my ($self, $tx) = @_;
               	

 	

 say $tx->res;
               	

 }
               )->process;


пятница, 26 февраля 2010 г.
my $client = Mojo::Client->new;

               $self->client->get(
               	

 ‘http://goo.gl’ => sub {
               	

 	

 my ($self, $tx) = @_;
               	

 	

 say $tx->res;
               	

 }
               )->process;


пятница, 26 февраля 2010 г.
my $client = Mojo::Client->new;

               $client->get(
               	

 ‘http://goo.gl’ => sub {
               	

 	

 my ($self, $tx) = @_;
               	

 	

 say $tx->res;
               	

 }
               )->process;


пятница, 26 февраля 2010 г.
my $client = Mojo::Client->new;

               $client->post(
               	

 ‘http://goo.gl’ => sub {
               	

 	

 my ($self, $tx) = @_;
               	

 	

 say $tx->res;
               	

 }
               )->process;


пятница, 26 февраля 2010 г.
my $client = Mojo::Client->new;

               $client->head(
               	

 ‘http://goo.gl’ => sub {
               	

 	

 my ($self, $tx) = @_;
               	

 	

 say $tx->res;
               	

 }
               )->process;


пятница, 26 февраля 2010 г.
my $client = Mojo::Client->new;

               $client->put(
               	

 ‘http://goo.gl’ => sub {
               	

 	

 my ($self, $tx) = @_;
               	

 	

 say $tx->res;
               	

 }
               )->process;


пятница, 26 февраля 2010 г.
my $client = Mojo::Client->new;

               $client->get(
               	

 ‘http://goo.gl’ => sub {
               	

 	

 my ($self, $tx) = @_;
               	

 	

 say $tx->res;
               	

 }
               )->process;


пятница, 26 февраля 2010 г.
my $client = Mojo::Client->new;

               $client->get(
               	

 ‘http://goo.gl’ => sub {
               	

 	

 my ($self, $tx) = @_;
               	

 	

 say $tx->res;
               	

 }
               )->process;


пятница, 26 февраля 2010 г.
my $client = Mojo::Client->new;

               $client->get(
               	

 ‘http://goo.gl’ => sub {
               	

 	

 my ($self, $tx) = @_;
               	

 	

 say $tx->res;
               	

 }
               )->process;


пятница, 26 февраля 2010 г.
my $client = Mojo::Client->new;

               $client->get(
               	

 ‘http://goo.gl’ => sub {
               	

 	

 my ($self, $tx) = @_;
               	

 	

 say $tx->res;
               	

 }
               )->process;


пятница, 26 февраля 2010 г.
my $client = Mojo::Client->new;

               $client->get(
               	

 ‘http://goo.gl’ => sub {
               	

 	

 my ($self, $tx) = @_;
               	

 	

 say $tx->res;
               	

 }
               )->process;


пятница, 26 февраля 2010 г.
• Mojo::Trasaction, Mojo::Stateful
                   • Mojo::IOLoop
                   • Mojo::Client, Mojo::Server
                    • Mojo::Server::CGI, Mojo::Server::FastCGI
                    • Mojo::Server::PSGI
                    • Mojo::Server::Daemon and ::Prefork
                   • Mojo::Command
                    • Mojo::Command::Generate and ~ Server
пятница, 26 февраля 2010 г.
• Mojo::Trasaction, Mojo::Stateful
                   • Mojo::IOLoop
                   • Mojo::Client, Mojo::Server
                    • Mojo::Server::CGI, Mojo::Server::FastCGI
                    • Mojo::Server::PSGI
                    • Mojo::Server::Daemon and ::Prefork
                   • Mojo::Command
                    • Mojo::Command::Generate and ~ Server
пятница, 26 февраля 2010 г.
• Mojo::Trasaction, Mojo::Stateful
                   • Mojo::IOLoop
                   • Mojo::Client, Mojo::Server
                    • Mojo::Server::CGI, Mojo::Server::FastCGI
                    • Mojo::Server::PSGI
                    • Mojo::Server::Daemon and ::Prefork
                   • Mojo::Command
                    • Mojo::Command::Generate and ~ Server
пятница, 26 февраля 2010 г.
• Mojo::Trasaction, Mojo::Stateful
                   • Mojo::IOLoop
                   • Mojo::Client, Mojo::Server
                    • Mojo::Server::CGI, Mojo::Server::FastCGI
                    • Mojo::Server::PSGI
                    • Mojo::Server::Daemon and ::Prefork
                   • Mojo::Command
                    • Mojo::Command::Generate and ~ Server
пятница, 26 февраля 2010 г.
• Mojo::Trasaction, Mojo::Stateful
                   • Mojo::IOLoop
                   • Mojo::Client, Mojo::Server
                    • Mojo::Server::CGI, Mojo::Server::FastCGI
                    • Mojo::Server::PSGI
                    • Mojo::Server::Daemon and ::Prefork
                   • Mojo::Command
                    • Mojo::Command::Generate and ~ Server
пятница, 26 февраля 2010 г.
Mojolicious
                              is the web in a box!


пятница, 26 февраля 2010 г.
No requirements
                                  besides Perl 5.8.1




пятница, 26 февраля 2010 г.
Mojo runtime
пятница, 26 февраля 2010 г.
Perl 5.005
пятница, 26 февраля 2010 г.
Perl 5.006002
пятница, 26 февраля 2010 г.
Perl 5.008001
пятница, 26 февраля 2010 г.
Mojo Perl 5.010
пятница, 26 февраля 2010 г.
Object oriented API



пятница, 26 февраля 2010 г.
package TestMojo;
               use base 'Mojo';

               sub handler {
                   my ($self, $tx) = @_;
               	

               	

 warn $tx->req; warn $tx->req->url;
               	

                   $tx->res->headers
                            ->content_type('text/plain');
                   $tx->res->body('Hello Mojo!');
               }
пятница, 26 февраля 2010 г.
package TestMojo;
               use base 'Mojo';

               sub handler {
                   my ($self, $tx) = @_;
               	

               	

 warn $tx->req; warn $tx->req->url;
               	

                   $tx->res->headers
                            ->content_type('text/plain');
                   $tx->res->body('Hello Mojo!');
               }
пятница, 26 февраля 2010 г.
package TestMojo;
               use base 'Mojo';

               sub handler {
                   my ($self, $tx) = @_;
               	

               	

 warn $tx->req; warn $tx->req->url;
               	

                   $tx->res->headers
                            ->content_type('text/plain');
                   $tx->res->body('Hello Mojo!');
               }
пятница, 26 февраля 2010 г.
package TestMojo;
               use base 'Mojo';

               sub handler {
                   my ($self, $tx) = @_;
               	

               	

 warn $tx->req; warn $tx->req->url;
               	

                   $tx->res->headers
                            ->content_type('text/plain');
                   $tx->res->body('Hello Mojo!');
               }
пятница, 26 февраля 2010 г.
use overload '""' => sub
                  { shift->to_string },
                     fallback => 1;

пятница, 26 февраля 2010 г.
GET / HTTP/1.1
            Connection: keep-alive
            Accept: text/html, application/xhtml, ....
            Accept-Charset: windows-1251, utf-8; ...
            Accept-Encoding: gzip,deflate
            Accept-Language: ru,en-us;q=0.7,en;q=0.3
            Host: localhost:3000
            User-Agent: Mozilla/5.0 (Macintosh; ...
            Content-Length: 0
            Keep-Alive: 300

пятница, 26 февраля 2010 г.
GET / HTTP/1.1
            Connection: keep-alive
            Accept: text/html, application/xhtml, ....
            Accept-Charset: windows-1251, utf-8; ...
            Accept-Encoding: gzip,deflate
            Accept-Language: ru,en-us;q=0.7,en;q=0.3
            Host: localhost:3000
            User-Agent: Mozilla/5.0 (Macintosh; ...
            Content-Length: 0
            Keep-Alive: 300

пятница, 26 февраля 2010 г.
package TestMojo;
               use base 'Mojo';

               sub handler {
                   my ($self, $tx) = @_;
               	

               	

 warn $tx->req; warn $tx->req->url;
               	

                   $tx->res->headers
                            ->content_type('text/plain');
                   $tx->res->body('Hello Mojo!');
               }
пятница, 26 февраля 2010 г.
package TestMojo;
               use base 'Mojo';

               sub handler {
                   my ($self, $tx) = @_;
               	

               	

 warn $tx->req; warn $tx->req->url;
               	

                   $tx->res->headers
                            ->content_type('text/plain');
                   $tx->res->body('Hello Mojo!');
               }
пятница, 26 февраля 2010 г.
A generation
                              of the mojo app


пятница, 26 февраля 2010 г.
mojo generate app
                                  TestMojo
                              [mkdir]   test_mojo/script
                              [write]   test_mojo/script/test_mojo
                              [chmod]   test_mojo/script/test_mojo 744
                              [mkdir]   test_mojo/lib
                              [write]   test_mojo/lib/TestMojo.pm
                              [mkdir]   test_mojo/t
                              [write]   test_mojo/t/basic.t

пятница, 26 февраля 2010 г.
mojo generate app
                                  TestMojo
                              [mkdir]   test_mojo/script
                              [write]   test_mojo/script/test_mojo
                              [chmod]   test_mojo/script/test_mojo 744
                              [mkdir]   test_mojo/lib
                              [write]   test_mojo/lib/TestMojo.pm
                              [mkdir]   test_mojo/t
                              [write]   test_mojo/t/basic.t

пятница, 26 февраля 2010 г.
use FindBin;

               use lib "$FindBin::Bin/../lib";
               use lib "$FindBin::Bin/../../lib";

               # Application
               $ENV{MOJO_APP} ||= 'TestMojo';

               use Mojo::Commands;
               Mojo::Commands->start; # ->start(‘cgi’)


пятница, 26 февраля 2010 г.
mojo generate app
                                  TestMojo
                              [mkdir]   test_mojo/script
                              [write]   test_mojo/script/test_mojo
                              [chmod]   test_mojo/script/test_mojo 744
                              [mkdir]   test_mojo/lib
                              [write]   test_mojo/lib/TestMojo.pm
                              [mkdir]   test_mojo/t
                              [write]   test_mojo/t/basic.t

пятница, 26 февраля 2010 г.
package TestMojo;
               use base 'Mojo';

               sub handler {
                   my ($self, $tx) = @_;
               	

               	

 warn $tx->req; warn $tx->req->url;
               	

                   $tx->res->headers
                            ->content_type('text/plain');
                   $tx->res->body('Hello Mojo!');
               }
пятница, 26 февраля 2010 г.
mojo generate app
                                  TestMojo
                              [mkdir]   test_mojo/script
                              [write]   test_mojo/script/test_mojo
                              [chmod]   test_mojo/script/test_mojo 744
                              [mkdir]   test_mojo/lib
                              [write]   test_mojo/lib/TestMojo.pm
                              [mkdir]   test_mojo/t
                              [write]   test_mojo/t/basic.t

пятница, 26 февраля 2010 г.
#!/usr/bin/env perl

               use strict;
               use warnings;

               use Test::More tests => 1;

               use_ok('TestMojo');



пятница, 26 февраля 2010 г.
Full stack HTTP 1.1



пятница, 26 февраля 2010 г.
пятница, 26 февраля 2010 г.
MojoX::UserAgent
                                            Pascal Gaudette
                              Thanks to the Google of Summer Code 2009!




пятница, 26 февраля 2010 г.
Support WebSocket



пятница, 26 февраля 2010 г.
WebSocket protocol
                                 Google, Inc
                              December 16, 2009




пятница, 26 февраля 2010 г.
use Mojolicious::Lite;

               websocket ‘/echo’ => sub {
               	

 my $self = shift;
               	

 $self->receive_message(sub {
               	

 	

 my ($self, $msg) = @_;
               	

 	

 $self->send_massage("echo: $msg");
               	

 });
               };

               shagadelic;
пятница, 26 февраля 2010 г.
use Mojolicious::Lite;

               websocket ‘/echo’ => sub {
               	

 my $self = shift;
               	

 $self->receive_message(sub {
               	

 	

 my ($self, $msg) = @_;
               	

 	

 $self->send_massage("echo: $msg");
               	

 });
               };

               shagadelic;
пятница, 26 февраля 2010 г.
CGI, FastCGI, PSGI,
                        Daemon and Prefork


пятница, 26 февраля 2010 г.
script/test_mojo
                    COMMAND [OPTIONS]
                              script/test_mojo cgi
                              script/test_mojo fastcgi
                              script/test_mojo daemon
                              script/test_mojo daemon_prefork




пятница, 26 февраля 2010 г.
script/test_mojo
                    COMMAND [OPTIONS]
                              script/test_mojo cgi
                              script/test_mojo fastcgi
                              script/test_mojo daemon
                              script/test_mojo daemon_prefork




пятница, 26 февраля 2010 г.
PATH_INFO='/' script/
                       test_mojo cgi
                                       Easy testing
                    Can profile the mojolicious app using Devel::NYTProf




пятница, 26 февраля 2010 г.
script/test_mojo
                    COMMAND [OPTIONS]
                              script/test_mojo cgi
                              script/test_mojo fastcgi
                              script/test_mojo daemon
                              script/test_mojo daemon_prefork




пятница, 26 февраля 2010 г.
Mojo::Server::FCGI
                              script/test_mojo fcgi
                              script/test_mojo fcgi_prefork




пятница, 26 февраля 2010 г.
Mojo::Server::FCGI
                              script/test_mojo fcgi
                              script/test_mojo fcgi_prefork




пятница, 26 февраля 2010 г.
Mojo::Server::FCGI
                              script/test_mojo fcgi
                              script/test_mojo fcgi_prefork




пятница, 26 февраля 2010 г.
nginx + fcgi_prefork



пятница, 26 февраля 2010 г.
location / {
              fastcgi_pass 127.0.0.1:3000;
              fastcgi_param MOJO_APP App;
              fastcgi_param SCRIPT_NAME
                                            http://127.0.0.1:3000;
              fastcgi_param PATH_INFO
                                           $fastcgi_script_name;
              fastcgi_param QUERY_STRING
                                           $query_string;
              fastcgi_param REQUEST_METHOD
                                           $request_method;
              fastcgi_param CONTENT_TYPE
                                           $content_type;
              fastcgi_param CONTENT_LENGTH
                                         $content_length;
            }
пятница, 26 февраля 2010 г.
location / {
              fastcgi_pass 127.0.0.1:3000;
              fastcgi_param MOJO_APP App;
              fastcgi_param SCRIPT_NAME
                                            http://127.0.0.1:3000;
              fastcgi_param PATH_INFO
                                           $fastcgi_script_name;
              fastcgi_param QUERY_STRING
                                           $query_string;
              fastcgi_param REQUEST_METHOD
                                           $request_method;
              fastcgi_param CONTENT_TYPE
                                           $content_type;
              fastcgi_param CONTENT_LENGTH
                                         $content_length;
            }
пятница, 26 февраля 2010 г.
location / {
              fastcgi_pass 127.0.0.1:3000;
              fastcgi_param MOJO_APP App;
              fastcgi_param SCRIPT_NAME
                                            http://127.0.0.1:3000;
              fastcgi_param PATH_INFO
                                           $fastcgi_script_name;
              fastcgi_param QUERY_STRING
                                           $query_string;
              fastcgi_param REQUEST_METHOD
                                           $request_method;
              fastcgi_param CONTENT_TYPE
                                           $content_type;
              fastcgi_param CONTENT_LENGTH
                                         $content_length;
            }
пятница, 26 февраля 2010 г.
location / {
              fastcgi_pass 127.0.0.1:3000;
              fastcgi_param MOJO_APP App;
              fastcgi_param SCRIPT_NAME
                                            http://127.0.0.1:3000;
              fastcgi_param PATH_INFO
                                           $fastcgi_script_name;
              fastcgi_param QUERY_STRING
                                           $query_string;
              fastcgi_param REQUEST_METHOD
                                           $request_method;
              fastcgi_param CONTENT_TYPE
                                           $content_type;
              fastcgi_param CONTENT_LENGTH
                                         $content_length;
            }
пятница, 26 февраля 2010 г.
location / {
              fastcgi_pass 127.0.0.1:3000;
              fastcgi_param MOJO_APP App;
              fastcgi_param SCRIPT_NAME
                                            http://127.0.0.1:3000;
              fastcgi_param PATH_INFO
                                           $fastcgi_script_name;
              fastcgi_param QUERY_STRING
                                           $query_string;
              fastcgi_param REQUEST_METHOD
                                           $request_method;
              fastcgi_param CONTENT_TYPE
                                           $content_type;
              fastcgi_param CONTENT_LENGTH
                                         $content_length;
            }
пятница, 26 февраля 2010 г.
script/test_mojo
                    COMMAND [OPTIONS]
                              script/test_mojo cgi
                              script/test_mojo fastcgi
                              script/test_mojo daemon
                              script/test_mojo daemon_prefork




пятница, 26 февраля 2010 г.
MOJO_RELOAD=1
              script/test_mojo daemon
                              Code of application reloads on each request




пятница, 26 февраля 2010 г.
script/test_mojo
                                daemon --reload
                              Code of application reloads on each request




пятница, 26 февраля 2010 г.
Support USR1 signal
                            for reload app


пятница, 26 февраля 2010 г.
script/test_mojo
                    COMMAND [OPTIONS]
                              script/test_mojo cgi
                              script/test_mojo fastcgi
                              script/test_mojo daemon
                              script/test_mojo daemon_prefork




пятница, 26 февраля 2010 г.
script/test_mojo
                    COMMAND [OPTIONS]
                              script/test_mojo cgi
                              script/test_mojo fastcgi
                              script/test_mojo daemon
                              script/test_mojo daemon_prefork
                              script/test_mojo psgi



пятница, 26 февраля 2010 г.
script/test_mojo
                                generate psgi
                                  my_app.psgi




пятница, 26 февраля 2010 г.
use FindBin;

               use lib "$FindBin::Bin/lib";
               use lib "$FindBin::Bin/../lib";

               use Mojo::Server::PSGI;

               my $psgi = Mojo::Server::PSGI->new(
               	

 app_class => 'MyApp'
               );
               my $app = sub { $psgi->run(@_) };

пятница, 26 февраля 2010 г.
script/test_mojo
                    COMMAND [OPTIONS]
                              script/test_mojo cgi
                              script/test_mojo fastcgi
                              script/test_mojo daemon
                              script/test_mojo daemon_prefork
                              script/test_mojo psgi
                              script/test_mojo test


пятница, 26 февраля 2010 г.
script/test_mojo
                    COMMAND [OPTIONS]
                              script/test_mojo cgi
                              script/test_mojo fastcgi
                              script/test_mojo daemon
                              script/test_mojo daemon_prefork
                              script/test_mojo psgi
                              script/test_mojo test
                              script/test_mojo get

пятница, 26 февраля 2010 г.
script/test_mojo
                    COMMAND [OPTIONS]
                              script/test_mojo cgi
                              script/test_mojo fastcgi
                              script/test_mojo daemon
                              script/test_mojo daemon_prefork
                              script/test_mojo psgi
                              script/test_mojo test
                              script/test_mojo get http://goo.gl

пятница, 26 февраля 2010 г.
Web frameworks



пятница, 26 февраля 2010 г.
Mojo
                              Base framework




пятница, 26 февраля 2010 г.
package TestMojo;
               use base 'Mojo';

               sub handler {
                   my ($self, $tx) = @_;
               	

               	

 warn $tx->req; warn $tx->req->url;
               	

                   $tx->res->headers
                            ->content_type('text/plain');
                   $tx->res->body('Hello Mojo!');
               }
пятница, 26 февраля 2010 г.
MVC web frameworks



пятница, 26 февраля 2010 г.
Mojolicious
                                use base 'Mojo';




пятница, 26 февраля 2010 г.
• Mojolicous::Controller
                   • Mojolicious::Plugin
                   • Mojolicious::Commands
                   • MojoX::Types
                   • MojoX::Dispatcher, MojoX::Routes

пятница, 26 февраля 2010 г.
• Mojolicous::Controller
                   • Mojolicious::Plugin
                   • Mojolicious::Commands
                   • MojoX::Types
                   • MojoX::Dispatcher, MojoX::Routes

пятница, 26 февраля 2010 г.
Mojolicious::Controller
                              Controller Base Class




пятница, 26 февраля 2010 г.
• render
                   • render_text
                   • render_json
                   • render_inner
                   • render_partial
                   • pause / resume
                   • redirect_to / url_for
пятница, 26 февраля 2010 г.
• render
                   • render_text
                   • render_json
                   • render_inner
                   • render_partial
                   • pause / resume
                   • redirect_to / url_for
пятница, 26 февраля 2010 г.
• render(tempate => ‘foo/bar’)
                   • render_text
                   • render_json
                   • render_inner
                   • render_partial
                   • pause / resume
                   • redirect_to / url_for
пятница, 26 февраля 2010 г.
• render(controller => ‘foo’, action => ‘bar’)
                   • render_text
                   • render_json
                   • render_inner
                   • render_partial
                   • pause / resume
                   • redirect_to / url_for
пятница, 26 февраля 2010 г.
• render(‘foo#bar’, format => ‘html')
                   • render_text
                   • render_json
                   • render_inner
                   • render_partial
                   • pause / resume
                   • redirect_to / url_for
пятница, 26 февраля 2010 г.
• render
                   • render_text
                   • render_json
                   • render_inner
                   • render_partial
                   • pause / resume
                   • redirect_to / url_for
пятница, 26 февраля 2010 г.
• render
                   • render(text => ‘Perlburg 2010’)
                   • render_json
                   • render_inner
                   • render_partial
                   • pause / resume
                   • redirect_to / url_for
пятница, 26 февраля 2010 г.
• render
                   • render_text
                   • render_json
                   • render_inner
                   • render_partial
                   • pause / resume
                   • redirect_to / url_for
пятница, 26 февраля 2010 г.
• render
                   • render_text
                   • render(json => {foo => ‘bar’})
                   • render_inner
                   • render_partial
                   • pause / resume
                   • redirect_to / url_for
пятница, 26 февраля 2010 г.
• render
                   • render_text
                   • render_json
                   • render_inner
                   • render_partial
                   • pause / resume
                   • redirect_to / url_for
пятница, 26 февраля 2010 г.
• render
                   • render_text
                   • render_json
                   • render_inner
                   • render_partial
                   • pause / resume
                   • redirect_to / url_for
пятница, 26 февраля 2010 г.
• render
                   • render_text
                   • render_json
                   • render_inner
                   • render_partial
                   • pause / resume
                   • redirect_to / url_for
пятница, 26 февраля 2010 г.
• render
                   • render_text
                   • render_json
                   • render_inner
                   • render_partial
                   • pause / resume
                   • redirect_to / url_for
пятница, 26 февраля 2010 г.
• Mojolicous::Controller
                   • Mojolicious::Plugin
                   • Mojolicious::Commands
                   • MojoX::Types
                   • MojoX::Dispatcher, MojoX::Routes

пятница, 26 февраля 2010 г.
Mojolicious::Plugin
                                   Plugin Base Class




пятница, 26 февраля 2010 г.
Mojolicious::Plugins
                              Plugins: load_plugin, add_hook, run_hook




пятница, 26 февраля 2010 г.
• AgentCondition
                   • Charset
                   • DefaultHelpers
                   • EplRenderer
                   • EpRenderer
                   • HeaderCondition
                   • I18n, JsonConfig, PoweredBy
                   • PodRenderer, RequestTimer
пятница, 26 февраля 2010 г.
• AgentCondition
                   • Charset
                   • DefaultHelpers
                   • EplRenderer
                   • EpRenderer
                   • HeaderCondition
                   • I18n, JsonConfig, PoweredBy
                   • PodRenderer, RequestTimer
пятница, 26 февраля 2010 г.
• AgentCondition
                   • Charset
                   • DefaultHelpers
                   • EplRenderer
                   • EpRenderer
                   • HeaderCondition
                   • I18n, JsonConfig, PoweredBy
                   • PodRenderer, RequestTimer
пятница, 26 февраля 2010 г.
• AgentCondition
                   • Charset
                   • DefaultHelpers
                   • EplRenderer
                   • EpRenderer
                   • HeaderCondition
                   • I18n, JsonConfig, PoweredBy
                   • PodRenderer, RequestTimer
пятница, 26 февраля 2010 г.
• dumper
                   • param
                   • stash
                   • layout
                   • include
                   • content
                   • extends
                   • url_for
пятница, 26 февраля 2010 г.
• dumper
                   • param
                   • stash
                   • layout
                   • include
                   • content
                   • extends
                   • url_for
пятница, 26 февраля 2010 г.
• Data::Dumper (Maxdepth: 2, Indent: 1, Terse: 1)
                   • param
                   • stash
                   • layout
                   • include
                   • content
                   • extends
                   • url_for
пятница, 26 февраля 2010 г.
• dumper
                   • param
                   • stash
                   • layout
                   • include
                   • content
                   • extends
                   • url_for
пятница, 26 февраля 2010 г.
• dumper
                   • $self->req->param(...)
                   • stash
                   • layout
                   • include
                   • content
                   • extends
                   • url_for
пятница, 26 февраля 2010 г.
• dumper
                   • param
                   • stash
                   • layout
                   • include
                   • content
                   • extends
                   • url_for
пятница, 26 февраля 2010 г.
• dumper
                   • param
                   • $self->stash(...)
                   • layout
                   • include
                   • content
                   • extends
                   • url_for
пятница, 26 февраля 2010 г.
• dumper
                   • param
                   • stash
                   • layout
                   • include
                   • content
                   • extends
                   • url_for
пятница, 26 февраля 2010 г.
• dumper
                   • param
                   • stash
                   • $self->stash(layout => ...)
                   • include
                   • content
                   • extends
                   • url_for
пятница, 26 февраля 2010 г.
• dumper
                   • param
                   • stash
                   • layout
                   • include
                   • content
                   • extends
                   • url_for
пятница, 26 февраля 2010 г.
• dumper
                   • param
                   • stash
                   • layout
                   • $self->render_partial(...)
                   • content
                   • extends
                   • url_for
пятница, 26 февраля 2010 г.
• dumper
                   • param
                   • stash
                   • layout
                   • include
                   • content
                   • extends
                   • url_for
пятница, 26 февраля 2010 г.
• dumper
                   • param
                   • stash
                   • layout
                   • include
                   • $self->render_inner(...)
                   • extends
                   • url_for
пятница, 26 февраля 2010 г.
• dumper
                   • param
                   • stash
                   • layout
                   • include
                   • content
                   • extends
                   • url_for
пятница, 26 февраля 2010 г.
• dumper
                   • param
                   • stash
                   • layout
                   • include
                   • content
                   • $self->stash(extends => ...)
                   • url_for
пятница, 26 февраля 2010 г.
• dumper
                   • param
                   • stash
                   • layout
                   • include
                   • content
                   • extends
                   • url_for
пятница, 26 февраля 2010 г.
• dumper
                   • param
                   • stash
                   • layout
                   • include
                   • content
                   • extends
                   • $self->url_for(...)
пятница, 26 февраля 2010 г.
• AgentCondition
                   • Charset
                   • DefaultHelpers
                   • EplRenderer
                   • EpRenderer
                   • HeaderCondition
                   • I18n, JsonConfig, PoweredBy
                   • PodRenderer, RequestTimer
пятница, 26 февраля 2010 г.
• extension of temlplates is .epl
                   • my $self = shift;
                   • $self->stash(foo => ‘bar’)



пятница, 26 февраля 2010 г.
• AgentCondition
                   • Charset
                   • DefaultHelpers
                   • EplRenderer
                   • EpRenderer
                   • HeaderCondition
                   • I18n, JsonConfig, PoweredBy
                   • PodRenderer, RequestTimer
пятница, 26 февраля 2010 г.
• extension of temlplates is .ep
                   • caсhing templates with stash parameters
                   • $self->stash(foo => ‘bar’) – $foo
                   • any helpers
                   • default handler


пятница, 26 февраля 2010 г.
• AgentCondition
                   • Charset
                   • DefaultHelpers
                   • EplRenderer
                   • EpRenderer
                   • HeaderCondition
                   • I18n, JsonConfig, PoweredBy
                   • PodRenderer, RequestTimer
пятница, 26 февраля 2010 г.
• AgentCondition
                   • Charset
                   • DefaultHelpers
                   • EplRenderer
                   • EpRenderer
                   • HeaderCondition
                   • I18n, JsonConfig, PoweredBy
                   • PodRenderer, RequestTimer
пятница, 26 февраля 2010 г.
• AgentCondition
                   • Charset
                   • DefaultHelpers
                   • EplRenderer
                   • EpRenderer
                   • HeaderCondition
                   • I18n, JsonConfig, PoweredBy
                   • PodRenderer, RequestTimer
пятница, 26 февраля 2010 г.
• AgentCondition
                   • Charset
                   • DefaultHelpers
                   • EplRenderer
                   • EpRenderer
                   • HeaderCondition
                   • I18n, JsonConfig, PoweredBy
                   • PodRenderer, RequestTimer
пятница, 26 февраля 2010 г.
• AgentCondition
                   • Charset
                   • DefaultHelpers
                   • EplRenderer
                   • EpRenderer
                   • HeaderCondition
                   • I18n, JsonConfig, PoweredBy
                   • PodRenderer, RequestTimer
пятница, 26 февраля 2010 г.
• AgentCondition
                   • Charset
                   • DefaultHelpers
                   • EplRenderer
                   • EpRenderer
                   • HeaderCondition
                   • I18n, JsonConfig, PoweredBy
                   • PodRenderer, RequestTimer
пятница, 26 февраля 2010 г.
• Mojolicous::Controller
                   • Mojolicious::Plugin
                   • Mojolicious::Commands
                   • MojoX::Types
                   • MojoX::Dispatcher, MojoX::Routes

пятница, 26 февраля 2010 г.
script/test_app
                    COMMAND [OPTIONS]
                              script/test_app cgi
                              script/test_app fastcgi
                              script/test_app daemon
                              script/test_app daemon_prefork
                              script/test_app psgi
                              script/test_app test
                              script/test_app get
                              scritp/test_app routes
пятница, 26 февраля 2010 г.
script/test_app
                    COMMAND [OPTIONS]
                              script/test_app cgi
                              script/test_app fastcgi
                              script/test_app daemon
                              script/test_app daemon_prefork
                              script/test_app psgi
                              script/test_app test
                              script/test_app get
                              scritp/test_app routes
пятница, 26 февраля 2010 г.
• Mojolicous::Controller
                   • Mojolicious::Plugin
                   • Mojolicious::Commands
                   • MojoX::Types
                   • MojoX::Dispatcher, MojoX::Routes

пятница, 26 февраля 2010 г.
• Mojolicous::Controller
                   • Mojolicious::Plugin
                   • Mojolicious::Commands
                   • MojoX::Types
                   • MojoX::Dispatcher, MojoX::Routes

пятница, 26 февраля 2010 г.
A generation
                              the mojolicious app


пятница, 26 февраля 2010 г.
mojolicious generate
                           app TestApp


пятница, 26 февраля 2010 г.
[mkdir] test_app/script
                              [write] test_app/script/test_app
                              [chmod] test_app/script/test_app 744
                              [mkdir] test_app/lib
                              [write] test_app/lib/TestApp.pm
                              [mkdir] test_app/lib/TestApp
                              [write] test_app/lib/TestApp/Example.pm
                              [mkdir] test_app/t
                              [write] test_app/t/basic.t
                              [mkdir] test_app/log
                              [mkdir] test_app/public
                              [write] test_app/public/404.html
                              [exist] test_app/public
                              [write] test_app/public/500.html


пятница, 26 февраля 2010 г.
[mkdir] test_app/script
                              [write] test_app/script/test_app
                              [chmod] test_app/script/test_app 744
                              [mkdir] test_app/lib
                              [write] test_app/lib/TestApp.pm
                              [mkdir] test_app/lib/TestApp
                              [write] test_app/lib/TestApp/Example.pm
                              [mkdir] test_app/t
                              [write] test_app/t/basic.t
                              [mkdir] test_app/log
                              [mkdir] test_app/public
                              [write] test_app/public/404.html
                              [exist] test_app/public
                              [write] test_app/public/500.html


пятница, 26 февраля 2010 г.
[mkdir] test_app/script
                              [write] test_app/script/test_app
                              [chmod] test_app/script/test_app 744
                              [mkdir] test_app/lib
                              [write] test_app/lib/TestApp.pm
                              [mkdir] test_app/lib/TestApp
                              [write] test_app/lib/TestApp/Example.pm
                              [mkdir] test_app/t
                              [write] test_app/t/basic.t
                              [mkdir] test_app/log
                              [mkdir] test_app/public
                              [write] test_app/public/404.html
                              [exist] test_app/public
                              [write] test_app/public/500.html


пятница, 26 февраля 2010 г.
[mkdir] test_app/script
                              [write] test_app/script/test_app
                              [chmod] test_app/script/test_app 744
                              [mkdir] test_app/lib
                              [write] test_app/lib/TestApp.pm
                              [mkdir] test_app/lib/TestApp
                              [write] test_app/lib/TestApp/Example.pm
                              [mkdir] test_app/t
                              [write] test_app/t/basic.t
                              [mkdir] test_app/log
                              [mkdir] test_app/public
                              [write] test_app/public/404.html
                              [exist] test_app/public
                              [write] test_app/public/500.html


пятница, 26 февраля 2010 г.
package TestApp;

               use base 'Mojolicious';
               sub startup {
                 my $self = shift;

                        my $r = $self->routes;
                        $r->route('/:controller/:action/:id')
                         ->to('example#welcome', id => 1);
               }

               1;
пятница, 26 февраля 2010 г.
package TestApp;

               use base 'Mojolicious';
               sub startup {
                 my $self = shift;

                        my $r = $self->routes;
                        $r->route('/:controller/:action/:id')
                         ->to('example#welcome', id => 1);
               }

               1;
пятница, 26 февраля 2010 г.
package TestApp;

               use base 'Mojolicious';
               sub startup {
                 my $self = shift;

                        my $r = $self->routes;
                        $r->route('/:controller/:action/:id')
                         ->to('example#welcome', id => 1);
               }

               1;
пятница, 26 февраля 2010 г.
package TestApp;

               use base 'Mojolicious';
               sub startup {
                 my $self = shift;

                        my $r = $self->routes;
                        $r->route('/:controller/:action/:id')
                         ->to('example#welcome', id => 1);
               }

               1;
пятница, 26 февраля 2010 г.
package TestApp;

               use base 'Mojolicious';
               sub startup {
                 my $self = shift;

                        my $r = $self->routes;
                        $r->route('/:controller/:action/:id')
                         ->to('example#welcome', id => 1);
               }

               1;
пятница, 26 февраля 2010 г.
package TestApp;

               use base 'Mojolicious';
               sub startup {
                 my $self = shift;

                        my $r = $self->routes;
                        $r->route('/:controller/:action/:id')
                         ->to('example#welcome', id => 1);
               }

               1;
пятница, 26 февраля 2010 г.
package TestApp;

               use base 'Mojolicious';
               sub startup {
                 my $self = shift;

                   my $r = $self->routes;
                   $r->bridge->to('auth#check') # check auth
               	

  ->route(...)->to(...);
               }

               1;
пятница, 26 февраля 2010 г.
package TestApp::Example;

            use base 'Mojolicious::Controller';
            sub welcome {
                my $self = shift;
            	

 warn $self->stash(‘id’);
                $self->render(message => 'Perlicious!');
            }

            1;

пятница, 26 февраля 2010 г.
[exist]       test_app/public
                [write]       test_app/public/index.html
                [mkdir]       test_app/templates
                [write]       test_app/templates/exception.html.ep
                [write]       test_app/templates/not_found.html.ep
                [mkdir]       test_app/templates/layouts
                [write]       test_app/templates/layouts/default.html.ep
                [mkdir]       test_app/templates/example
                [write]       test_app/templates/example/welcome.html.ep




пятница, 26 февраля 2010 г.
[exist]       test_app/public
                [write]       test_app/public/index.html
                [mkdir]       test_app/templates
                [write]       test_app/templates/exception.html.ep
                [write]       test_app/templates/not_found.html.ep
                [mkdir]       test_app/templates/layouts
                [write]       test_app/templates/layouts/default.html.ep
                [mkdir]       test_app/templates/example
                [write]       test_app/templates/example/welcome.html.ep




пятница, 26 февраля 2010 г.
example/
                              welcome.html.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
controller/
                              welcome.html.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              action.html.ep
                                Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                     welcome.html.handler
                              Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.epl
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.tt
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.ht
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.pro
                                  Path to the template




пятница, 26 февраля 2010 г.
example/
                          welcome.html.ctpp2
                               Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.foo
                                  Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.format.ep
                                  Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.xml.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.rss.ep
                                Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.json.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.yaml.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.mail.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.bar.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
example/
                              welcome.html.ep
                                 Path to the template




пятница, 26 февраля 2010 г.
controller/
                       action.format.handler
                              Path to the template




пятница, 26 февраля 2010 г.
% layout 'default';

            <h2><%= $message %></h2>

            <a href="<%== url_for %>">click here</a>




пятница, 26 февраля 2010 г.
[exist]       test_app/public
                [write]       test_app/public/index.html
                [mkdir]       test_app/templates
                [write]       test_app/templates/exception.html.ep
                [write]       test_app/templates/not_found.html.ep
                [mkdir]       test_app/templates/layouts
                [write]       test_app/templates/layouts/default.html.ep
                [mkdir]       test_app/templates/example
                [write]       test_app/templates/example/welcome.html.ep




пятница, 26 февраля 2010 г.
<!doctype html>
            <html>
               <head><title>Welcome</title></head>
               <body>
                 <%== content %>
               </body>
            </html>




пятница, 26 февраля 2010 г.
[exist]       test_app/public
                [write]       test_app/public/index.html
                [mkdir]       test_app/templates
                [write]       test_app/templates/exception.html.ep
                [write]       test_app/templates/not_found.html.ep
                [mkdir]       test_app/templates/layouts
                [write]       test_app/templates/layouts/default.html.ep
                [mkdir]       test_app/templates/example
                [write]       test_app/templates/example/welcome.html.ep




пятница, 26 февраля 2010 г.
Global symbol "$message2" requires explicit package
                name at (eval 280) line 2.

                1: % layout 'default';
                2: <h2><%= $message2 %></h2>
                3: ...

                {
                    'status' => 500,
                    'message' => ‘Perlicious!’,
                    ...
                }


пятница, 26 февраля 2010 г.
$ENV{MOJO_MODE}
                              Default value is development




пятница, 26 февраля 2010 г.
[exist]       test_app/public
                [write]       test_app/public/index.html
                [mkdir]       test_app/templates
                [write]       test_app/templates/exception.html.ep
                [write]       test_app/templates/not_found.html.ep
                [mkdir]       test_app/templates/layouts
                [write]       test_app/templates/layouts/default.html.ep
                [mkdir]       test_app/templates/example
                [write]       test_app/templates/example/welcome.html.ep




пятница, 26 февраля 2010 г.
Mojolicious::Lite
                                 use base 'Mojolicious';




пятница, 26 февраля 2010 г.
mojolicious generate
                         lite_app test_lite


пятница, 26 февраля 2010 г.
[write] test_lite
                              [chmod] test_lite 744




пятница, 26 февраля 2010 г.
use Mojolicious::Lite;

               get '/' => 'index';

               any '/:groovy' => sub {
                  my $self = shift;
                  $self->render_text($self->stash('groovy'));
               };

               shagadelic;

пятница, 26 февраля 2010 г.
use Mojolicious::Lite;

               get '/' => 'index';

               any '/:groovy' => sub {
                  my $self = shift;
                  $self->render_text($self->stash('groovy'));
               };

               shagadelic;

пятница, 26 февраля 2010 г.
use Mojolicious::Lite;

               get '/' => 'index'; # /

               any '/:groovy' => sub {
                  my $self = shift;
                  $self->render_text($self->stash('groovy'));
               };

               shagadelic;

пятница, 26 февраля 2010 г.
use Mojolicious::Lite;

               post '/' => 'index';

               any '/:groovy' => sub {
                  my $self = shift;
                  $self->render_text($self->stash('groovy'));
               };

               shagadelic;

пятница, 26 февраля 2010 г.
use Mojolicious::Lite;

               any '/' => 'index';

               any '/:groovy' => sub {
                  my $self = shift;
                  $self->render_text($self->stash('groovy'));
               };

               shagadelic;

пятница, 26 февраля 2010 г.
use Mojolicious::Lite;

               get '/' => 'index';

               any '/:groovy' => sub { # /*
                  my $self = shift;
                  $self->render_text($self->stash('groovy'));
               };

               shagadelic;

пятница, 26 февраля 2010 г.
use Mojolicious::Lite;

               get '/' => 'index';

               any '/:groovy' => [groovy => qr/d+/] => sub {
                  my $self = shift;
                  $self->render_text($self->stash('groovy'));
               };

               shagadelic;

пятница, 26 февраля 2010 г.
use Mojolicious::Lite;

               get '/' => 'index';

               any '/:groovy' => {groovy => 42} => sub {
                  my $self = shift;
                  $self->render_text($self->stash('groovy'));
               };

               shagadelic;

пятница, 26 февраля 2010 г.
use Mojolicious::Lite;

               get '/' => 'index';

               any '/:groovy' => (agent=>qr/Firefox/) => sub {
                  my $self = shift;
                  $self->render_text($self->stash('groovy'));
               };

               shagadelic;

пятница, 26 февраля 2010 г.
use Mojolicious::Lite;

               get '/' => 'index';

               any '/:groovy' => sub {
                  my $self = shift;
                  $self->render_text($self->stash('groovy'));
               };
               app->renderer->default_handler(‘epl’);
               shagadelic;

пятница, 26 февраля 2010 г.
use Mojolicious::Lite;
               websocket '/echo' => sub { ... }; # websocket
               get '/' => 'index';

               any '/:groovy' => sub {
                  my $self = shift;
                  $self->render_text($self->stash('groovy'));
               };

               shagadelic;

пятница, 26 февраля 2010 г.
use Mojolicious::Lite;
               ladder sub { ... }; # auth
               get '/' => 'index';

               any '/:groovy' => sub {
                  my $self = shift;
                  $self->render_text($self->stash('groovy'));
               };

               shagadelic;

пятница, 26 февраля 2010 г.
use Mojolicious::Lite;

               get '/' => 'index';

               any '/:groovy' => sub {
                  my $self = shift;
                  $self->render_text($self->stash('groovy'));
               };

               shagadelic; # shagadelic(‘cgi’)

пятница, 26 февраля 2010 г.
__DATA__

               @@ index.html.ep
               % layout 'funky';
               Yea baby!

               @@ layouts/funky.html.ep
               <!doctype html><html>
                  <body>
                    <%== content %>
                  </body>
               </html>
пятница, 26 февраля 2010 г.
Mojolicious modules
                             on CPAN


пятница, 26 февраля 2010 г.
Mojolicious modules
                             on CPAN
                   •      Mojolicious               •   MojoX::Routes::AsGraph

                   •      Mojo::Server::FCGI
                                                    •   MojoX::Session::*
                   •      AnyEvent::Mojo
                                                    •   MojoX::Log::*
                   •      Apache::Mojo,
                          Apache2::Mojo
                                                    •   MojoX::Renderer::*

                   •      Catalyst::Engine::Mojo,
                                                        •   JSON
                          Squatting::On::Mojo
                                                        •   TT
                   •      MojoX::UserAgent
                                                        •   CTTP2, HTP


пятница, 26 февраля 2010 г.
Mojolicious Style Guide
                              Rules




пятница, 26 февраля 2010 г.
Mojolicious Style Guide
        • Keep it simple, no magic unless absolutely nessary
        • Code should be written with a Perl6 port in mind
        • It’s not a feature without a test
        • Only add prereqs if absolutely necessary
        • No inline POD
        • No spaghetti code
        • Every files should contain at least one quote from
               The Simpsons or Futurama

пятница, 26 февраля 2010 г.
Mojolicious Style Guide
        • Keep it simple, no magic unless absolutely nessary
        • Code should be written with a Perl6 port in mind
        • It’s not a feature without a test
        • Only add prereqs if absolutely necessary
        • No inline POD
        • No spaghetti code
        • Every files should contain at least one quote from
               The Simpsons or Futurama

пятница, 26 февраля 2010 г.
Mojolicious Style Guide
        • Keep it simple, no magic unless absolutely nessary
        • Code should be written with a Perl6 port in mind
        • It’s not a feature without a test
        • Only add prereqs if absolutely necessary
        • No inline POD
        • No spaghetti code
        • Every files should contain at least one quote from
               The Simpsons or Futurama

пятница, 26 февраля 2010 г.
Mojolicious Style Guide
        • Keep it simple, no magic unless absolutely nessary
        • Code should be written with a Perl6 port in mind
        • It’s not a feature without a test
        • Only add prereqs if absolutely necessary
        • No inline POD
        • No spaghetti code
        • Every files should contain at least one quote from
               The Simpsons or Futurama

пятница, 26 февраля 2010 г.
Mojolicious Style Guide
        • Keep it simple, no magic unless absolutely nessary
        • Code should be written with a Perl6 port in mind
        • It’s not a feature without a test
        • Only add prereqs if absolutely necessary
        • No inline POD
        • No spaghetti code
        • Every files should contain at least one quote from
               The Simpsons or Futurama

пятница, 26 февраля 2010 г.
Mojolicious Style Guide
        • Keep it simple, no magic unless absolutely nessary
        • Code should be written with a Perl6 port in mind
        • It’s not a feature without a test
        • Only add prereqs if absolutely necessary
        • No inline POD
        • No spaghetti code
        • Every files should contain at least one quote from
               The Simpsons or Futurama

пятница, 26 февраля 2010 г.
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!
Mojolicious. The web in a box!

Weitere ähnliche Inhalte

Andere mochten auch

Web Development in Perl
Web Development in PerlWeb Development in Perl
Web Development in PerlNaveen Gupta
 
Web Operations and Perl kansai.pm#14
Web Operations and Perl kansai.pm#14Web Operations and Perl kansai.pm#14
Web Operations and Perl kansai.pm#14Masahiro Nagano
 
Perl hosting for beginners - Cluj.pm March 2013
Perl hosting for beginners - Cluj.pm March 2013Perl hosting for beginners - Cluj.pm March 2013
Perl hosting for beginners - Cluj.pm March 2013Arpad Szasz
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with PerlDave Cross
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with PerlDave Cross
 
Introduction to Web Programming with Perl
Introduction to Web Programming with PerlIntroduction to Web Programming with Perl
Introduction to Web Programming with PerlDave Cross
 
Perl Dancer for Python programmers
Perl Dancer for Python programmersPerl Dancer for Python programmers
Perl Dancer for Python programmersxSawyer
 
Modern Perl Catch-Up
Modern Perl Catch-UpModern Perl Catch-Up
Modern Perl Catch-UpDave Cross
 
Simple Photo Processing and Web Display with Perl
Simple Photo Processing and Web Display with PerlSimple Photo Processing and Web Display with Perl
Simple Photo Processing and Web Display with PerlKent Cowgill
 
Plack basics for Perl websites - YAPC::EU 2011
Plack basics for Perl websites - YAPC::EU 2011Plack basics for Perl websites - YAPC::EU 2011
Plack basics for Perl websites - YAPC::EU 2011leo lapworth
 

Andere mochten auch (11)

Web Development in Perl
Web Development in PerlWeb Development in Perl
Web Development in Perl
 
Web Operations and Perl kansai.pm#14
Web Operations and Perl kansai.pm#14Web Operations and Perl kansai.pm#14
Web Operations and Perl kansai.pm#14
 
Perl hosting for beginners - Cluj.pm March 2013
Perl hosting for beginners - Cluj.pm March 2013Perl hosting for beginners - Cluj.pm March 2013
Perl hosting for beginners - Cluj.pm March 2013
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with Perl
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with Perl
 
Introduction to Web Programming with Perl
Introduction to Web Programming with PerlIntroduction to Web Programming with Perl
Introduction to Web Programming with Perl
 
Perl Dancer for Python programmers
Perl Dancer for Python programmersPerl Dancer for Python programmers
Perl Dancer for Python programmers
 
Modern Perl Catch-Up
Modern Perl Catch-UpModern Perl Catch-Up
Modern Perl Catch-Up
 
Simple Photo Processing and Web Display with Perl
Simple Photo Processing and Web Display with PerlSimple Photo Processing and Web Display with Perl
Simple Photo Processing and Web Display with Perl
 
Plack basics for Perl websites - YAPC::EU 2011
Plack basics for Perl websites - YAPC::EU 2011Plack basics for Perl websites - YAPC::EU 2011
Plack basics for Perl websites - YAPC::EU 2011
 
Perl Scripting
Perl ScriptingPerl Scripting
Perl Scripting
 

Mehr von Anatoly Sharifulin

Ещё один способ привлекать и удерживать пользователей в играх
Ещё один способ привлекать и удерживать пользователей в играхЕщё один способ привлекать и удерживать пользователей в играх
Ещё один способ привлекать и удерживать пользователей в играхAnatoly Sharifulin
 
ASO Аудит для приложений и игр
ASO Аудит для приложений и игрASO Аудит для приложений и игр
ASO Аудит для приложений и игрAnatoly Sharifulin
 
ASO для iOS 11 (продвижение In-App Prurchases)
ASO для iOS 11 (продвижение In-App Prurchases)ASO для iOS 11 (продвижение In-App Prurchases)
ASO для iOS 11 (продвижение In-App Prurchases)Anatoly Sharifulin
 
AppFollow митап в Москве
AppFollow митап в МосквеAppFollow митап в Москве
AppFollow митап в МосквеAnatoly Sharifulin
 
То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...
То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...
То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...Anatoly Sharifulin
 
Аналитика приложений конкурентов в Google Play
Аналитика приложений конкурентов в Google PlayАналитика приложений конкурентов в Google Play
Аналитика приложений конкурентов в Google PlayAnatoly Sharifulin
 
Конкурентный анализ мобильных приложений
Конкурентный анализ мобильных приложенийКонкурентный анализ мобильных приложений
Конкурентный анализ мобильных приложенийAnatoly Sharifulin
 
Аналитика приложений конкурентов
Аналитика приложений конкурентовАналитика приложений конкурентов
Аналитика приложений конкурентовAnatoly Sharifulin
 
Аналитика магазинов приложений
Аналитика магазинов приложенийАналитика магазинов приложений
Аналитика магазинов приложенийAnatoly Sharifulin
 
Аналитика мобильных приложений
Аналитика мобильных приложенийАналитика мобильных приложений
Аналитика мобильных приложенийAnatoly Sharifulin
 
Анализ приложений конкурентов
Анализ приложений конкурентовАнализ приложений конкурентов
Анализ приложений конкурентовAnatoly Sharifulin
 
ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»
ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»
ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»Anatoly Sharifulin
 
Продвижение мобильных приложений: с чего начать?
Продвижение мобильных приложений: с чего начать?Продвижение мобильных приложений: с чего начать?
Продвижение мобильных приложений: с чего начать?Anatoly Sharifulin
 
Основной продукт vs. мобильный на примере Ostrovok.ru
Основной продукт vs. мобильный на примере Ostrovok.ruОсновной продукт vs. мобильный на примере Ostrovok.ru
Основной продукт vs. мобильный на примере Ostrovok.ruAnatoly Sharifulin
 
ASO оптимизация и продвижение мобильных приложений
ASO  оптимизация и продвижение мобильных приложенийASO  оптимизация и продвижение мобильных приложений
ASO оптимизация и продвижение мобильных приложенийAnatoly Sharifulin
 

Mehr von Anatoly Sharifulin (20)

Ещё один способ привлекать и удерживать пользователей в играх
Ещё один способ привлекать и удерживать пользователей в играхЕщё один способ привлекать и удерживать пользователей в играх
Ещё один способ привлекать и удерживать пользователей в играх
 
ASO Аудит для приложений и игр
ASO Аудит для приложений и игрASO Аудит для приложений и игр
ASO Аудит для приложений и игр
 
ASO для iOS 11 (продвижение In-App Prurchases)
ASO для iOS 11 (продвижение In-App Prurchases)ASO для iOS 11 (продвижение In-App Prurchases)
ASO для iOS 11 (продвижение In-App Prurchases)
 
ASO для iOS 11
ASO для iOS 11ASO для iOS 11
ASO для iOS 11
 
AppFollow митап в Москве
AppFollow митап в МосквеAppFollow митап в Москве
AppFollow митап в Москве
 
ASO Best Practices 2016
ASO Best Practices 2016ASO Best Practices 2016
ASO Best Practices 2016
 
То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...
То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...
То, что русскому — ФРИИ, финну — Startup Sauna. Опыт прохождения акселерации ...
 
Аналитика приложений конкурентов в Google Play
Аналитика приложений конкурентов в Google PlayАналитика приложений конкурентов в Google Play
Аналитика приложений конкурентов в Google Play
 
ASO FAQ
ASO FAQASO FAQ
ASO FAQ
 
ASO: Best Practices 2015
ASO: Best Practices 2015ASO: Best Practices 2015
ASO: Best Practices 2015
 
AppFollow Demo Day ФРИИ
AppFollow Demo Day ФРИИAppFollow Demo Day ФРИИ
AppFollow Demo Day ФРИИ
 
Конкурентный анализ мобильных приложений
Конкурентный анализ мобильных приложенийКонкурентный анализ мобильных приложений
Конкурентный анализ мобильных приложений
 
Аналитика приложений конкурентов
Аналитика приложений конкурентовАналитика приложений конкурентов
Аналитика приложений конкурентов
 
Аналитика магазинов приложений
Аналитика магазинов приложенийАналитика магазинов приложений
Аналитика магазинов приложений
 
Аналитика мобильных приложений
Аналитика мобильных приложенийАналитика мобильных приложений
Аналитика мобильных приложений
 
Анализ приложений конкурентов
Анализ приложений конкурентовАнализ приложений конкурентов
Анализ приложений конкурентов
 
ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»
ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»
ASO оптимизация мобильных приложений: «Что такое хорошо и что такое плохо?»
 
Продвижение мобильных приложений: с чего начать?
Продвижение мобильных приложений: с чего начать?Продвижение мобильных приложений: с чего начать?
Продвижение мобильных приложений: с чего начать?
 
Основной продукт vs. мобильный на примере Ostrovok.ru
Основной продукт vs. мобильный на примере Ostrovok.ruОсновной продукт vs. мобильный на примере Ostrovok.ru
Основной продукт vs. мобильный на примере Ostrovok.ru
 
ASO оптимизация и продвижение мобильных приложений
ASO  оптимизация и продвижение мобильных приложенийASO  оптимизация и продвижение мобильных приложений
ASO оптимизация и продвижение мобильных приложений
 

Mojolicious. The web in a box!

  • 1. Mojolicious. The web in a box! Perlburg 2010 English version пятница, 26 февраля 2010 г.
  • 3. Sebastian Riedel автор Catalyst и Mojo http://labs.kraih.com/ пятница, 26 февраля 2010 г.
  • 5. Sebastian Riedel автор Catalyst и Mojo http://labs.kraih.com пятница, 26 февраля 2010 г.
  • 6. Sebastian Riedel creator of Catalyst and Mojolicious http://labs.kraih.com пятница, 26 февраля 2010 г.
  • 7. Catalyst + Mojo = ? пятница, 26 февраля 2010 г.
  • 8. What is Mojolicious? пятница, 26 февраля 2010 г.
  • 9. What is Mojolicious? • Pure Perl amazing web framework, without any hidden magiс • No requirements besides Perl 5.8.1 • Very clean and object oriented API • Full stack HTTP 1.1, WebSocket, IPv6, SSL • CGI, FastCGI, PSGI, Daemon and Prefork • There are 3 frameworks: Mojo, Mojolicious and Mojolicious::Lite пятница, 26 февраля 2010 г.
  • 10. «Fresh code, based upon years of experience developing Catalyst» пятница, 26 февраля 2010 г.
  • 12. Pure Perl web framework пятница, 26 февраля 2010 г.
  • 13. • Mojo::Base • Mojo::ByteStream • Mojo::Template, Mojo::JSON • Mojo::Loader, Mojo::Log, Mojo::Path • Mojo::URL, Mojo::Parameters, Mojo::Content • Mojo::Message::Request, Mojo::Message::Response, Mojo::Headers, Mojo::Cookie, Mojo::Date пятница, 26 февраля 2010 г.
  • 14. • Mojo::Base • Mojo::ByteStream • Mojo::Template, Mojo::JSON • Mojo::Loader, Mojo::Log, Mojo::Path • Mojo::URL, Mojo::Parameters, Mojo::Content • Mojo::Message::Request, Mojo::Message::Response, Mojo::Headers, Mojo::Cookie, Mojo::Date пятница, 26 февраля 2010 г.
  • 15. Mojo::Base Minimal Base Class For Mojo Projects пятница, 26 февраля 2010 г.
  • 16. package App; use base ‘Mojo::Base’; __PACKAGE__->attr(conf => sub { return do ‘conf/app.conf’; }); __PACKAGE__->attr(db => sub { my $self = shift; return Util->db($self->conf->{'db'}); }); sub dispatch { ... } пятница, 26 февраля 2010 г.
  • 17. package App; use base ‘Mojo::Base’; __PACKAGE__->attr(conf => sub { return do ‘conf/app.conf’; }); __PACKAGE__->attr(db => sub { my $self = shift; return Util->db($self->conf->{'db'}); }); sub dispatch { ... } пятница, 26 февраля 2010 г.
  • 18. package App; use base ‘Mojo::Base’; __PACKAGE__->attr(conf => sub { return do ‘conf/app.conf’; }); __PACKAGE__->attr(db => sub { my $self = shift; return Util->db($self->conf->{'db'}); }); sub dispatch { ... } пятница, 26 февраля 2010 г.
  • 19. • Mojo::Base • Mojo::ByteStream • Mojo::Template, Mojo::JSON • Mojo::Loader, Mojo::Log, Mojo::Path • Mojo::URL, Mojo::Parameters, Mojo::Content • Mojo::Message::Request, Mojo::Message::Response, Mojo::Headers, Mojo::Cookie, Mojo::Date пятница, 26 февраля 2010 г.
  • 20. Mojo::ByteStream ByteStream пятница, 26 февраля 2010 г.
  • 21. use Mojo::ByteStream; my $s = Mojo::ByteStream->new('foo_bar'); $s->camelize; $s->decamelize; $s->b64_encode; $s->b64_decode; $s->encode('utf8'); $s->decode('utf8'); $s->html_escape; $s->html_unescape; $s->qp_encode; $s->qp_decode; $s->quote; $stream->unquote; $s->url_escape; $s->url_unescape; $s->xml_escape; $s->punycode_encode; $s->punycode_decode пятница, 26 февраля 2010 г.
  • 22. use Mojo::ByteStream; my $s = Mojo::ByteStream->new('foo_bar'); $s->camelize; $s->decamelize; $s->b64_encode; $s->b64_decode; $s->encode('utf8'); $s->decode('utf8'); $s->html_escape; $s->html_unescape; $s->qp_encode; $s->qp_decode; $s->quote; $stream->unquote; $s->url_escape; $s->url_unescape; $s->xml_escape; $s->punycode_encode; $s->punycode_decode пятница, 26 февраля 2010 г.
  • 23. use Mojo::ByteStream; my $s = Mojo::ByteStream->new('foo_bar'); $s->camelize; $s->decamelize; $s->b64_encode; $s->b64_decode; $s->encode('utf8'); $s->decode('utf8'); $s->html_escape; $s->html_unescape; $s->qp_encode; $s->qp_decode; $s->quote; $stream->unquote; $s->url_escape; $s->url_unescape; $s->xml_escape; $s->punycode_encode; $s->punycode_decode пятница, 26 февраля 2010 г.
  • 24. use Mojo::ByteStream; my $s = Mojo::ByteStream->new('foo_bar'); $s->camelize; $s->decamelize; $s->b64_encode; $s->b64_decode; $s->encode('utf8'); $s->decode('utf8'); $s->html_escape; $s->html_unescape; $s->qp_encode; $s->qp_decode; $s->quote; $stream->unquote; $s->url_escape; $s->url_unescape; $s->xml_escape; $s->punycode_encode; $s->punycode_decode пятница, 26 февраля 2010 г.
  • 25. use Mojo::ByteStream; my $s = Mojo::ByteStream->new('foo_bar'); $s->camelize; $s->decamelize; $s->b64_encode; $s->b64_decode; $s->encode('utf8'); $s->decode('utf8'); $s->html_escape; $s->html_unescape; $s->qp_encode; $s->qp_decode; $s->quote; $stream->unquote; $s->url_escape; $s->url_unescape; $s->xml_escape; $s->punycode_encode; $s->punycode_decode пятница, 26 февраля 2010 г.
  • 26. use Mojo::ByteStream; my $s = Mojo::ByteStream->new('foo_bar'); $s->camelize; $s->decamelize; $s->b64_encode; $s->b64_decode; $s->encode('utf8'); $s->decode('utf8'); $s->html_escape; $s->html_unescape; $s->qp_encode; $s->qp_decode; $s->quote; $stream->unquote; $s->url_escape; $s->url_unescape; $s->xml_escape; $s->punycode_encode; $s->punycode_decode пятница, 26 февраля 2010 г.
  • 27. use Mojo::ByteStream; my $s = Mojo::ByteStream->new('foo_bar'); $s->camelize; $s->decamelize; $s->b64_encode; $s->b64_decode; $s->encode('utf8'); $s->decode('utf8'); $s->html_escape; $s->html_unescape; $s->qp_encode; $s->qp_decode; $s->quote; $stream->unquote; $s->url_escape; $s->url_unescape; $s->xml_escape; $s->punycode_encode; $s->punycode_decode пятница, 26 февраля 2010 г.
  • 28. use Mojo::ByteStream; my $s = Mojo::ByteStream->new('foo_bar'); $s->camelize; $s->decamelize; $s->b64_encode; $s->b64_decode; $s->encode('utf8'); $s->decode('utf8'); $s->html_escape; $s->html_unescape; $s->qp_encode; $s->qp_decode; $s->quote; $stream->unquote; $s->url_escape; $s->url_unescape; $s->xml_escape; $s->punycode_encode; $s->punycode_decode пятница, 26 февраля 2010 г.
  • 29. use Mojo::ByteStream; my $s = Mojo::ByteStream->new('foo_bar'); $s->camelize; $s->decamelize; $s->b64_encode; $s->b64_decode; $s->encode('utf8'); $s->decode('utf8'); $s->html_escape; $s->html_unescape; $s->qp_encode; $s->qp_decode; $s->quote; $stream->unquote; $s->url_escape; $s->url_unescape; $s->xml_escape; $s->punycode_encode; $s->punycode_decode пятница, 26 февраля 2010 г.
  • 30. use Mojo::ByteStream; my $s = Mojo::ByteStream->new('foo_bar'); $s->camelize; $s->decamelize; $s->b64_encode; $s->b64_decode; $s->encode('utf8'); $s->decode('utf8'); $s->html_escape; $s->html_unescape; $s->qp_encode; $s->qp_decode; $s->quote; $stream->unquote; $s->url_escape; $s->url_unescape; $s->xml_escape; $s->punycode_encode; $s->punycode_decode пятница, 26 февраля 2010 г.
  • 31. • Mojo::Base • Mojo::ByteStream • Mojo::Template, Mojo::JSON • Mojo::Loader, Mojo::Log, Mojo::Path • Mojo::URL, Mojo::Parameters, Mojo::Content • Mojo::Message::Request, Mojo::Message::Response, Mojo::Headers, Mojo::Cookie, Mojo::Date пятница, 26 февраля 2010 г.
  • 32. Mojo::Template Perlish Templates! пятница, 26 февраля 2010 г.
  • 33. % my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <%= $_->{title} %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 34. % my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <%= $_->{title} %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 35. % my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <%= $_->{title} %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 36. %= my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <%= $_->{title} %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 37. %== my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <%= $_->{title} %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 38. % my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <%= $_->{title} %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 39. % use Foo::Bar; <ul> % for (@$list) { <li> <%= $_->{title} %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 40. % my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <%= $_->{title} %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 41. % my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <%= $_->{title} %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 42. % my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <%= $_->{title} %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 43. % my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <%= $_->{title} %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 44. % my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <%== $_->{title} %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 45. % my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <% my $foo = $_->{id} + 100_500; %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 46. % my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <% my $foo = $_->{id} + 100_500; %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 47. % my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <%= $_->{title} %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 48. % my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <%= $_->{title} %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 49. % my $list = $self->stash(‘list’); <ul> % for (@$list) { <li> <%= $_->{title} %> </li> %} </ul> <p><%# comment %></p> пятница, 26 февраля 2010 г.
  • 50. Easy as PHP, but cool as Perl Mojo::Template пятница, 26 февраля 2010 г.
  • 51. • Mojo::Base • Mojo::ByteStream • Mojo::Template, Mojo::JSON • Mojo::Loader, Mojo::Log, Mojo::Path • Mojo::URL, Mojo::Parameters, Mojo::Content • Mojo::Message::Request, Mojo::Message::Response, Mojo::Headers, Mojo::Cookie, Mojo::Date пятница, 26 февраля 2010 г.
  • 52. Mojo::JSON Minimalistic JSON пятница, 26 февраля 2010 г.
  • 53. my $json = Mojo::JSON->new; my $string = $json->encode({foo => ‘bar’}); my $hash = $json->decode(‘{"foo":"bar"}’); пятница, 26 февраля 2010 г.
  • 54. my $json = Mojo::JSON->new; my $string = $json->encode({foo => ‘bar’}); my $hash = $json->decode(‘{"foo":"bar"}’); пятница, 26 февраля 2010 г.
  • 55. my $json = Mojo::JSON->new; my $string = $json->encode({foo => ‘bar’}); my $hash = $json->decode(‘{"foo":"bar"}’); пятница, 26 февраля 2010 г.
  • 56. • Mojo::Base • Mojo::ByteStream • Mojo::Template, Mojo::JSON • Mojo::Loader, Mojo::Log, Mojo::Path • Mojo::URL, Mojo::Parameters, Mojo::Content • Mojo::Message::Request, Mojo::Message::Response, Mojo::Headers, Mojo::Cookie, Mojo::Date пятница, 26 февраля 2010 г.
  • 57. Mojo::Loader Class loader: load, reload, search пятница, 26 февраля 2010 г.
  • 58. Mojo::Loader Class loader: load, reload, search пятница, 26 февраля 2010 г.
  • 59. • Mojo::Base • Mojo::ByteStream • Mojo::Template, Mojo::JSON • Mojo::Loader, Mojo::Log, Mojo::Path • Mojo::URL, Mojo::Parameters, Mojo::Content • Mojo::Message::Request, Mojo::Message::Response, Mojo::Headers, Mojo::Cookie, Mojo::Date пятница, 26 февраля 2010 г.
  • 60. • Mojo::Base • Mojo::ByteStream • Mojo::Template, Mojo::JSON • Mojo::Loader, Mojo::Log, Mojo::Path • Mojo::URL, Mojo::Parameters, Mojo::Content • Mojo::Message::Request, Mojo::Message::Response, Mojo::Headers, Mojo::Cookie, Mojo::Date пятница, 26 февраля 2010 г.
  • 61. • Mojo::Base • Mojo::ByteStream • Mojo::Template, Mojo::JSON • Mojo::Loader, Mojo::Log, Mojo::Path • Mojo::URL, Mojo::Parameters, Mojo::Content • Mojo::Message::Request, Mojo::Message::Response, Mojo::Headers, Mojo::Cookie, Mojo::Date пятница, 26 февраля 2010 г.
  • 62. • Mojo::Trasaction, Mojo::Stateful • Mojo::IOLoop • Mojo::Client, Mojo::Server • Mojo::Server::CGI, Mojo::Server::FastCGI • Mojo::Server::PSGI • Mojo::Server::Daemon and ::Prefork • Mojo::Command • Mojo::Command::Generate and ~ Server пятница, 26 февраля 2010 г.
  • 63. • Mojo::Trasaction, Mojo::Stateful • Mojo::IOLoop • Mojo::Client, Mojo::Server • Mojo::Server::CGI, Mojo::Server::FastCGI • Mojo::Server::PSGI • Mojo::Server::Daemon and ::Prefork • Mojo::Command • Mojo::Command::Generate and ~ Server пятница, 26 февраля 2010 г.
  • 64. • Mojo::Trasaction, Mojo::Stateful • Mojo::IOLoop • Mojo::Client, Mojo::Server • Mojo::Server::CGI, Mojo::Server::FastCGI • Mojo::Server::PSGI • Mojo::Server::Daemon and ::Prefork • Mojo::Command • Mojo::Command::Generate and ~ Server пятница, 26 февраля 2010 г.
  • 65. • Mojo::Trasaction, Mojo::Stateful • Mojo::IOLoop • Mojo::Client, Mojo::Server • Mojo::Server::CGI, Mojo::Server::FastCGI • Mojo::Server::PSGI • Mojo::Server::Daemon and ::Prefork • Mojo::Command • Mojo::Command::Generate and ~ Server пятница, 26 февраля 2010 г.
  • 66. my $client = Mojo::Client->new; $client->get( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; } )->process; пятница, 26 февраля 2010 г.
  • 67. my $client = Mojo::Client->new; $self->client->get( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; } )->process; пятница, 26 февраля 2010 г.
  • 68. my $client = Mojo::Client->new; $client->get( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; } )->process; пятница, 26 февраля 2010 г.
  • 69. my $client = Mojo::Client->new; $client->post( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; } )->process; пятница, 26 февраля 2010 г.
  • 70. my $client = Mojo::Client->new; $client->head( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; } )->process; пятница, 26 февраля 2010 г.
  • 71. my $client = Mojo::Client->new; $client->put( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; } )->process; пятница, 26 февраля 2010 г.
  • 72. my $client = Mojo::Client->new; $client->get( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; } )->process; пятница, 26 февраля 2010 г.
  • 73. my $client = Mojo::Client->new; $client->get( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; } )->process; пятница, 26 февраля 2010 г.
  • 74. my $client = Mojo::Client->new; $client->get( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; } )->process; пятница, 26 февраля 2010 г.
  • 75. my $client = Mojo::Client->new; $client->get( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; } )->process; пятница, 26 февраля 2010 г.
  • 76. my $client = Mojo::Client->new; $client->get( ‘http://goo.gl’ => sub { my ($self, $tx) = @_; say $tx->res; } )->process; пятница, 26 февраля 2010 г.
  • 77. • Mojo::Trasaction, Mojo::Stateful • Mojo::IOLoop • Mojo::Client, Mojo::Server • Mojo::Server::CGI, Mojo::Server::FastCGI • Mojo::Server::PSGI • Mojo::Server::Daemon and ::Prefork • Mojo::Command • Mojo::Command::Generate and ~ Server пятница, 26 февраля 2010 г.
  • 78. • Mojo::Trasaction, Mojo::Stateful • Mojo::IOLoop • Mojo::Client, Mojo::Server • Mojo::Server::CGI, Mojo::Server::FastCGI • Mojo::Server::PSGI • Mojo::Server::Daemon and ::Prefork • Mojo::Command • Mojo::Command::Generate and ~ Server пятница, 26 февраля 2010 г.
  • 79. • Mojo::Trasaction, Mojo::Stateful • Mojo::IOLoop • Mojo::Client, Mojo::Server • Mojo::Server::CGI, Mojo::Server::FastCGI • Mojo::Server::PSGI • Mojo::Server::Daemon and ::Prefork • Mojo::Command • Mojo::Command::Generate and ~ Server пятница, 26 февраля 2010 г.
  • 80. • Mojo::Trasaction, Mojo::Stateful • Mojo::IOLoop • Mojo::Client, Mojo::Server • Mojo::Server::CGI, Mojo::Server::FastCGI • Mojo::Server::PSGI • Mojo::Server::Daemon and ::Prefork • Mojo::Command • Mojo::Command::Generate and ~ Server пятница, 26 февраля 2010 г.
  • 81. • Mojo::Trasaction, Mojo::Stateful • Mojo::IOLoop • Mojo::Client, Mojo::Server • Mojo::Server::CGI, Mojo::Server::FastCGI • Mojo::Server::PSGI • Mojo::Server::Daemon and ::Prefork • Mojo::Command • Mojo::Command::Generate and ~ Server пятница, 26 февраля 2010 г.
  • 82. Mojolicious is the web in a box! пятница, 26 февраля 2010 г.
  • 83. No requirements besides Perl 5.8.1 пятница, 26 февраля 2010 г.
  • 84. Mojo runtime пятница, 26 февраля 2010 г.
  • 85. Perl 5.005 пятница, 26 февраля 2010 г.
  • 86. Perl 5.006002 пятница, 26 февраля 2010 г.
  • 87. Perl 5.008001 пятница, 26 февраля 2010 г.
  • 88. Mojo Perl 5.010 пятница, 26 февраля 2010 г.
  • 89. Object oriented API пятница, 26 февраля 2010 г.
  • 90. package TestMojo; use base 'Mojo'; sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type('text/plain'); $tx->res->body('Hello Mojo!'); } пятница, 26 февраля 2010 г.
  • 91. package TestMojo; use base 'Mojo'; sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type('text/plain'); $tx->res->body('Hello Mojo!'); } пятница, 26 февраля 2010 г.
  • 92. package TestMojo; use base 'Mojo'; sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type('text/plain'); $tx->res->body('Hello Mojo!'); } пятница, 26 февраля 2010 г.
  • 93. package TestMojo; use base 'Mojo'; sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type('text/plain'); $tx->res->body('Hello Mojo!'); } пятница, 26 февраля 2010 г.
  • 94. use overload '""' => sub { shift->to_string }, fallback => 1; пятница, 26 февраля 2010 г.
  • 95. GET / HTTP/1.1 Connection: keep-alive Accept: text/html, application/xhtml, .... Accept-Charset: windows-1251, utf-8; ... Accept-Encoding: gzip,deflate Accept-Language: ru,en-us;q=0.7,en;q=0.3 Host: localhost:3000 User-Agent: Mozilla/5.0 (Macintosh; ... Content-Length: 0 Keep-Alive: 300 пятница, 26 февраля 2010 г.
  • 96. GET / HTTP/1.1 Connection: keep-alive Accept: text/html, application/xhtml, .... Accept-Charset: windows-1251, utf-8; ... Accept-Encoding: gzip,deflate Accept-Language: ru,en-us;q=0.7,en;q=0.3 Host: localhost:3000 User-Agent: Mozilla/5.0 (Macintosh; ... Content-Length: 0 Keep-Alive: 300 пятница, 26 февраля 2010 г.
  • 97. package TestMojo; use base 'Mojo'; sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type('text/plain'); $tx->res->body('Hello Mojo!'); } пятница, 26 февраля 2010 г.
  • 98. package TestMojo; use base 'Mojo'; sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type('text/plain'); $tx->res->body('Hello Mojo!'); } пятница, 26 февраля 2010 г.
  • 99. A generation of the mojo app пятница, 26 февраля 2010 г.
  • 100. mojo generate app TestMojo [mkdir] test_mojo/script [write] test_mojo/script/test_mojo [chmod] test_mojo/script/test_mojo 744 [mkdir] test_mojo/lib [write] test_mojo/lib/TestMojo.pm [mkdir] test_mojo/t [write] test_mojo/t/basic.t пятница, 26 февраля 2010 г.
  • 101. mojo generate app TestMojo [mkdir] test_mojo/script [write] test_mojo/script/test_mojo [chmod] test_mojo/script/test_mojo 744 [mkdir] test_mojo/lib [write] test_mojo/lib/TestMojo.pm [mkdir] test_mojo/t [write] test_mojo/t/basic.t пятница, 26 февраля 2010 г.
  • 102. use FindBin; use lib "$FindBin::Bin/../lib"; use lib "$FindBin::Bin/../../lib"; # Application $ENV{MOJO_APP} ||= 'TestMojo'; use Mojo::Commands; Mojo::Commands->start; # ->start(‘cgi’) пятница, 26 февраля 2010 г.
  • 103. mojo generate app TestMojo [mkdir] test_mojo/script [write] test_mojo/script/test_mojo [chmod] test_mojo/script/test_mojo 744 [mkdir] test_mojo/lib [write] test_mojo/lib/TestMojo.pm [mkdir] test_mojo/t [write] test_mojo/t/basic.t пятница, 26 февраля 2010 г.
  • 104. package TestMojo; use base 'Mojo'; sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type('text/plain'); $tx->res->body('Hello Mojo!'); } пятница, 26 февраля 2010 г.
  • 105. mojo generate app TestMojo [mkdir] test_mojo/script [write] test_mojo/script/test_mojo [chmod] test_mojo/script/test_mojo 744 [mkdir] test_mojo/lib [write] test_mojo/lib/TestMojo.pm [mkdir] test_mojo/t [write] test_mojo/t/basic.t пятница, 26 февраля 2010 г.
  • 106. #!/usr/bin/env perl use strict; use warnings; use Test::More tests => 1; use_ok('TestMojo'); пятница, 26 февраля 2010 г.
  • 107. Full stack HTTP 1.1 пятница, 26 февраля 2010 г.
  • 109. MojoX::UserAgent Pascal Gaudette Thanks to the Google of Summer Code 2009! пятница, 26 февраля 2010 г.
  • 110. Support WebSocket пятница, 26 февраля 2010 г.
  • 111. WebSocket protocol Google, Inc December 16, 2009 пятница, 26 февраля 2010 г.
  • 112. use Mojolicious::Lite; websocket ‘/echo’ => sub { my $self = shift; $self->receive_message(sub { my ($self, $msg) = @_; $self->send_massage("echo: $msg"); }); }; shagadelic; пятница, 26 февраля 2010 г.
  • 113. use Mojolicious::Lite; websocket ‘/echo’ => sub { my $self = shift; $self->receive_message(sub { my ($self, $msg) = @_; $self->send_massage("echo: $msg"); }); }; shagadelic; пятница, 26 февраля 2010 г.
  • 114. CGI, FastCGI, PSGI, Daemon and Prefork пятница, 26 февраля 2010 г.
  • 115. script/test_mojo COMMAND [OPTIONS] script/test_mojo cgi script/test_mojo fastcgi script/test_mojo daemon script/test_mojo daemon_prefork пятница, 26 февраля 2010 г.
  • 116. script/test_mojo COMMAND [OPTIONS] script/test_mojo cgi script/test_mojo fastcgi script/test_mojo daemon script/test_mojo daemon_prefork пятница, 26 февраля 2010 г.
  • 117. PATH_INFO='/' script/ test_mojo cgi Easy testing Can profile the mojolicious app using Devel::NYTProf пятница, 26 февраля 2010 г.
  • 118. script/test_mojo COMMAND [OPTIONS] script/test_mojo cgi script/test_mojo fastcgi script/test_mojo daemon script/test_mojo daemon_prefork пятница, 26 февраля 2010 г.
  • 119. Mojo::Server::FCGI script/test_mojo fcgi script/test_mojo fcgi_prefork пятница, 26 февраля 2010 г.
  • 120. Mojo::Server::FCGI script/test_mojo fcgi script/test_mojo fcgi_prefork пятница, 26 февраля 2010 г.
  • 121. Mojo::Server::FCGI script/test_mojo fcgi script/test_mojo fcgi_prefork пятница, 26 февраля 2010 г.
  • 122. nginx + fcgi_prefork пятница, 26 февраля 2010 г.
  • 123. location / { fastcgi_pass 127.0.0.1:3000; fastcgi_param MOJO_APP App; fastcgi_param SCRIPT_NAME http://127.0.0.1:3000; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; } пятница, 26 февраля 2010 г.
  • 124. location / { fastcgi_pass 127.0.0.1:3000; fastcgi_param MOJO_APP App; fastcgi_param SCRIPT_NAME http://127.0.0.1:3000; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; } пятница, 26 февраля 2010 г.
  • 125. location / { fastcgi_pass 127.0.0.1:3000; fastcgi_param MOJO_APP App; fastcgi_param SCRIPT_NAME http://127.0.0.1:3000; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; } пятница, 26 февраля 2010 г.
  • 126. location / { fastcgi_pass 127.0.0.1:3000; fastcgi_param MOJO_APP App; fastcgi_param SCRIPT_NAME http://127.0.0.1:3000; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; } пятница, 26 февраля 2010 г.
  • 127. location / { fastcgi_pass 127.0.0.1:3000; fastcgi_param MOJO_APP App; fastcgi_param SCRIPT_NAME http://127.0.0.1:3000; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; } пятница, 26 февраля 2010 г.
  • 128. script/test_mojo COMMAND [OPTIONS] script/test_mojo cgi script/test_mojo fastcgi script/test_mojo daemon script/test_mojo daemon_prefork пятница, 26 февраля 2010 г.
  • 129. MOJO_RELOAD=1 script/test_mojo daemon Code of application reloads on each request пятница, 26 февраля 2010 г.
  • 130. script/test_mojo daemon --reload Code of application reloads on each request пятница, 26 февраля 2010 г.
  • 131. Support USR1 signal for reload app пятница, 26 февраля 2010 г.
  • 132. script/test_mojo COMMAND [OPTIONS] script/test_mojo cgi script/test_mojo fastcgi script/test_mojo daemon script/test_mojo daemon_prefork пятница, 26 февраля 2010 г.
  • 133. script/test_mojo COMMAND [OPTIONS] script/test_mojo cgi script/test_mojo fastcgi script/test_mojo daemon script/test_mojo daemon_prefork script/test_mojo psgi пятница, 26 февраля 2010 г.
  • 134. script/test_mojo generate psgi my_app.psgi пятница, 26 февраля 2010 г.
  • 135. use FindBin; use lib "$FindBin::Bin/lib"; use lib "$FindBin::Bin/../lib"; use Mojo::Server::PSGI; my $psgi = Mojo::Server::PSGI->new( app_class => 'MyApp' ); my $app = sub { $psgi->run(@_) }; пятница, 26 февраля 2010 г.
  • 136. script/test_mojo COMMAND [OPTIONS] script/test_mojo cgi script/test_mojo fastcgi script/test_mojo daemon script/test_mojo daemon_prefork script/test_mojo psgi script/test_mojo test пятница, 26 февраля 2010 г.
  • 137. script/test_mojo COMMAND [OPTIONS] script/test_mojo cgi script/test_mojo fastcgi script/test_mojo daemon script/test_mojo daemon_prefork script/test_mojo psgi script/test_mojo test script/test_mojo get пятница, 26 февраля 2010 г.
  • 138. script/test_mojo COMMAND [OPTIONS] script/test_mojo cgi script/test_mojo fastcgi script/test_mojo daemon script/test_mojo daemon_prefork script/test_mojo psgi script/test_mojo test script/test_mojo get http://goo.gl пятница, 26 февраля 2010 г.
  • 139. Web frameworks пятница, 26 февраля 2010 г.
  • 140. Mojo Base framework пятница, 26 февраля 2010 г.
  • 141. package TestMojo; use base 'Mojo'; sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type('text/plain'); $tx->res->body('Hello Mojo!'); } пятница, 26 февраля 2010 г.
  • 142. MVC web frameworks пятница, 26 февраля 2010 г.
  • 143. Mojolicious use base 'Mojo'; пятница, 26 февраля 2010 г.
  • 144. • Mojolicous::Controller • Mojolicious::Plugin • Mojolicious::Commands • MojoX::Types • MojoX::Dispatcher, MojoX::Routes пятница, 26 февраля 2010 г.
  • 145. • Mojolicous::Controller • Mojolicious::Plugin • Mojolicious::Commands • MojoX::Types • MojoX::Dispatcher, MojoX::Routes пятница, 26 февраля 2010 г.
  • 146. Mojolicious::Controller Controller Base Class пятница, 26 февраля 2010 г.
  • 147. • render • render_text • render_json • render_inner • render_partial • pause / resume • redirect_to / url_for пятница, 26 февраля 2010 г.
  • 148. • render • render_text • render_json • render_inner • render_partial • pause / resume • redirect_to / url_for пятница, 26 февраля 2010 г.
  • 149. • render(tempate => ‘foo/bar’) • render_text • render_json • render_inner • render_partial • pause / resume • redirect_to / url_for пятница, 26 февраля 2010 г.
  • 150. • render(controller => ‘foo’, action => ‘bar’) • render_text • render_json • render_inner • render_partial • pause / resume • redirect_to / url_for пятница, 26 февраля 2010 г.
  • 151. • render(‘foo#bar’, format => ‘html') • render_text • render_json • render_inner • render_partial • pause / resume • redirect_to / url_for пятница, 26 февраля 2010 г.
  • 152. • render • render_text • render_json • render_inner • render_partial • pause / resume • redirect_to / url_for пятница, 26 февраля 2010 г.
  • 153. • render • render(text => ‘Perlburg 2010’) • render_json • render_inner • render_partial • pause / resume • redirect_to / url_for пятница, 26 февраля 2010 г.
  • 154. • render • render_text • render_json • render_inner • render_partial • pause / resume • redirect_to / url_for пятница, 26 февраля 2010 г.
  • 155. • render • render_text • render(json => {foo => ‘bar’}) • render_inner • render_partial • pause / resume • redirect_to / url_for пятница, 26 февраля 2010 г.
  • 156. • render • render_text • render_json • render_inner • render_partial • pause / resume • redirect_to / url_for пятница, 26 февраля 2010 г.
  • 157. • render • render_text • render_json • render_inner • render_partial • pause / resume • redirect_to / url_for пятница, 26 февраля 2010 г.
  • 158. • render • render_text • render_json • render_inner • render_partial • pause / resume • redirect_to / url_for пятница, 26 февраля 2010 г.
  • 159. • render • render_text • render_json • render_inner • render_partial • pause / resume • redirect_to / url_for пятница, 26 февраля 2010 г.
  • 160. • Mojolicous::Controller • Mojolicious::Plugin • Mojolicious::Commands • MojoX::Types • MojoX::Dispatcher, MojoX::Routes пятница, 26 февраля 2010 г.
  • 161. Mojolicious::Plugin Plugin Base Class пятница, 26 февраля 2010 г.
  • 162. Mojolicious::Plugins Plugins: load_plugin, add_hook, run_hook пятница, 26 февраля 2010 г.
  • 163. • AgentCondition • Charset • DefaultHelpers • EplRenderer • EpRenderer • HeaderCondition • I18n, JsonConfig, PoweredBy • PodRenderer, RequestTimer пятница, 26 февраля 2010 г.
  • 164. • AgentCondition • Charset • DefaultHelpers • EplRenderer • EpRenderer • HeaderCondition • I18n, JsonConfig, PoweredBy • PodRenderer, RequestTimer пятница, 26 февраля 2010 г.
  • 165. • AgentCondition • Charset • DefaultHelpers • EplRenderer • EpRenderer • HeaderCondition • I18n, JsonConfig, PoweredBy • PodRenderer, RequestTimer пятница, 26 февраля 2010 г.
  • 166. • AgentCondition • Charset • DefaultHelpers • EplRenderer • EpRenderer • HeaderCondition • I18n, JsonConfig, PoweredBy • PodRenderer, RequestTimer пятница, 26 февраля 2010 г.
  • 167. • dumper • param • stash • layout • include • content • extends • url_for пятница, 26 февраля 2010 г.
  • 168. • dumper • param • stash • layout • include • content • extends • url_for пятница, 26 февраля 2010 г.
  • 169. • Data::Dumper (Maxdepth: 2, Indent: 1, Terse: 1) • param • stash • layout • include • content • extends • url_for пятница, 26 февраля 2010 г.
  • 170. • dumper • param • stash • layout • include • content • extends • url_for пятница, 26 февраля 2010 г.
  • 171. • dumper • $self->req->param(...) • stash • layout • include • content • extends • url_for пятница, 26 февраля 2010 г.
  • 172. • dumper • param • stash • layout • include • content • extends • url_for пятница, 26 февраля 2010 г.
  • 173. • dumper • param • $self->stash(...) • layout • include • content • extends • url_for пятница, 26 февраля 2010 г.
  • 174. • dumper • param • stash • layout • include • content • extends • url_for пятница, 26 февраля 2010 г.
  • 175. • dumper • param • stash • $self->stash(layout => ...) • include • content • extends • url_for пятница, 26 февраля 2010 г.
  • 176. • dumper • param • stash • layout • include • content • extends • url_for пятница, 26 февраля 2010 г.
  • 177. • dumper • param • stash • layout • $self->render_partial(...) • content • extends • url_for пятница, 26 февраля 2010 г.
  • 178. • dumper • param • stash • layout • include • content • extends • url_for пятница, 26 февраля 2010 г.
  • 179. • dumper • param • stash • layout • include • $self->render_inner(...) • extends • url_for пятница, 26 февраля 2010 г.
  • 180. • dumper • param • stash • layout • include • content • extends • url_for пятница, 26 февраля 2010 г.
  • 181. • dumper • param • stash • layout • include • content • $self->stash(extends => ...) • url_for пятница, 26 февраля 2010 г.
  • 182. • dumper • param • stash • layout • include • content • extends • url_for пятница, 26 февраля 2010 г.
  • 183. • dumper • param • stash • layout • include • content • extends • $self->url_for(...) пятница, 26 февраля 2010 г.
  • 184. • AgentCondition • Charset • DefaultHelpers • EplRenderer • EpRenderer • HeaderCondition • I18n, JsonConfig, PoweredBy • PodRenderer, RequestTimer пятница, 26 февраля 2010 г.
  • 185. • extension of temlplates is .epl • my $self = shift; • $self->stash(foo => ‘bar’) пятница, 26 февраля 2010 г.
  • 186. • AgentCondition • Charset • DefaultHelpers • EplRenderer • EpRenderer • HeaderCondition • I18n, JsonConfig, PoweredBy • PodRenderer, RequestTimer пятница, 26 февраля 2010 г.
  • 187. • extension of temlplates is .ep • caсhing templates with stash parameters • $self->stash(foo => ‘bar’) – $foo • any helpers • default handler пятница, 26 февраля 2010 г.
  • 188. • AgentCondition • Charset • DefaultHelpers • EplRenderer • EpRenderer • HeaderCondition • I18n, JsonConfig, PoweredBy • PodRenderer, RequestTimer пятница, 26 февраля 2010 г.
  • 189. • AgentCondition • Charset • DefaultHelpers • EplRenderer • EpRenderer • HeaderCondition • I18n, JsonConfig, PoweredBy • PodRenderer, RequestTimer пятница, 26 февраля 2010 г.
  • 190. • AgentCondition • Charset • DefaultHelpers • EplRenderer • EpRenderer • HeaderCondition • I18n, JsonConfig, PoweredBy • PodRenderer, RequestTimer пятница, 26 февраля 2010 г.
  • 191. • AgentCondition • Charset • DefaultHelpers • EplRenderer • EpRenderer • HeaderCondition • I18n, JsonConfig, PoweredBy • PodRenderer, RequestTimer пятница, 26 февраля 2010 г.
  • 192. • AgentCondition • Charset • DefaultHelpers • EplRenderer • EpRenderer • HeaderCondition • I18n, JsonConfig, PoweredBy • PodRenderer, RequestTimer пятница, 26 февраля 2010 г.
  • 193. • AgentCondition • Charset • DefaultHelpers • EplRenderer • EpRenderer • HeaderCondition • I18n, JsonConfig, PoweredBy • PodRenderer, RequestTimer пятница, 26 февраля 2010 г.
  • 194. • Mojolicous::Controller • Mojolicious::Plugin • Mojolicious::Commands • MojoX::Types • MojoX::Dispatcher, MojoX::Routes пятница, 26 февраля 2010 г.
  • 195. script/test_app COMMAND [OPTIONS] script/test_app cgi script/test_app fastcgi script/test_app daemon script/test_app daemon_prefork script/test_app psgi script/test_app test script/test_app get scritp/test_app routes пятница, 26 февраля 2010 г.
  • 196. script/test_app COMMAND [OPTIONS] script/test_app cgi script/test_app fastcgi script/test_app daemon script/test_app daemon_prefork script/test_app psgi script/test_app test script/test_app get scritp/test_app routes пятница, 26 февраля 2010 г.
  • 197. • Mojolicous::Controller • Mojolicious::Plugin • Mojolicious::Commands • MojoX::Types • MojoX::Dispatcher, MojoX::Routes пятница, 26 февраля 2010 г.
  • 198. • Mojolicous::Controller • Mojolicious::Plugin • Mojolicious::Commands • MojoX::Types • MojoX::Dispatcher, MojoX::Routes пятница, 26 февраля 2010 г.
  • 199. A generation the mojolicious app пятница, 26 февраля 2010 г.
  • 200. mojolicious generate app TestApp пятница, 26 февраля 2010 г.
  • 201. [mkdir] test_app/script [write] test_app/script/test_app [chmod] test_app/script/test_app 744 [mkdir] test_app/lib [write] test_app/lib/TestApp.pm [mkdir] test_app/lib/TestApp [write] test_app/lib/TestApp/Example.pm [mkdir] test_app/t [write] test_app/t/basic.t [mkdir] test_app/log [mkdir] test_app/public [write] test_app/public/404.html [exist] test_app/public [write] test_app/public/500.html пятница, 26 февраля 2010 г.
  • 202. [mkdir] test_app/script [write] test_app/script/test_app [chmod] test_app/script/test_app 744 [mkdir] test_app/lib [write] test_app/lib/TestApp.pm [mkdir] test_app/lib/TestApp [write] test_app/lib/TestApp/Example.pm [mkdir] test_app/t [write] test_app/t/basic.t [mkdir] test_app/log [mkdir] test_app/public [write] test_app/public/404.html [exist] test_app/public [write] test_app/public/500.html пятница, 26 февраля 2010 г.
  • 203. [mkdir] test_app/script [write] test_app/script/test_app [chmod] test_app/script/test_app 744 [mkdir] test_app/lib [write] test_app/lib/TestApp.pm [mkdir] test_app/lib/TestApp [write] test_app/lib/TestApp/Example.pm [mkdir] test_app/t [write] test_app/t/basic.t [mkdir] test_app/log [mkdir] test_app/public [write] test_app/public/404.html [exist] test_app/public [write] test_app/public/500.html пятница, 26 февраля 2010 г.
  • 204. [mkdir] test_app/script [write] test_app/script/test_app [chmod] test_app/script/test_app 744 [mkdir] test_app/lib [write] test_app/lib/TestApp.pm [mkdir] test_app/lib/TestApp [write] test_app/lib/TestApp/Example.pm [mkdir] test_app/t [write] test_app/t/basic.t [mkdir] test_app/log [mkdir] test_app/public [write] test_app/public/404.html [exist] test_app/public [write] test_app/public/500.html пятница, 26 февраля 2010 г.
  • 205. package TestApp; use base 'Mojolicious'; sub startup { my $self = shift; my $r = $self->routes; $r->route('/:controller/:action/:id') ->to('example#welcome', id => 1); } 1; пятница, 26 февраля 2010 г.
  • 206. package TestApp; use base 'Mojolicious'; sub startup { my $self = shift; my $r = $self->routes; $r->route('/:controller/:action/:id') ->to('example#welcome', id => 1); } 1; пятница, 26 февраля 2010 г.
  • 207. package TestApp; use base 'Mojolicious'; sub startup { my $self = shift; my $r = $self->routes; $r->route('/:controller/:action/:id') ->to('example#welcome', id => 1); } 1; пятница, 26 февраля 2010 г.
  • 208. package TestApp; use base 'Mojolicious'; sub startup { my $self = shift; my $r = $self->routes; $r->route('/:controller/:action/:id') ->to('example#welcome', id => 1); } 1; пятница, 26 февраля 2010 г.
  • 209. package TestApp; use base 'Mojolicious'; sub startup { my $self = shift; my $r = $self->routes; $r->route('/:controller/:action/:id') ->to('example#welcome', id => 1); } 1; пятница, 26 февраля 2010 г.
  • 210. package TestApp; use base 'Mojolicious'; sub startup { my $self = shift; my $r = $self->routes; $r->route('/:controller/:action/:id') ->to('example#welcome', id => 1); } 1; пятница, 26 февраля 2010 г.
  • 211. package TestApp; use base 'Mojolicious'; sub startup { my $self = shift; my $r = $self->routes; $r->bridge->to('auth#check') # check auth ->route(...)->to(...); } 1; пятница, 26 февраля 2010 г.
  • 212. package TestApp::Example; use base 'Mojolicious::Controller'; sub welcome { my $self = shift; warn $self->stash(‘id’); $self->render(message => 'Perlicious!'); } 1; пятница, 26 февраля 2010 г.
  • 213. [exist] test_app/public [write] test_app/public/index.html [mkdir] test_app/templates [write] test_app/templates/exception.html.ep [write] test_app/templates/not_found.html.ep [mkdir] test_app/templates/layouts [write] test_app/templates/layouts/default.html.ep [mkdir] test_app/templates/example [write] test_app/templates/example/welcome.html.ep пятница, 26 февраля 2010 г.
  • 214. [exist] test_app/public [write] test_app/public/index.html [mkdir] test_app/templates [write] test_app/templates/exception.html.ep [write] test_app/templates/not_found.html.ep [mkdir] test_app/templates/layouts [write] test_app/templates/layouts/default.html.ep [mkdir] test_app/templates/example [write] test_app/templates/example/welcome.html.ep пятница, 26 февраля 2010 г.
  • 215. example/ welcome.html.ep Path to the template пятница, 26 февраля 2010 г.
  • 216. example/ welcome.html.ep Path to the template пятница, 26 февраля 2010 г.
  • 217. controller/ welcome.html.ep Path to the template пятница, 26 февраля 2010 г.
  • 218. example/ welcome.html.ep Path to the template пятница, 26 февраля 2010 г.
  • 219. example/ welcome.html.ep Path to the template пятница, 26 февраля 2010 г.
  • 220. example/ action.html.ep Path to the template пятница, 26 февраля 2010 г.
  • 221. example/ welcome.html.ep Path to the template пятница, 26 февраля 2010 г.
  • 222. example/ welcome.html.ep Path to the template пятница, 26 февраля 2010 г.
  • 223. example/ welcome.html.handler Path to the template пятница, 26 февраля 2010 г.
  • 224. example/ welcome.html.ep Path to the template пятница, 26 февраля 2010 г.
  • 225. example/ welcome.html.epl Path to the template пятница, 26 февраля 2010 г.
  • 226. example/ welcome.html.tt Path to the template пятница, 26 февраля 2010 г.
  • 227. example/ welcome.html.ht Path to the template пятница, 26 февраля 2010 г.
  • 228. example/ welcome.html.pro Path to the template пятница, 26 февраля 2010 г.
  • 229. example/ welcome.html.ctpp2 Path to the template пятница, 26 февраля 2010 г.
  • 230. example/ welcome.html.foo Path to the template пятница, 26 февраля 2010 г.
  • 231. example/ welcome.html.ep Path to the template пятница, 26 февраля 2010 г.
  • 232. example/ welcome.html.ep Path to the template пятница, 26 февраля 2010 г.
  • 233. example/ welcome.format.ep Path to the template пятница, 26 февраля 2010 г.
  • 234. example/ welcome.html.ep Path to the template пятница, 26 февраля 2010 г.
  • 235. example/ welcome.xml.ep Path to the template пятница, 26 февраля 2010 г.
  • 236. example/ welcome.rss.ep Path to the template пятница, 26 февраля 2010 г.
  • 237. example/ welcome.json.ep Path to the template пятница, 26 февраля 2010 г.
  • 238. example/ welcome.yaml.ep Path to the template пятница, 26 февраля 2010 г.
  • 239. example/ welcome.mail.ep Path to the template пятница, 26 февраля 2010 г.
  • 240. example/ welcome.bar.ep Path to the template пятница, 26 февраля 2010 г.
  • 241. example/ welcome.html.ep Path to the template пятница, 26 февраля 2010 г.
  • 242. example/ welcome.html.ep Path to the template пятница, 26 февраля 2010 г.
  • 243. controller/ action.format.handler Path to the template пятница, 26 февраля 2010 г.
  • 244. % layout 'default'; <h2><%= $message %></h2> <a href="<%== url_for %>">click here</a> пятница, 26 февраля 2010 г.
  • 245. [exist] test_app/public [write] test_app/public/index.html [mkdir] test_app/templates [write] test_app/templates/exception.html.ep [write] test_app/templates/not_found.html.ep [mkdir] test_app/templates/layouts [write] test_app/templates/layouts/default.html.ep [mkdir] test_app/templates/example [write] test_app/templates/example/welcome.html.ep пятница, 26 февраля 2010 г.
  • 246. <!doctype html> <html> <head><title>Welcome</title></head> <body> <%== content %> </body> </html> пятница, 26 февраля 2010 г.
  • 247. [exist] test_app/public [write] test_app/public/index.html [mkdir] test_app/templates [write] test_app/templates/exception.html.ep [write] test_app/templates/not_found.html.ep [mkdir] test_app/templates/layouts [write] test_app/templates/layouts/default.html.ep [mkdir] test_app/templates/example [write] test_app/templates/example/welcome.html.ep пятница, 26 февраля 2010 г.
  • 248. Global symbol "$message2" requires explicit package name at (eval 280) line 2. 1: % layout 'default'; 2: <h2><%= $message2 %></h2> 3: ... { 'status' => 500, 'message' => ‘Perlicious!’, ... } пятница, 26 февраля 2010 г.
  • 249. $ENV{MOJO_MODE} Default value is development пятница, 26 февраля 2010 г.
  • 250. [exist] test_app/public [write] test_app/public/index.html [mkdir] test_app/templates [write] test_app/templates/exception.html.ep [write] test_app/templates/not_found.html.ep [mkdir] test_app/templates/layouts [write] test_app/templates/layouts/default.html.ep [mkdir] test_app/templates/example [write] test_app/templates/example/welcome.html.ep пятница, 26 февраля 2010 г.
  • 251. Mojolicious::Lite use base 'Mojolicious'; пятница, 26 февраля 2010 г.
  • 252. mojolicious generate lite_app test_lite пятница, 26 февраля 2010 г.
  • 253. [write] test_lite [chmod] test_lite 744 пятница, 26 февраля 2010 г.
  • 254. use Mojolicious::Lite; get '/' => 'index'; any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy')); }; shagadelic; пятница, 26 февраля 2010 г.
  • 255. use Mojolicious::Lite; get '/' => 'index'; any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy')); }; shagadelic; пятница, 26 февраля 2010 г.
  • 256. use Mojolicious::Lite; get '/' => 'index'; # / any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy')); }; shagadelic; пятница, 26 февраля 2010 г.
  • 257. use Mojolicious::Lite; post '/' => 'index'; any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy')); }; shagadelic; пятница, 26 февраля 2010 г.
  • 258. use Mojolicious::Lite; any '/' => 'index'; any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy')); }; shagadelic; пятница, 26 февраля 2010 г.
  • 259. use Mojolicious::Lite; get '/' => 'index'; any '/:groovy' => sub { # /* my $self = shift; $self->render_text($self->stash('groovy')); }; shagadelic; пятница, 26 февраля 2010 г.
  • 260. use Mojolicious::Lite; get '/' => 'index'; any '/:groovy' => [groovy => qr/d+/] => sub { my $self = shift; $self->render_text($self->stash('groovy')); }; shagadelic; пятница, 26 февраля 2010 г.
  • 261. use Mojolicious::Lite; get '/' => 'index'; any '/:groovy' => {groovy => 42} => sub { my $self = shift; $self->render_text($self->stash('groovy')); }; shagadelic; пятница, 26 февраля 2010 г.
  • 262. use Mojolicious::Lite; get '/' => 'index'; any '/:groovy' => (agent=>qr/Firefox/) => sub { my $self = shift; $self->render_text($self->stash('groovy')); }; shagadelic; пятница, 26 февраля 2010 г.
  • 263. use Mojolicious::Lite; get '/' => 'index'; any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy')); }; app->renderer->default_handler(‘epl’); shagadelic; пятница, 26 февраля 2010 г.
  • 264. use Mojolicious::Lite; websocket '/echo' => sub { ... }; # websocket get '/' => 'index'; any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy')); }; shagadelic; пятница, 26 февраля 2010 г.
  • 265. use Mojolicious::Lite; ladder sub { ... }; # auth get '/' => 'index'; any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy')); }; shagadelic; пятница, 26 февраля 2010 г.
  • 266. use Mojolicious::Lite; get '/' => 'index'; any '/:groovy' => sub { my $self = shift; $self->render_text($self->stash('groovy')); }; shagadelic; # shagadelic(‘cgi’) пятница, 26 февраля 2010 г.
  • 267. __DATA__ @@ index.html.ep % layout 'funky'; Yea baby! @@ layouts/funky.html.ep <!doctype html><html> <body> <%== content %> </body> </html> пятница, 26 февраля 2010 г.
  • 268. Mojolicious modules on CPAN пятница, 26 февраля 2010 г.
  • 269. Mojolicious modules on CPAN • Mojolicious • MojoX::Routes::AsGraph • Mojo::Server::FCGI • MojoX::Session::* • AnyEvent::Mojo • MojoX::Log::* • Apache::Mojo, Apache2::Mojo • MojoX::Renderer::* • Catalyst::Engine::Mojo, • JSON Squatting::On::Mojo • TT • MojoX::UserAgent • CTTP2, HTP пятница, 26 февраля 2010 г.
  • 270. Mojolicious Style Guide Rules пятница, 26 февраля 2010 г.
  • 271. Mojolicious Style Guide • Keep it simple, no magic unless absolutely nessary • Code should be written with a Perl6 port in mind • It’s not a feature without a test • Only add prereqs if absolutely necessary • No inline POD • No spaghetti code • Every files should contain at least one quote from The Simpsons or Futurama пятница, 26 февраля 2010 г.
  • 272. Mojolicious Style Guide • Keep it simple, no magic unless absolutely nessary • Code should be written with a Perl6 port in mind • It’s not a feature without a test • Only add prereqs if absolutely necessary • No inline POD • No spaghetti code • Every files should contain at least one quote from The Simpsons or Futurama пятница, 26 февраля 2010 г.
  • 273. Mojolicious Style Guide • Keep it simple, no magic unless absolutely nessary • Code should be written with a Perl6 port in mind • It’s not a feature without a test • Only add prereqs if absolutely necessary • No inline POD • No spaghetti code • Every files should contain at least one quote from The Simpsons or Futurama пятница, 26 февраля 2010 г.
  • 274. Mojolicious Style Guide • Keep it simple, no magic unless absolutely nessary • Code should be written with a Perl6 port in mind • It’s not a feature without a test • Only add prereqs if absolutely necessary • No inline POD • No spaghetti code • Every files should contain at least one quote from The Simpsons or Futurama пятница, 26 февраля 2010 г.
  • 275. Mojolicious Style Guide • Keep it simple, no magic unless absolutely nessary • Code should be written with a Perl6 port in mind • It’s not a feature without a test • Only add prereqs if absolutely necessary • No inline POD • No spaghetti code • Every files should contain at least one quote from The Simpsons or Futurama пятница, 26 февраля 2010 г.
  • 276. Mojolicious Style Guide • Keep it simple, no magic unless absolutely nessary • Code should be written with a Perl6 port in mind • It’s not a feature without a test • Only add prereqs if absolutely necessary • No inline POD • No spaghetti code • Every files should contain at least one quote from The Simpsons or Futurama пятница, 26 февраля 2010 г.