ok
Direktori : /proc/self/root/opt/alt/alt-php-config/ |
Current File : //proc/self/root/opt/alt/alt-php-config/alt-php-panel-configuration.pyo |
� Z�Kdc @ s d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z y d d l j j Z Wn e k r� d d l Z n Xd Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z e d k r� e j e e j d � � n d S( i����N( t copy2t checkt installt uninstallc C s� | r t j } n t j } t j � } | j | � d } t j | d � } | j | � t j � } | j | � | j | � | S( s� Logging configuration function :type verbose: bool :param verbose: Enable additional debug output if True, display only errors othervise :return: configured logger object s %(levelname)-8s: %(message)ss %H:%M:%S %d.%m.%y( t loggingt DEBUGt ERRORt StreamHandlert setLevelt Formattert setFormattert getLoggert addHandler( t verboset levelt handlert log_formatt formattert logger( ( s6 /opt/alt/alt-php-config/alt-php-panel-configuration.pyt configure_logging s c C sE g } x. t j d � D] } | j | d | f � q W| j � | S( s� Returns list of installed alt-php versions and their base directories :rtype: list :return: List of version (e.g. 44, 55) and base directory tuples s /opt/alt/php[0-9][0-9]i����( t globt appendt sort( t php_versionst php_dir( ( s6 /opt/alt/alt-php-config/alt-php-panel-configuration.pyt find_alt_php_versions) s c C s� t j d d g d t j d t j d t �} | j � \ } } x[ | j d � D]J } d | | f | j � j d � d k rO t j d | | f � t SqO Wt j d | | f � t S( sx :param php_ver: alt-php version (e.g. 44, 55, 70) :return: If handler exist returns True, otherwise False s /usr/local/psa/bin/php_handlers --listt stdoutt stderrt universal_newliness s alt-php%s-%st i s Handler for alt-php%s-%s exist.s# Handler for alt-php%s-%s not exist.( t subprocesst Popent PIPEt STDOUTt Truet communicatet splitt stripR t infot False( t cgi_typet php_vert proct outt _t line( ( s6 /opt/alt/alt-php-config/alt-php-panel-configuration.pyt plesk_check_php_handler7 s )c C s] t | | � r* t j d | | f � t St j d | | f � t j j d j | | � � d } | d d d | | f d t j j | d � d t j j | d � d | d d | | f g } | d k rS| j d d | d t j j | d � d t j j | d � g � t j j d | � sut t j j | d � t j j | d � � qun"