Apache :: ConfigParser.Apache :: ConfigParser´Â Apache ±¸¼º ÆÄÀÏÀ»·Îµå ÇÒ ¼öÀÖ´Â Perl ¸ðµâÀÔ´Ï´Ù. | |
Áö±Ý ´Ù¿î·Îµå |
Apache :: ConfigParser. ¼øÀ§ ¹× ¿ä¾à
±¤°í
- ƯÇã:
- Perl Artistic License
- °¡°Ý:
- FREE
- °Ô½ÃÀÚ À̸§:
- Blair Zajac
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~bzajac/Apache-ConfigParser-1.01/lib/Apache/ConfigParser.pm
Apache :: ConfigParser. ű×
Apache :: ConfigParser. ¼³¸í
Apache :: ConfigParser´Â Apache ±¸¼º ÆÄÀÏÀ»·Îµå ÇÒ ¼öÀÖ´Â Perl ¸ðµâÀÔ´Ï´Ù. Apache :: ConfigParser´Â Apache ±¸¼º ÆÄÀÏÀ»·Îµå ÇÒ ¼öÀÖ´Â Perl ¸ðµâÀÔ´Ï´Ù .Snopsis Apache :: ConfigParser »ç¿ë; # »õ ºó Æļ¸¦ ¸¸µì´Ï´Ù. MY $ C1 = Apache :: ConfigParser-> New; # Apache ±¸¼º ÆÄÀÏÀ»·ÎµåÇÕ´Ï´Ù. MY $ RC = $ C1-> PARSE_FILE ( '/ etc / httpd / conf / httpd.conf'); # ±¸¼º ÆÄÀÏÀ» ±¸¹® ºÐ¼® ÇÒ ¶§ ¿À·ù°¡ ÀÖÀ¸¸é $ RC #Àº falseÀÌ°í ¿À·ù ¹®ÀÚ¿À» »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. if ($ rc°¡ ¾Æ´Ô) {print $ c1-> errstr, "n"; } # ±¸¼º ÆÄÀÏÀ» ³ªÅ¸³»´Â Æ®¸®ÀÇ ·çÆ®¸¦ °¡Á®¿É´Ï´Ù. # ÀÌ°ÍÀº apache :: configParser :: Directive °´Ã¼ÀÔ´Ï´Ù. ³» $ root = $ c1-> root; # ¸ðµç Áö½Ã¹®À» ¸ðµÎ °¡Á® ¿Í¼ ÄÁÅؽºÆ® ½ÃÀÛ. ³» @directives = $ root-> µþ; # ù ¹ø° Áö½Ã¹®ÀÇ À̸§À» ¾òÀ¸½Ê½Ã¿À. MY $ D_NAME = $ DERICTIVE -> À̸§; #ÀÌ Áö½Ã¹®ÀºÀÌ ÆÄÀÏ¿¡ µîÀåÇÕ´Ï´Ù.ÀÌ ÆÄÀÏÀº Æ÷ÇԵǾî ÀÖ½À´Ï´Ù. MY $ D_FILENAME = $ DERITIVE -> ÆÄÀÏ À̸§; #ÀÌ ÁÙ ¹øÈ£¿¡¼ ½ÃÀ۵˴ϴÙ. MY $ D_LINE_NUMBER = $ Áöħ -> line_number; # ÄÁÅؽºÆ®¿¡ °ü°è¾øÀÌ ¸ðµç »ç¿ëÀÚ Á¤ÀÇ Ç׸ñÀ» ã½À´Ï´Ù. my @custom_logs = $ C1-> find_down_diractive_names ( 'customlog'); # ù ¹ø° customlog¸¦ ¾òÀ¸½Ê½Ã¿À. MY $ CUSTOM_LOG = $ CUSTUM_LOGS ; # ¹®ÀÚ¿ Çü½ÄÀÇ °ªÀ» °¡Á®¿É´Ï´Ù. $ custom_log_args = $ custom_log-> °ª; # ÀÌ¹Ì ºÐÇÒ µÈ ¹è¿ ¾ç½Ä¿¡¼ °ªÀ» °¡Á®¿É´Ï´Ù. my @custom_log_args = $ custom_log-> get_value_array; # µ¿ÀÏÇÑ ¹è¿À» °¡Á® ¿ÀÁö¸¸ ÂüÁ¶ÇϽʽÿÀ. MY $ CUSSORE_LOG_ARGS = $ CUSTUM_LOG-> VALUE_ARRAY_REF; # customlogÀÇ Ã¹ ¹ø° °ªÀº ·Î±×ÀÇ ÆÄÀÏ À̸§ÀÔ´Ï´Ù. MY $ CUSTUM_LOG_FILE = $ CUSTUM_LOG_ARGS -> ; # °æ·Î°¡ Àý´ë ÀÌ·ç¾îÁö±â Àü¿¡ ¿ø·¡ °ªÀ» ¾òÀ¸½Ê½Ã¿À. @custom_log_args = $ custom_log-> get_orig_value_array; $ customer_log_file = $ custom_log_args ; # httpd.conf ÆÄÀÏÀ»·ÎµåÇÏ°í # »õ VirtualHost Áö½Ã¹®À» Ãß°¡Çϴº¸´Ù ¿Ïº®ÇÑ ¿¹ÀÔ´Ï´Ù. # # apache :: configParser °´Ã¼´Â apache :: configParser-> root¸¦ »ç¿ëÇÏ¿© #¿¡ ÀÇÇØ ¾òÀ» ¼öÀÖ´Â # apache :: configParser :: Directive °´Ã¼¿¡ ´ëÇÑ ÂüÁ¶°¡ µé¾î ÀÖ½À´Ï´Ù. ·çÆ® ³ëµå´Â # apache :: configParser :: Directive isa tree :: dag_node (Áï, # apache :: configParser :: DirectiveÀÇ @isa°¡ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù). # ·çÆ® ³ëµå¸¦ °¡Á® ¿Í¼ »õ Áö½Ã¹®À» Ãß°¡ÇÏ·Á¸é ´ÙÀ½°ú °°ÀÌ ÀÛ¾÷ÀÌ µÉ ¼ö ÀÖ½À´Ï´Ù : my $ c = apache :: configParser-> new; ³» $ rc = $ c-> parse_file ( '/ etc / httpd.conf'); ³» $ root = $ c-> root; ³» $ new_virtual_host = $ root-> new_daught; $ new_virtual_host-> name ( 'VirtualHost'); $ new_virtual_host-> °ª ( '*'); # VirtualHost´Â ´Ù¸¥ # Apache :: ConfigParser :: Directive 's : My $ Server_Name = $ New_Virtual_Host-> New_Daughter; $ server_name-> name ( 'servername'); $ server_name-> °ª ( 'my.hostname.com'); Apache :: ConfigParser ¸ðµâÀº Apache ±¸¼º ÆÄÀÏÀ»·ÎµåÇÏ¿© ÇÁ·Î±×·¥ÀÌ ApacheÀÇ ±¸¼º Áö½Ã¹®°ú ÄÁÅؽºÆ®¸¦ °áÁ¤ÇÒ ¼ö ÀÖµµ·ÏÇÏ´Â µ¥ »ç¿ëµË´Ï´Ù. °á°ú °´Ã¼´Â Æ®¸® :: DAG_NODEÀÇ ÇÏÀ§ Ŭ·¡½º ÀÎ Apache :: ConfigParser :: Directive Ŭ·¡½º¸¦ »ç¿ëÇÏ´Â Æ®¸® ±â¹Ý ±¸Á¶Ã¼¸¦ Æ÷ÇÔÇϹǷΠƮ¸® ±â¹Ý °Ë»ö ¹× Tree Æ®¸® °Ë»ö ¹× ¼öÁ¤ ±â´ÉÀ» »ç¿ëÇÒ ¼öÀÖ´Â ¸ðµç ¸Þ¼Òµåµµ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. Æ®¸® ±¸Á¶´Â
Apache :: ConfigParser. °ü·Ã ¼ÒÇÁÆ®¿þ¾î
¸ðµâ :: ¼³Ä¡ :: ÅÛÇø´
¸ðµâ :: ¼³Ä¡ :: ÅÛÇø´ ¸ðµâ ¼Ò½º Äڵ带 ÅÛÇø´À¸·Î ó¸® ÇÒ ¼ö ÀÖ½À´Ï´Ù. ...
142
Perl :: Configure.
Perl :: Configure´Â PerlÀÇ Perl ¸ðµâÀÔ´Ï´Ù ./configure Áú¹®¿¡ ÀçÇö °¡´ÉÇÕ´Ï´Ù. ...
165