/opt/alt/alt-php-config
NameSizeModeActions
__pycache__/-0755rm
alt-php-panel-configuration.py77260755editdlrm
alt-php-panel-configuration.pyc74810644editdlrm
alt-php-panel-configuration.pyo74810644editdlrm
alt-php.cfg2760755editdlrm
detectcp.py6900755editdlrm
detectcp.pyc7510644editdlrm
detectcp.pyo7510644editdlrm
install_odbc5260755editdlrm
multiphp_reconfigure.py78830755editdlrm
multiphp_reconfigure.pyc83500644editdlrm
multiphp_reconfigure.pyo83500644editdlrm
Edit: /opt/alt/alt-php-config/multiphp_reconfigure.pyo (8350B)
Ñò ˆz]hc@s0ddkZddkZddkZddkZddkZddkZyddkZWnej oddkZnXyddk Z Wnddd„ƒYZ nXdZ dZ dZ d„Z d„Zd „Zd „Zd „Zd „Zd „Zd„ZedjoeieeidƒƒndS(iÿÿÿÿNtrpmcBseZed„ƒZRS(cCs8d„}d}|didƒ}|didƒ}t|ƒ}t|ƒ|jot|ƒ}nd}xÇ||jo¹|||ƒoO|||ƒo?||||jo d}q%t||ƒt||ƒSnM|||ƒo|||ƒ odS|||ƒo|||ƒ odS|d7}qmWdS(NcSsDd|jot|ƒjnp t|ƒ |jodjSS(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…|o ti}n ti}tiƒ}|i|ƒd}ti|dƒ}|i|ƒtiƒ}|i|ƒ|i|ƒ|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        cCsWtiidƒo@tddƒiiƒ}z|~}|iƒ}|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(tostpathtexiststopent__exit__t __enter__treadtNone(t_[1]tfdtversion((s//opt/alt/alt-php-config/multiphp_reconfigure.pytget_cpanel_versionJs & cCsqg}d}xTti|ƒD]C}tiitii|dƒƒo|i|d|fƒqqW|iƒ|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,tii|ƒoti|ƒntSWn-tj o!}tid||fƒtSXdS(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 c Csqy=t|dƒiiƒ}z|~}|i|ƒWdQXWn-tj o!}tid||fƒtSXtS(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&R'R(twritetIOErrorRR:R;R8(R<tprefix_contentR+R,R=((s//opt/alt/alt-php-config/multiphp_reconfigure.pyt create_prefixzs &c Csótƒ}d|}tiit|ƒ}d}d|}|o;tid|dfdtdfƒdjot|ƒ}nvy|i d|ƒ}Wnt i j or} t }t id|tfƒ|id|d ƒttd ƒiiƒ} z| ~ } |i| ƒWd QXnt ij oq} t }|idƒ|id|d ƒttd ƒiiƒ} z| ~ } |i| ƒWd QXd tGHnX|o&tii|ƒot||ƒ}n0| o#tii|ƒot|ƒ}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$R0tSCL_PREFIX_PATHRRtMIN_CPANEL_VERSIONR>t getbooleant configparsert NoOptionErrorR8Rtwarningt CONFIG_PATHtsetR&R'R(R@tNoSectionErrort add_sectionR%RC( tconfigt int_versiont cp_versiont prefix_nameR<RBtalt_php_enable_filetstatust int_enabledR=R+t configfilet_[2]((s//opt/alt/alt-php-config/multiphp_reconfigure.pyt reconfigureŽs<    %  & &cCs8tii|ƒp!tiidi||ƒƒ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@tformatR;R8(tint_pathtint_nametint_ver((s//opt/alt/alt-php-config/multiphp_reconfigure.pytcheck_alt_path_existsÁsc Cs‹y%ti|dddgƒ\}}Wn2tij o#}tiidi|ƒƒdSXt}g}d}xz|D]r\}}|djoBd}d |} t| ||ƒo|i|| fƒqÎdSn|djo t }qsqsWt |ƒ} t i ƒ} | i tƒy@|p tƒ}nx!|D]\} } t| | ƒq,Wd SWn6tj o*}| id ||tiƒfƒdSXdS(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 GetoptErrorR\R]R@R^R;RbR1R8R!RJt ConfigParserR)RMR6RZt ExceptionR:t tracebackt format_exc(tsys_argstoptstargsR=RR3R`topttargR_tlogRQRaR5((s//opt/alt/alt-php-config/multiphp_reconfigure.pytmainÖsB%          t__main__i((RdR/RR#R\RhRJt ImportErrorRfRRHRGRMR!R.R6R>RCRZRbRpRtexittargv(((s//opt/alt/alt-php-config/multiphp_reconfigure.pyts4            3  $