OwlCyberSecurity - MANAGER
Edit File: php.cpython-311.pyc
� ������hy����������������������������d�dl�Z�d�dlmZmZ�d�dlmZ�d�dlmZ�d�dlm Z �d�dl mZmZ�d�dl mZmZ�dd lmZ��G�d ��de������������ZdS�)�����N)�Dict�List)�Feature)�ExternalProgramFailed)�check_cagefs_initialized)�CL_SELECTOR_BIN�MODULES_LOGS_DIR)�InstallationFailedException�PackageMissingError����)�WizardInstallerc��������������������������e�Zd�Zej�����������������������������ed������������Zej ��������Z d��Zd��Zd��Z d��Zed����������������Zed����������������Zed����������������Zd ��Zd ��Zd��Zd��Zd S�)�PhpInstallerzphp.logc����������� �������������|�j������������������������������d|������������� �|����������������������t����������dddd|dg�������������d�S�#�t����������$�r}t������������������������|�d�}~ww�xY�w)Nz)trying to set default php version as '%s'�set� --interpreter�phpz--default-version�--json�� app_logger�info�_run_commandr���r���r ���)�self�version�es��� �K/opt/cloudlinux/venv/lib64/python3.11/site-packages/clwizard/modules/php.py�_set_default_php_versionz%PhpInstaller._set_default_php_version���s�����������H�'�R�R�R� 7����#��#��'���� �� �� �� �� ���%�� 7�� 7�� 7�-�/�/�Q�6����� 7��������!A���� A� A�Ac����������� �������������|�j������������������������������d|������������� �|����������������������t����������dddd|dg�������������d�S�#�t����������$�r}t������������������������|�d�}~ww�xY�w)Nz%trying to set PHP Selector state '%s'r���r���r���z--selector-statusr���r���)r����statusr���s��� r����_set_cloudlinux_selector_statusz,PhpInstaller._set_cloudlinux_selector_status*���s�����������D�f�M�M�M� 7����#��#��'���� �� �� �� �� ���%�� 7�� 7�� 7�-�/�/�Q�6����� 7���r���c������������������$����|�j������������������������������dd���������������������|�������������������������g�}|D�]0}d|���������������������dd������������z���}|���������������������|��������������1 ��|�j��������|���dS�#�t����������$�r}t������������������������|�d}~ww�xY�w)z� Install given php versions via groups :param versions: e.g ['4.4', '5.4', '5.6'] :return: None z)php version '%s' is going to be installed�,zalt-php�.��N)r���r����join�replace�append�_install_groupsr���r ���)r����versions�groups�ver�package_namer���s��� r����_install_php_versionz!PhpInstaller._install_php_version<���s�������� ����7����(�9K�9K� �� �� ������ (�� (�C�$�s�{�{�3��';�';�;�L��M�M�,�'�'�'�'� 7�� !�D� �&�)�)�)�)��$�� 7�� 7�� 7�-�/�/�Q�6����� 7���s����% A1��1 B�;B � Bc������������������F����|����������������������d������������}|����������������������dg�������������}|����������������������d������������}|r/|r-||vr)|�j�����������������������������d|�������������t�������������������������|����������������������|�������������t������������������������r�|r1|����������������������d��������������|r|����������������������|�������������d S�d S� �|����������������������d��������������d S�#�t����������$�r3}|�j�����������������������������dt����������|�������������������������Y�d }~d S�d }~ww�xY�wd S�) a��� Run installation of php module It is possible to install only alt-php packages and skip further installation if 'enable_selector': False Otherwise we will configure php selector also -- set selector status to enabled -- set default version if it was passed :param options: {'versions': [5.5, 5.6], 'enable_selector': True} :return: �default_versionr*����enable_selectorzWVersion %s that was specified to be set as default must be included in install_versions�enabled)r ����disabledz/Error occurred while disabling PHP Selector: %sN) �getr����errorr ���r.���r���r!���r���� Exception�str)r����optionsr0����install_versions�to_enable_selectorr���s��� r����run_installationzPhpInstaller.run_installationV���s�������"�+�+�&7�8�8��"�;�;�z�2�6�6��$�[�[�):�;�;���� 4��� 4�?�:J�#J�#J���%�%�;�#������ �2�3�3�3��!�!�"2�3�3�3�#�%�%�� �!�� ��4�4�I�4�F�F�F�"��C��1�1�/�B�B�B�B�B�C��C���8�8� �8�K�K�K�K�K�� ��������O�)�)�I�3�q�6�6�������������������������� �� s���� C!��! D�+(D�Dc������������������ �����h�d�S�)N>���r*���r0���r1�����)�clss��� r����supported_optionszPhpInstaller.supported_options���s������A�A�A�A�����c������������������������ �ddl�m}��n"#�t����������$�r}t����������d������������|�d�}~ww�xY�w�|��������������������������������������������������d���������S�)Nr���)�ClSelect� lvemanager)�clselect.clselectrB����ImportErrorr����get_version)rB���r���s��� r����_php_get_default_versionz%PhpInstaller._php_get_default_version����sh������ ;�2�2�2�2�2�2�2���� ;�� ;�� ;�%�l�3�3��:����� ;�����x�z�z�%�%�'�'��*�*����� �� (�#�(c�������������������l����� �ddl�m}��n"#�t����������$�r}t����������d������������|�d�}~ww�xY�w�|�d������������S�)Nr���)�"interpreter_versions_short_summaryrC���r���)�clselect.clselectctlrJ���rE���r���)rJ���r���s��� r����_php_interpreters_listz#PhpInstaller._php_interpreters_list����sl������ ;� �� �� �� �� �� �� ����� ;�� ;�� ;�%�l�3�3��:����� ;����1�1�%�8�8�8rH���c�����������������������dddid�g}|S�)zh Get list of warnings that should be shown in wizard before module installation z�Further CloudLinux PHP Selector setup will be available in LVE Manager settings after installation. Find more details in our documentation at %(url)s.�urlz:https://docs.cloudlinux.com/php_selector_installation.html)�message�contextr=���)r����warningss��� r���� _get_warningszPhpInstaller._get_warnings����s,������3���W�� �� � ����r@���c������������������:����g�}|�������������������������������������D�]$}|j��������s� |���������������������|j����������������������%t ����������|������������|������������������������������������||����������������������d������������|������������������������������������d�|������������������������������������d�S�)Nr���)r0����installed_versions�available_versionsr1���)�already_configuredr8���rQ���) rL���� installedr(���r����anyrG����_get_available_versions�_is_php_selector_enabledrR���)r���rT����php_interpreters��� r����initial_statuszPhpInstaller.initial_status����s�������� ��#�:�:�<�<�� ?�� ?�O�"�,�� ���%�%�o�&=�>�>�>�>� �#&�&8�"9�"9�#'�#@�#@�#B�#B�&8�&*�&B�&B�5�&I�&I�#'�#@�#@�#B�#B� �����*�*�,�,� �� �� r@���c������������������`�����t����������t������������������������o|������������������������������������������������S�)zM Return True if Php Selector enabled in UI and could be used )�boolr����"_is_php_selector_enabled_in_config)r���s��� r���rZ���z%PhpInstaller._is_php_selector_enabled����s*������ ��,�.�.�\�4�3Z�3Z�3\�3\�]�]�]r@���c�����������������������|�j������������������������������d������������� �ddlm}��|d�����������������������������������������������S�#�t ����������$�r�Y�dS�w�xY�w)zn Return True if Php Selector is enabled for UI in panel specific (DA, Plesk or cPanel) config z!trying to get Php Selector state.r���)�CloudlinuxSelectorLibr���F)r���r����clselector.selectorlibra����php_selector_is_enabledrE���)r���ra���s��� r���r_���z/PhpInstaller._is_php_selector_enabled_in_config����sq������ � ����@�A�A�A� �D�D�D�D�D�D�(�(��/�/�G�G�I�I�I���� �� �� ��5�5� ���s����"?�� A �A N)�__name__� __module__�__qualname__�os�pathr&���r ����LOG_FILEr����PHP_SELECTOR�_REQUIRED_CL_COMPONENT_SUPPORTr���r!���r.���r;����classmethodr?����staticmethodrG���rL���rR���r\���rZ���r_���r=���r@���r���r���r������s��������������w�|�|�,�i�8�8�H�%,�%9�"�7��7��7�$7��7��7�$7��7��7�4'��'��'�R��B��B���[�B���+��+���\�+���9��9���\�9������, �� �� �,^��^��^���������r@���r���)rg����typingr���r����clcommon.constr����clcommon.utilsr����!clconfig.cagefs_statistics_configr����clwizard.constantsr���r ����clwizard.exceptionsr ���r����baser ���r���r=���r@���r����<module>ru������s������� � � � ������������������"��"��"��"��"��"��0��0��0��0��0��0��F��F��F��F��F��F��@��@��@��@��@��@��@��@��P��P��P��P��P��P��P��P��!��!��!��!��!��!�A��A��A��A��A�?��A��A��A��A��Ar@���