ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib64/python3.11/site-packages/clwpos/php/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/clwpos/php/__pycache__/base.cpython-311.pyc

�

�2�f,���ddlmZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
ejGd�d����ZdS)	�)�absolute_importN)�Path)�PhpBrokenException)�cached_in_scope)�run_in_cagefs_if_neededc��eZdZUeed<eed<eed<eed<eed<eed<d�Zdd	�Zd
�Zedefd���Z	edefd
���Z
dd�ZdS)�PHP�
identifier�version�modules_dir�bin�ini�dirc�*�t|j��S�N)�hashr
)�selfs �F/opt/cloudlinux/venv/lib64/python3.11/site-packages/clwpos/php/base.py�__hash__zPHP.__hash__"s���D�O�$�$�$��otherc�"�|j|jkSr�r
�rrs  r�__eq__z
PHP.__eq__%s����%�"2�2�2rc�"�|j|jkSrrrs  r�__gt__z
PHP.__gt__(s�����!1�1�1r�	extensionc	��ttt|j���d|�d�������}|S)zr
        Quick check that given extension is installed as
        so file in default extensions directory
        z**/z.so)�bool�listrr�glob)rr�
is_presents   r�is_extension_installedzPHP.is_extension_installed+sD���$�t�D�$4�5�5�:�:�;O��;O�;O�;O�P�P�Q�Q�R�R�
��rc���|�|��sdS|j}tj��dkr
tj}nt}||�d|��ddi���jdk}|S)z�
        Complex check that given extension is loaded as
        part of the ini configuration.

        Be careful with this method because it actually runs
        php process and may be heavy.
        Frz -m | /bin/grep Tz	/bin/bash)�shell�
executable�env)r$r
�os�geteuid�
subprocess�runr�
returncode)rr�php_bin_path�	exec_func�	is_loadeds     r�is_extension_loadedzPHP.is_extension_loaded4s����*�*�9�5�5�	��5��x��
�:�<�<�1���"��I�I�/�I��I��8�8�Y�8�8��"��	
�
�
�
���	��r�returnc��|jddg}t|i���}|jr.|js't	t|j��|j���t
jd��}|�|j��}|r@|d�	d���
dd��}ddlm}||��S|S)	zn
        PHP selector can replace path with symlink.
        It's a reason why we need normalization.
        z-rzecho php_ini_loaded_file();)r(zalt.*php[^/]*/r�/�-)�create_generic_php)
r
r�stderr�stdoutr�str�re�compile�search�strip�replace�clwpos.php.alt_phpr6)r�command�result�alt_pattern�captured_version�php_namer6s       r�apply_php_selectorzPHP.apply_php_selectorOs����8�T�#@�A��(��b�9�9�9���=�	C���	C�$�S���]�]�F�M�B�B�B��j�!2�3�3��&�-�-�f�m�<�<���	0�'��*�0�0��5�5�=�=�c�3�G�G�H�
>�=�=�=�=�=�%�%�h�/�/�/��rN)rr	)r2r	)�__name__�
__module__�__qualname__r9�__annotations__rrrrr$r1rE�rrr	r	s���������O�O�O��L�L�L�����

�H�H�H�

�H�H�H�

�H�H�H�%�%�%�3�3�3�3�2�2�2��������_����S�����_��4�����rr	)�
__future__r�dataclassesr)r:r+�pathlibr�clwpos.cl_wpos_exceptionsr�clwpos.scoped_cacher�clwpos.utilsr�	dataclassr	rJrr�<module>rRs���&�&�&�&�&�&�����	�	�	�	�	�	�	�	�����������8�8�8�8�8�8�/�/�/�/�/�/�0�0�0�0�0�0�
��^�^�^�^�^�^�^���^�^�^r

Zerion Mini Shell 1.0