PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  H4hc@s,ddlZddlZddlZddlZddlZddlZyddlZWnek rwddlZnXyddl Z WndddYZ nXdZ dZ dZ dZ dZd Zd Zd Zd Zd ZdZedkr(ejeejdndS(iNtrpmcBseZedZRS(cCs)d}d}|djd}|djd}t|}t||krbt|}nd}x||kr$|||r|||r||||krd}qt||t||SnF|||r||| rdS|||r||| rdS|d7}qkWdS(NcSsAd|kot|knp@t| |ko>dkSS(Ni(tlen(t_listti((s//opt/alt/alt-php-config/multiphp_reconfigure.pyt index_existssiit.i(tsplitRtint(tversion1tversion2Rtrestver1tver2tmax_numR((s//opt/alt/alt-php-config/multiphp_reconfigure.pyt labelCompares&   (t__name__t __module__t staticmethodR(((s//opt/alt/alt-php-config/multiphp_reconfigure.pyRss 11.66.0.11s/etc/scl/prefixess#/opt/alt/alt-php-config/alt-php.cfgcCs|rtj}n tj}tj}|j|d}tj|d}|j|tj}|j||j||S(s Logging configuration function. @type verbose: bool @param verbose: Enable additional debug output if True, display only errors otherwise. s%(levelname)-8s: %(message)ss%H:%M:%S %d.%m.%y( tloggingtDEBUGtERRORt StreamHandlertsetLevelt Formattert setFormattert getLoggert addHandler(tverbosetlevelthandlert log_formatt formattertlogger((s//opt/alt/alt-php-config/multiphp_reconfigure.pytconfigure_logging3s        cCsAtjjdr=tdd}|j}|SWdQXndS(s Returns cPanel version if cPanel installed or None othervise. @rtype: str or None @return: String with cPanel version or None if cPanel not installed. s/usr/local/cpanel/versiontrN(tostpathtexiststopentreadtNone(tfdtversion((s//opt/alt/alt-php-config/multiphp_reconfigure.pytget_cpanel_versionJs   cCsog}d}xRtj|D]A}tjjtjj|dr|j|d|fqqW|j|S(s Returns list of installed alt-php versions and their base directories. @rtype: list @return: List of version (e.g. 44, 55) and base directory tuples. s/opt/alt/php[0-9][0-9]s usr/bin/phpi(tglobR#R$R%tjointappendtsort(t int_versionstbase_path_regextint_dir((s//opt/alt/alt-php-config/multiphp_reconfigure.pytfind_interpreter_versionsXs! cCs\y*tjj|r%tj|ntSWn+tk rW}tjd||ftSXdS(s Remove prefix file @type prefix_path: str @param prefix_path: Path to the prefix file, e.g. /etc/scl/prefix/alt-php70 @rtype: bool @return: True if file was removed sucessfully, False otherwise uCouldn't remove prefix %s: %sN( R#R$R%tunlinktTruetOSErrorRterrortFalse(t prefix_pathte((s//opt/alt/alt-php-config/multiphp_reconfigure.pyt delete_prefixhs cCs[y)t|d}|j|WdQXWn+tk rV}tjd||ftSXtS(sE Creates prefix with path to alt-php @type prefix_path: str @param prefix_path: Path to the prefix file, e.g. /etc/scl/prefix/alt-php70 @type prefix_content: str @param prefix_content: SCL path, e.g. /opt/cloudlinux @rtype: bool @return: True if file was created sucessfully, False otherwise twNuCouldn't open file %s: %s(R&twritetIOErrorRR7R8R5(R9tprefix_contentR)R:((s//opt/alt/alt-php-config/multiphp_reconfigure.pyt create_prefixzs c Cst}d|}tjjt|}d}d|}|rwtjd|dfdtdfdkrwt|}nCy|j d|}Wnt j k r} t }t jd|tf|jd|d ttd } |j| Wd QXnjt jk rc} t }|jd|jd|d ttd } |j| Wd QXd tGHnX|rtjj|rt||}n,| rtjj|rt|}nt S|S( sB @type config: @param config: @type int_version: str @param int_version: Interpreter version (44, 55, 72, etc.) @type int_path: str @param int_path: Interpreter directory on the disk (/opt/alt/php51, etc.) @rtype: bool @return: True if reconfiguration was successful, False otherwise s alt-php%ss/opt/cloudlinux s /opt/cloudlinux/alt-php%s/enablet1t0isMultiPHP ManagersPrefix %s doesn't exist in %s: tyesR<Ns!Config %s is broken: Created it. (R+R#R$R-tSCL_PREFIX_PATHRRtMIN_CPANEL_VERSIONR;t getbooleant configparsert NoOptionErrorR5Rtwarningt CONFIG_PATHtsetR&R=tNoSectionErrort add_sectionR%R@( tconfigt int_versiont cp_versiont prefix_nameR9R?talt_php_enable_filetstatust int_enabledR:t configfile((s//opt/alt/alt-php-config/multiphp_reconfigure.pyt reconfigures<    $    cCs6tjj|s2tjjdj||tStS(s Check if alt-php path exist ---------- @type int_path: str or unicode @param int_path: Interpreter directory on the disk (/opt/alt/php51, etc.) @type int_name: str or unicode @param int_name: Interpreter name (php, python) @type int_ver: str or unicode @apram int_ver: Interpreter version (44, 55, 72, etc.) @rtype: bool @return: True if interpreter path exists, False otherwise sunknown {0} version {1}( R#R$tisdirtsyststderrR=tformatR8R5(tint_pathtint_nametint_ver((s//opt/alt/alt-php-config/multiphp_reconfigure.pytcheck_alt_path_existsscCsy%tj|dddg\}}Wn0tjk rW}tjjdj|dSXt}g}d}xt|D]l\}}|dkrd}d |} t| ||r|j|| fqdSn|dkrqt }qqqqWt |} t j } | j ty>|st}nx!|D]\} } t| | q"Wd SWn4tk rz}| jd ||tjfdSXdS(Nsp:vsphp=Rs(cannot parse command line arguments: {0}itphps-ps--phps/opt/alt/php%ss-vs --verboseiu4cannot reconfigure alt-%s for SCL: %s. Traceback: %s(s-ps--php(s-vs --verbose(tgetoptt GetoptErrorRXRYR=RZR8R^R.R5R!RGt ConfigParserR'RJR3RVt ExceptionR7t tracebackt format_exc(tsys_argstoptstargsR:RR0R\topttargR[tlogRNR]R2((s//opt/alt/alt-php-config/multiphp_reconfigure.pytmains>%         t__main__i((R`R,RR#RXRdRGt ImportErrorRbRRERDRJR!R+R3R;R@RVR^RlRtexittargv(((s//opt/alt/alt-php-config/multiphp_reconfigure.pyts4             3  $