!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/apex_tdfonline/php/3ros/wsf/wsdl/   drwxr-xr-x
Free 14.71 GB of 61.93 GB (23.76%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     WS_WSDL_Operations.php (14.43 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/*
 * Copyright (c) 2005-2010 WSO2, Inc. http://wso2.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * This class retrives the types information from the php function and
 * maps with xsd types 
 */
class WS_WSDL_Operations
{

    const 
WS_OPERATION_INPUT_TAG WS_WSDL_Const::WS_WSDL_INPUT_ATTR_NAME;
    const 
WS_OPERATION_OUTPUT_TAG WS_WSDL_Const::WS_WSDL_OUTPUT_ATTR_NAME;
    const 
WS_OPERATION_TYPE_TAG 'type';
    const 
WS_OPERATION_RET_TAG 'return';
    const 
WS_OPERATION_NAME_TAG 'name';

    static public 
$mappingTable = array(
                                      
"string"         =>  "string",
                                      
"boolean"        =>  "boolean",
                                      
"double"         =>  "float",
                                      
"float"          =>  "float",
                                      
"int"            =>  "int",
                                      
"integer"        =>  "int",
                                      
"byte"           =>  "int",
                                      
"decimal"        =>  "string",
                                      
"base64Binary"   =>  "string",
                                      
"hexBinary"      =>  "string",
                                      
"anyType"        =>  "soap Var Object",
                                      
"any"            =>  "soap Var Object",
                                      
"QName"          =>  "string",
                                      
"dateTime"       =>  "string",
                                      
"date"           =>  "string",
                                      
"time"           =>  "string",
                                      
"unsignedLong"   =>  "int",
                                      
"unsignedInt"    =>  "int",
                                      
"unsignedShort"  =>  "int",
                                      
"unsignedByte"   =>  "int",
                                      
"positiveInteger"=>  "int",
                                      
"negativeInteger"=>  "int",
                                      
"nonNegativeInteger"=>"int",
                                      
"gYearMonth"     =>  "string",
                                      
"gMonthDate"     =>  "string",
                                      
"gYear"          =>  "string",
                                      
"gMonth"         =>  "string",
                                      
"gDay"           =>  "string",
                                      
"duration"       =>  "string",
                                      
"Name"           =>  "string",
                                      
"NCName"         =>  "string",
                                      
"NMTOKEN"        =>  "string",
                                      
"NOTATION"       =>  "string",
                                      
"NMTOKENS"       =>  "string",
                                      
"ENTITY"         =>  "string",
                                      
"ENTITIES"       =>  "string",
                                      
"IDREF"          =>  "string",
                                      
"IDREFS"         =>  "string",
                                      
"anyURI"         =>  "string",
                                      
"language"       =>  "string",
                                      
"normalizedString"=> "string",
                                      
"token"          => "string");



    public 
$createdTypes = array();
    public 
$operations = array();
    public 
$xsdMapArry = array();
    public 
$phpMapArry = array();
    public 
$operationName;

    public 
$xsdTypes = array();
    public 
$className NULL;

    
/*
     * constructor of the class
     * @param Array $operations Array of operations defined in the service
     */
    
function __construct($operations$class_arry)
    {
        if(
$class_arry != NULL)
        {
            foreach(
$class_arry as $name => $class_info)
            {
                if(
is_array($class_info) && is_array($class_info["operations"]))
                {
                    foreach(
$class_info["operations"] as $i=>$value)
                    {
                        
$this->operationName $value;
                        
$this->xsdMapArry[$this->operationName] = array();
                        
$this->className $name;
                        
$this->setOperations($this->operationName$this->className);
                    }
                }
            }
        }
        else if(
$operations != NULL)
        {
            foreach(
$operations as $i=>$value)
            {
                
$this->operationName $value;
                
$this->xsdMapArry[$this->operationName] = array();
                
$this->setOperations($this->operationNameNULL);
            }
        }
    }

    private function 
getOperations() {
        return 
$this->operations;
    }

    public function 
getSchemaTypes() {
        return 
$this->xsdTypes;
    }

    private function 
setOperations($operationName$classname NULL)
    {
        
$this->operations[$operationName][self::WS_OPERATION_INPUT_TAG] = array();
        
$this->operations[$operationName][self::WS_OPERATION_OUTPUT_TAG] = array();

        
$doc_comment "";
        if(
$classname != NULL)
        {
            
$class = new ReflectionClass($classname);
            
$operation $class->getMethod($operationName);

            
$doc_comment $operation->getDocComment();
        }
        else
        {
            
$operation = new ReflectionFunction($operationName);
            
$doc_comment $operation->getDocComment();
        }

        if (!
$doc_comment)
        {
            
$this->xsdTypes[$operationName][self::WS_OPERATION_INPUT_TAG] = array();

            foreach(
$operation->getParameters() as $i => $param)
            {
                
$match[2] = $param->getName();
                
$match[1] = "anyType";
                
$this->xsdTypes[$operationName][self::WS_OPERATION_INPUT_TAG][$match[2]] = array("type"=>"anyType",
                                                                         
"array" => NULL,
                                                                         
"object" => NULL);


                
$this->createdTypes[$match[1]] = 2;
                
$this->operations[$operationName][self::WS_OPERATION_INPUT_TAG][] =
                    array(
self::WS_OPERATION_NAME_TAG => $match[2],
                          
self::WS_OPERATION_TYPE_TAG => $match[1]);
            }


            
$this->xsdTypes[$operationName][self::WS_OPERATION_OUTPUT_TAG]["returnVal"] = array("type"=> "anyType",
                                                                            
"array" => NULL,
                                                                            
"object" => NULL);

            if (isset(
$match)) {
                
$this->createdTypes[$match[1]] = 2;
                
$this->operations[$operationName][self::WS_OPERATION_OUTPUT_TAG][] =
                    array(
self::WS_OPERATION_NAME_TAG => self::WS_OPERATION_RET_TAG,
                          
self::WS_OPERATION_TYPE_TAG => $match[1]);
            }

        }
        else
        {
            if(
preg_match_all('|xs:?(\w+).*|'$doc_comment$matchingPREG_SET_ORDER ))
            {
                
$i 0;
                foreach(
$matching as $matchs)
                {
                    
$i++;
                    
$this->xsdMapArry[$this->operationName][$i] = $matchs[1];

                }
            }
            
$j 0;
            
$k 0;
            
            
///SIU: Inicio
            
$first_param strpos($doc_comment"@param");
            if (
$first_param !== false) {
                
$documentation substr($doc_comment0$first_param); 
                
$documentation trim(str_replace(array("*""/"), ""$documentation));
                
$this->operations[$operationName]['documentation'] = $documentation;                
            }
            
///SIU: Fin
            
            
if(preg_match_all(
                    
'|@param\s+(?:(\[\s*\d*\s*,[^\]]*\])\s+)?(?:(array)\s+of\s+)?(?:(object)\s+)?(\w+)\s+\$(\w+)\s+(.*)|',
                    
$doc_comment,
                    
$matchesPREG_SET_ORDER))
            {
                
$this->xsdTypes[$operationName][self::WS_OPERATION_INPUT_TAG] = array();
                foreach(
$matches as $match)
                {
                    
$min_max_occurs $match[1];
                    
$is_array $match[2];
                    
$is_object $match[3];
                    
$type_name $match[4];
                    
$element_name $match[5];
                    

                    
// the default is set to NULL
                    
$min NULL;
                    
$max NULL;
                    if(
$min_max_occurs && !empty($min_max_occurs)) {
                        
$result NULL;
                        
preg_match_all("|\[\s*(\d*)\s*,\s*([^\]]*)\s*\]|"$min_max_occurs,
                                
$resultPREG_PATTERN_ORDER);

                        
$min $result[1][0];
                        
$max $result[2][0];

                    }

                    
$j++;
            
$k++;
                    
$this->createdTypes[$type_name] = 1;
                    
$this->phpMapArry[$j] = $type_name;

                    if(
$is_object == "object")
                    {
                        
$releventType $type_name;
                    }
                    else
                    {
                        
$releventType $this->checkValidTypes($j$k);
                    } 
                    
$this->xsdTypes[$operationName][self::WS_OPERATION_INPUT_TAG][$element_name] = array("type"=>$releventType,
                                                                             
"array" => $is_array,
                                                                             
"object"=> $is_object,
                                                                             
"min" => $min,
                                                                             
"max" => $max,
                                                                             
"documentation" => $match[6]);    //SIU 

                    
                    // the following information is used in building the message element
                    
$this->operations[$operationName][self::WS_OPERATION_INPUT_TAG][] =
                        array(
self::WS_OPERATION_NAME_TAG => $element_name,
                              
self::WS_OPERATION_TYPE_TAG => $releventType,
                              
"object"=> $is_object);

                }
            }

            if(
preg_match(
                
'|@return\s+(?:(\[\s*\d*\s*,\s*[^\]]*\])\s+)?(?:(array)\s+of\s+)?(?:(object)\s+)?(\w+)\s+\$(\w+)\s+(.*)|',
                
$doc_comment$match_r))
            {

                
$min_max_occurs $match_r[1];
                
$is_array $match_r[2];
                
$is_object $match_r[3];
                
$type_name $match_r[4];
                
$element_name $match_r[5];

                
// the default is set to NULL
                
$min NULL;
                
$max NULL;

                if(
$min_max_occurs && !empty($min_max_occurs)) {
                    
$result NULL;
                    
preg_match_all("|\[\s*(\d*)\s*,\s*([^\]]*)\s*\]|"$min_max_occurs,
                            
$resultPREG_PATTERN_ORDER);

                    
$min $result[1][0];
                    
$max $result[2][0];

                }

                
$j++;
                
$k++;
                
$this->phpMapArry[$j] = $type_name;

                if(
$is_object == "object")
                {
                    
$returnType $type_name;
                }
                else
                {
                    
//$k++;
                    
$returnType $this->checkValidTypes($j$k);
                } 

                
$this->xsdTypes[$operationName][self::WS_OPERATION_OUTPUT_TAG][$element_name] = array("type"=>$returnType,
                                                                             
"array" => $is_array,
                                                                             
"object"=> $is_object,
                                                                             
"min" => $min,
                                                                             
"max" => $max,
                                                                             
"documentation" => $match_r[6]);

                
$this->createdTypes[$type_name] = 1;


                
// the following information is used in building the message element
                
$this->operations[$operationName][self::WS_OPERATION_OUTPUT_TAG][] =
                    array(
self::WS_OPERATION_NAME_TAG => self::WS_OPERATION_RET_TAG,
                          
self::WS_OPERATION_TYPE_TAG => $returnType,
                          
"object"=> $is_object);

            }
        }
        require_once(
'dynamic_invocation/wsf_wsdl_consts.php');
        
ws_log_write(__FILE____LINE__WSF_LOG_DEBUG"ouput :".print_r($this->operations[$operationName][self::WS_OPERATION_OUTPUT_TAG], TRUE));
        
ws_log_write(__FILE____LINE__WSF_LOG_DEBUG"input :".print_r($this->operations[$operationName][self::WS_OPERATION_INPUT_TAG], TRUE));
    }
    
/**
     * check if the xsd type and php types are mathched if not a log
     *is written
     *@param string $keyIndex 
     */
    
function checkValidTypes($keyIndex$keyXsdIndex)
    {
        
$keyPHPArray NULL;
        if(
array_key_exists($keyXsdIndex$this->xsdMapArry[$this->operationName])) {
            
$keyPHPArray $this->xsdMapArry[$this->operationName][$keyXsdIndex];
        }

        
$PHPType NULL;
        if(
array_key_exists($keyIndex$this->phpMapArry)) {
            
$PHPType $this->phpMapArry[$keyIndex];
        }
        
        require_once(
'dynamic_invocation/wsf_wsdl_consts.php');
        
ws_log_write(__FILE____LINE__WSF_LOG_DEBUG"mapping :".$keyPHPArray." to ".$PHPType);

        if( 
$keyPHPArray && array_key_exists($keyPHPArrayself::$mappingTable) && 
                
$PHPType == self::$mappingTable[$keyPHPArray])
        {
            return 
$keyPHPArray;
        }
        else
        {
            
error_log("type missmatched"0);
            return 
$PHPType;
        }

    }


}




?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.816 ]--