dKj ddlmZddlZddlZddlZddlmZddlmZddl m Z dZ d de fdZ d ee fd Zd Zd ZdS))absolute_importN)List) is_ubuntu)PHPz/usr/bin/selectorctlalt_php_identifierc r|d|ddd}n|}tsdnd}|r|nt}|||dd|dtj|||tj|d tj|d  S) Nz/opt/-/zusr/lib64/php/modules/z%usr/lib/x86_64-linux-gnu/php/modules/.z usr/bin/phpzlink/conf/default.ini) identifierversion modules_dirdirbinini)replacerrospathjoin)r root_pathbase_cls php_root_dirmodules_base_dirs py/clwpos/php/alt_php.pycreate_generic_phpr sF199#sCCFFF  7@{{o//Ho#,xxH 8%%b)DD,>r,BDDGLL/?@@  GLL} 5 5 GLL'> ? ?    returnc(d}tjd}g}tj|D]d}||st d|}tj|jsO| |e|S)u Get list of installed alt-php versions. Skip /opt/alt/phpNN dirs whose php binary is missing — otherwise callers like PHP.is_extension_loaded() crash with FileNotFoundError. z/opt/altz ^php\d{2}$zalt-) recompilerlistdirmatchrrexistsrappend)alt_dirpatternalt_php_versionsdirname php_versions rget_alt_php_versionsr,!sGj''G:g&&--}}W%%  ()9)9)9:: w~~ko..   ,,,, rc g}tjtdd|gddj}|r1d|dD}|s|d|dS|d t||t||D]\}tjtd d|d|d |gdd}|d t||]dS) z\ To turn off extensions in selector for avoiding them loading in separate places!!! z --list-usersz --versionTcapture_outputtextc:g|]}||S)strip).0lines r z/disable_selector_extensions..=s&___Z^_ ___r,z-No users found using selector with version %sNz)r@ update_ress r#update_selector_built_in_extensionsrHOsI!R S"&J KK93z??KKKKKr)NN) __future__rrr!r8typingrclcommon.utilsrclwpos.php.baserr:r>rr,rErHr2rrrMs&&&&&& $$$$$$& 3(d3i&\\\6LLLLLr