U@5 d dl Z d dlZ G d de Z G d de Z G d de Z G d d e Zd Z G d d ZdS ) Nc " e Zd ZdZ fdZ xZS )PhpConfBaseExceptionz&Base class for all php.conf exceptionsc J t | d S Nsuper__init__selfmessage __class__s /builddir/build/BUILDROOT/alt-python27-cllib-3.4.36-1.el9.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/php_conf_reader.pyr zPhpConfBaseException.__init__ s! !!!!! )__name__ __module____qualname____doc__r __classcell__r s @r r r s> 00" " " " " " " " "r r c e Zd Zd fd Z xZS )PhpConfReadErrorNc R |d}t | d S )NzFile open/read errorr r s r r zPhpConfReadError.__init__ s+ ?,G !!!!!r r r r r r r r s @r r r s= " " " " " " " " " "r r c e Zd Z fdZ xZS )PhpConfLoadExceptionc \ d| d| d}t | d S )NzError at line z: zN. Please see http://docs.cloudlinux.com/index.html?custom_php_ini_options.htmlr )r line_numreasonr r s r r zPhpConfLoadException.__init__ sK P8 P Pv P P P !!!!!r r r s @r r r 8 " " " " " " " " "r r c e Zd Z fdZ xZS )!PhpConfNoSuchAlternativeExceptionc d || _ d| d}t | d S )NzNo such alternative version ())php_versionr r )r versionr r s r r z*PhpConfNoSuchAlternativeException.__init__" s9 "<'<<< !!!!!r r r s @r r! r! ! r r r! c $ t | d S )Nrb)mode)open) file_names r _openr+ ) s %%%%r c l e Zd ZdZg dZg dZd Zd Zd Zd Z d Z ed Zed Z dS ) PhpConfReaderz Class for read and parse /etc/cl.selector/php.conf During read this file, its syntax check is performed Contains methods for get its data for selectoctl and cagefsctl utilities in required formats ) DirectiveDefaultTypeCommentRangeRemark)valuelistboolc " || _ d | _ d S r )phpconf_path _php_conf)r r8 s r r zPhpConfReader.__init__6 s ( r c t | j }| }| |S # t t f$ r}t |j |d}~ww xY w)zW Reads file and returns its content :return: List of filelines N)r+ r8 readlinescloseOSErrorIOErrorr strerror)r f conf_lineses r _read_filezPhpConfReader._read_fileA sm 6d'((AJ GGIII! 6 6 6"1:..A5 6s =A A+A&&A+c i }| } d }d }t |d D ]f\ }}| dd }| d rDt | dk rd }d }\d|vrt |d | dd }|d }|d } || j vrt |d | d |s|dk rt |d| d |dk r!|rt |d| d | }| }i ||<