Mini Shell
�
F��w�� � � d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ej � � ddl T ddl
Z
ddlZ e
j d � � Z
d
� Z G d� de� � ZdS )
z9
Module to validate the configuration file alt_phpXX.cfg
� )�absolute_import)�division)�print_function)�unicode_literals)�standard_library)�*Nzalt_php(\d)(\d)\.cfgc �� � t � t j � | � � � � }|r)d� |� dd� � � � S dS )zr
function to get the version of the php file name alt_phpXX.cfg
for example: 'alt_php55.cfg' => '5.5'
�.� � N)�ALTPHPVER_PATTERN�search�os�path�basename�join�group)�input_phpini_path�php_ver_searcheds �c/builddir/build/BUILDROOT/cagefs-7.6.19-1.el9.cloudlinux.x86_64/usr/share/cagefs/phpinivalidator.py�get_php_verr s^ � �
)�/�/���0@�0@�AR�0S�0S�T�T��� 6��x�x�(�.�.�q�!�4�4�5�5�5�6� 6� c �l � e Zd Z ej d� � Z ej d� � ZdZd
d�Zd� Z d� Z
d� Zd S )�PHPINIvalidatorz/(^Directive|Type|Range|Remark)\s*=\s*(.*\S)\s*$z@^([a-zA-Z0-9_.]+)\s*=\s*([^;="]+[^;=" \t]|".+"|[^;="])\s*(;.*)?$)�On�Off�0�1�True�False�/etc/cl.selector/php.confc �| � || _ | � | j � � | _ g | _ g | _ g | _ d S )N)�phpconf_path�
_load_phpconf�
_phpconf_data�unknown_options�invalid_values_options�invalid_options)�selfr# s r �__init__zPHPINIvalidator.__init__) sA � �(���!�/�/��0A�B�B���!���&(��#�!����r c �d � i }d}t |� � }|D ]�}|� d� � r�| j � |� � � � � }|s�G|� dd� � \ }}|dk r|}t
� � ||<