File: //opt/cloudlinux/venv/lib/python3.11/site-packages/clwpos/php/__pycache__/alt_php.cpython-311.pyc
�
�]�fJ � �x � d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ dZ dde
fd�Zdee fd �Zd
� Z
d� ZdS )
� )�absolute_importN)�List)�PHPz/usr/bin/selectorctl�alt_php_identifierc �N � |�d| � dd� � � d�}n|}|r|nt } || | d � d| d � �t j � |d� � |t j � |d� � t j � |d � � �
� � S )Nz/opt/�-�/����.���zusr/lib64/php/modules/zusr/bin/phpzlink/conf/default.ini)�
identifier�version�modules_dir�dir�bin�ini)�replacer �os�path�join)r � root_path�base_cls�php_root_dirs �I/opt/cloudlinux/venv/lib64/python3.11/site-packages/clwpos/php/alt_php.py�create_generic_phpr s� � ���F�1�9�9�#�s�C�C�F�F�F��� ��#�,�x�x��H��8�%�%�b�)�D�D�,>�r�,B�D�D��G�L�L��/G�H�H���G�L�L��}�5�5��G�L�L��'>�?�?�
� � � � �returnc �t �� d} t j d� � ��fd�t j | � � D � � }|S )z1
Get list of installed alt-php versions.
z/opt/altz
^php\d{2}$c �^ �� g | ])}�� |� � �t d |� �� � ��*S )zalt-)�matchr )�.0�dirname�patterns �r �
<listcomp>z(get_alt_php_versions.<locals>.<listcomp>$ sL �� � � � �18��=�=��!�!���+�'�+�+�,�,�� � r )�re�compiler �listdir)�alt_dir�alt_php_versionsr# s @r �get_alt_php_versionsr* sT �� � �G��j��'�'�G�� � � �<>�J�w�<O�<O�� � �� �r c
� � g }t j t dd|gdd�� � j }|r1d� |� � � � d� � D � � }|s|� d|� � dS |� d t | � � |t |� � � � |D ]\}t j t d
d� | � � d|d|gdd�� � }|� dt |� � |� � �]dS )
z\
To turn off extensions in selector for avoiding them loading in separate places!!!
z--list-usersz --versionT��capture_output�textc �: � g | ]}|�|� � � ��S � )�strip)r! �lines r r$ z/disable_selector_extensions.<locals>.<listcomp>3 s&