ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ iB^c@`sddlmZddlmZddlmZddlZddlZddlZddlmZddl m Z ddl m Z dd l mZdd lmZdd lmZdd lmZdd lmZddlmZmZmZmZmZde fdYZdS(i(tabsolute_import(tprint_function(tdivisionN(tmap(t iteritemsi(tClUserExtSelect(tClSelectExcept(t clcaptain(tutils(tunescape(tExternalProgramFailed(t PhpConfReadertPhpConfBaseExceptiontPhpConfReadErrortPhpConfLoadExceptiont!PhpConfNoSuchAlternativeExceptiontClUserOptSelectcB`s[eZdZdZdddZeeedZeedZ edZ ddZ dddZ d Z d Zd Zed ZeeZd dZeeZd edZeeZedZdZeeZdZdZeeZdZdZdZdZdZdZedZdZ RS(s+ Class for processing user options s/etc/cl.selector/php.conftphpcC`s{tj|||i|_t|_idd6dd6dd6dd6d d 6d d 6|_d t|jD|_dS(Ns t s"t"s't's>t>s<t(s (Rt__init__t _whitelisttsett_user_excludest_html_escape_tableRt_html_unescape_table(tselftitemtexclude_pid_list((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyR"s   c C`sei}|dkrH|jd|d|dt}|j|||}n|j|||||dS(s Inserts supplied options into current ones @param optset: string @param decoder: string @param ttoptsettdecodertexpect_separatorN(t_process_option_stringtTruet_remove_forbidden_optionstinsert_json_options( R!tusertversionR%R&tappendtquiettcreatetoptions((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pytinsert_options*s   cC`sd|j||j||}|j|\}}} |j|}|r\|j|n|}|j|} | r|j| } n|j| || } xstdt | D]\} | | } | j d}t |dkrqn|ddkr|dd| | ===s;<===cS`s |jS(N(tstrip(tx((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pytR$R3isno value(Rct startswithtlistRR>R8(R!RER1R"tkeytvalue((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyR7s *  cC`s |js|j|n|jS(s( Returns whitelist data (Rt_load_whitelist(R!R-((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyRXs c C`s|j}|j||d|kr:tj|nt}x(t|D]\}}|d||Rt WrongData(t option_itemR't option_namet option_value((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyt_handle_option_items RZcC`sOidd6dd6}y|||SWntk rJ|d|SXdS(sx Decodes option item @param data: string @param decoder: string @return: string cS`s|S(N((Rd((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyReR$RZcS`s tj|S(N(tbase64t b64decode(Rd((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyReR$RN(tKeyError(RIR&t dispatcher((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyt_decoders   cC`sXi}|rTxE|jdD]1}|j||}|j|j||qWn|S(s Wrapper around options parsing routines @param optset: string @param decoder: callback name @expect_separator: bool @return: dict t,(R>RR8R~(tclsR%R&R'R1R{((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyR(scC`s|j|}t|jjt|jsi}xNt|D]@\}}||kr|rmqIqtj|n|||g}x1t|D]#\}}|jd||fqW|S(sq Construct option item from key and value pair @param options: dict return: list s%s=%s(RR.(R1RHRR((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyR9 scC`s'dg}|j||jd|S(s` Adds identifying string before and after dataset @param contents: list s.;>=== Start of PHP Selector Custom Options ===s.;<=== End of PHP Selector Custom Options =====(textendR.(R!RERI((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyR:s   cC`sLg}x2|D]*}|j|||jddgq W|j||S(s Construct output @param contents: list @param extensions: list @param extensions_data: dict return: list R$(R(RERFRGRIR"((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyR;#s   c C`s |j}|j||d|kr:tj|nttd||djd}t|jddkr|d7}ntj d}|j |}|stj |n|j d}ttd|j djd}|d d >|dd >B|dB}|d d >|dd >B|dB} |d krZ|| krZt S|d krv|| krvt S|dkr|| krt S|dkr|| krt S| s|dkr|d d >|dd >B}|d d >|dd >B} || krt SntS(s~ Compares version in use and version required by PHP feature and return true if PHP feature satisfies RkcS`s t|S(N(tint(Rd((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyRe>R$R-is.0s([<>=]{1,2})?(\d+\.\d+\.\d+)\.?icS`s t|S(N(R(Rd((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyReGR$ii iRs<=Rs>=R3(R\RlRRURgRR>R=tretcompiletmatchtNoSuchAlternativeVersiontgroupR)RM( R!ttestR-Ratv_arraytpatttmtactiont version_intttest_int((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyt_check_version5s:  ) *"" cC`s"i dd6dd6dd6dd6d d 6d d 6d d6dd6dd6dd6dd6dd6}|jd|ryd|d=5.2.0tE_RECOVERABLE_ERRORis<5.3.0is>=5.3.0t E_DEPRECATEDi tE_USER_DEPRECATEDi@s<5.4.0iws>=5.4.0i(R(R!tphp_vertphp_error_table((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyt_get_php_error_tblYs6      cC`sd}|j|}x2t|D]$\}}|j|t|}q"Wt|jt|ridSytt|}Wnt t t fk rdSX|S(sd Convert php error level 'error-reporting' from string to code http://php.net/manual/ru/function.error-reporting.php #>>> ClUserOptSelect(item='php')._php_string2error('E_ALL & ~E_NOTICE', '5.4') 32759 #>>> ClUserOptSelect(item='php')._php_string2error('E_USER_ERROR | E_NOTICE', '5.4') 264 #>>> ClUserOptSelect(item='php')._php_string2error('E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR', '5.4') 71 #>>> ClUserOptSelect(item='php')._php_string2error('E_ERROR | INCORRECT', '5.4') # incorrect variable 'INCORRECT' None #>>> ClUserOptSelect(item='php')._php_string2error('E_ERROR + E_WARNING', '5.4') # incorrect operator '+' None :param str: error_reporting variable :return None|int: error_reporting error code; return None if can't convert s0123456789|&~!^ N( RRtreplacetstrRt differenceRPRtevalt SyntaxErrort ValueErrort TypeError(R!tstr_Rt VALID_SYMBOLSRtcodetnamet error_code((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyt_php_string2errorxscC`stjd|sdSg}t|}x-|D]%}|j|d||kr/|Sq/W|jd|}x2|D]*}||@|krq|j||qqqqWdj|S(Ns ^-?\d{1,5}$R$Rs | (RRRRRR.R@(R!RiR-trange_tdesct error_stringRterror((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyt_get_error_descs   cC`sb|j}|j|||j|}tjj||d|js^tj|ntj }d|krd}tjj |r||d]*?>]*>(.*?)]*>(.*?)(?:]*>(.*?))?s<[^>]*?>s-dsopcache.enable_cli=0sauto_append_file=nonesauto_prepend_file=noneiR$iisno valuetdefaultterror_reportingR<RN(R\RlRXtostpathtisfilet_itemRRtenvirontexistsRORPRRRt run_commandtfindalltsubR R R>RRR8(R!R-RaRtenv_datat script_pathtcmdt tag_patternt strip_patterntoutputtlinestlt directivetsRit error_range((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyRVsL !        #  cC`s|j||j||}|j|\}}}|j|}x>|D]6}y|||j|dR?( R!R,R-RIR0tuser_backup_pathRxtuser_backup_fileRJRKRL((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyRCs    "c C`s|j||j}x|jD]y}|j||}|j|\}}}|j|}|j|}|r&|j|}|j|||q&q&WdS(sW rewrite php backup file with php options @param user: string N( R4R\RNR5R6R7R9R:RC( R!R,RaR-RDRERFRGRH((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pytbackup_php_optionss  N(!t__name__t __module__t__doc__RnRPRRMR)R2R+RRRYRbR7RXRjR~t staticmethodRR(t classmethodR*R9R:R;RRRRRVRWRCR(((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyRs> $              $  !  1  (t __future__RRRRRRtbuiltinsRt future.utilsRtcluserextselectRtclselectexceptRtclcommonRR$Rtxml.sax.saxutilsR tclcommon.utilsR tclcommon.php_conf_readerR R R RRR(((sI/opt/alt/python27/lib/python2.7/site-packages/clselect/cluseroptselect.pyts   (