请教Catalyst运行原理的问题,多谢各位高手帮忙!
xiaoquqi
|
1#
xiaoquqi 发表于 2007-02-05 12:02
请教Catalyst运行原理的问题,多谢各位高手帮忙!
最近学习Catalyst遇到很多问题,想请教各位前辈。
最无法理解的还是Catalyst的运行过程,下面是我按照Cpan的catalyst的第二章的guild建立起来的Server,以下是调试方式运行的。 我以前做的perl程序基本上属于应用型的,没有做过网站,所以对这个程序的运行过程相当的不理解。 通过观察程序,发现myapp_server.pl程序在执行以后
[Copy to clipboard] [ - ]
CODE:
MyApp::(/home/nwr748/MyApp/script/../lib/MyApp.pm:39):
39: __PACKAGE__->setup; 如下面的标准输出所示,输出了大量的标准输出。但是当我看MyApp.pm的时候。 并没有相关标准输出print之类的语句,所以 我的问题一:没有搞懂这些标准输出到底是谁输出出来的? 问题二:Catalyst的占用的是3000端口,Catalyst是如何处理的? 问题三:是否有相关Catalyst原理方面的文档供参考? 谢谢各位了! 同时也希望在致力于研究Catalyst的朋友能和我联系 我的邮箱iaoquqi@21cn.com MSNiao_quqi@hotmail.com 谢谢! shell>perl -d script/myapp_server.pl Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main:script/myapp_server.pl:16): my $debug = 0; DB<1> n main:script/myapp_server.pl:17): my $fork = 0; DB<1> n main:script/myapp_server.pl:1: my $help = 0; DB<1> n main:script/myapp_server.pl:19): my $host = undef; DB<1> n main:script/myapp_server.pl:20): my $port = 3000; DB<1> n main:script/myapp_server.pl:21): my $keepalive = 0; DB<1> n main:script/myapp_server.pl:22): my $restart = 0; DB<1> n main:script/myapp_server.pl:23): my $restart_delay = 1; DB<1> n main:script/myapp_server.pl:24): my $restart_regex = '\.yml$|\.yaml$| \.pm$'; DB<1> n main:script/myapp_server.pl:25): my $restart_directory = undef; DB<1> n main::(script/myapp_server.pl:27): my @argv = @ARGV; DB<1> n main::(script/myapp_server.pl:29): GetOptions( main::(script/myapp_server.pl:30): 'debug|d' => \$debug, main::(script/myapp_server.pl:31): 'fork' => \$fork, main::(script/myapp_server.pl:32): 'help|?' => \$help, main::(script/myapp_server.pl:33): 'host=s' => \$host, main::(script/myapp_server.pl:34): 'port=s' => \$port, main::(script/myapp_server.pl:35): 'keepalive|k' => \$keepalive , main::(script/myapp_server.pl:36): 'restart|r' => \$restart, main::(script/myapp_server.pl:37): 'restartdelay|rd=s' => \$restart_d elay, main::(script/myapp_server.pl:3: 'restartregex|rr=s' => \$restart_r egex, main::(script/myapp_server.pl:39): 'restartdirectory=s' => \$restart_d irectory, main::(script/myapp_server.pl:40): ); DB<1> n main::(script/myapp_server.pl:42): pod2usage(1) if $help; DB<1> n main::(script/myapp_server.pl:44): if ( $restart ) { DB<1> n main::(script/myapp_server.pl:47): if ( $debug ) { DB<1> n main::(script/myapp_server.pl:53): require MyApp; DB<1> n MyApp::(/home/nwr748/MyApp/script/../lib/MyApp.pm:25): 25: our $VERSION = '0.01'; DB<1> n MyApp::(/home/nwr748/MyApp/script/../lib/MyApp.pm:36): 36: __PACKAGE__->config( name => 'MyApp' ); DB<1> n MyApp::(/home/nwr748/MyApp/script/../lib/MyApp.pm:39): 39: __PACKAGE__->setup; DB<1> n [debug] Debug messages enabled [debug] Loaded plugins: .----------------------------------------------------------------------------. | Catalyst:lugin::ConfigLoader 0.13 | | Catalyst:lugin::StackTrace 0.06 | | Catalyst:lugin::Static::Simple 0.15 | '----------------------------------------------------------------------------' [debug] Loaded dispatcher "Catalyst:ispatcher" [debug] Loaded engine "Catalyst::Engine::HTTP" [debug] Found home "/home/nwr748/MyApp" [debug] Loaded Config "/home/nwr748/MyApp/myapp.yml" [debug] Loaded components: .-----------------------------------------------------------------+----------. | Class | Type | +-----------------------------------------------------------------+----------+ | MyApp::Controller::Books | instance | | MyApp::Controller::Root | instance | | MyApp::Model::MyAppDB | instance | | MyApp::Model::MyAppDB::Author | class | | MyApp::Model::MyAppDB::Book | class | | MyApp::Model::MyAppDB::BookAuthor | class | | MyApp::View::TT | instance | '-----------------------------------------------------------------+----------' [debug] Loaded Private actions: .----------------------+--------------------------------------+--------------. | Private | Class | Method | +----------------------+--------------------------------------+--------------+ | /default | MyApp::Controller::Root | default | | /end | MyApp::Controller::Root | end | | /books/index | MyApp::Controller::Books | index | | /books/list | MyApp::Controller::Books | list | '----------------------+--------------------------------------+--------------' [debug] Loaded Path actions: .-------------------------------------+--------------------------------------. | Path | Private | +-------------------------------------+--------------------------------------+ | /books/list | /books/list | '-------------------------------------+--------------------------------------' [info] MyApp powered by Catalyst 5.7006 MyApp::(/home/nwr748/MyApp/script/../lib/MyApp.pm:69): 69: 1; DB<1> |