!C99Shell v. 1.0 pre-release build #13!

Software: Apache. PHP/5.5.15 

uname -a: Windows NT SVR-DMZ 6.1 build 7600 (Windows Server 2008 R2 Enterprise Edition) i586 

SYSTEM 

Safe-mode: OFF (not secure)

C:\dmz\php\pear\phing\util\   drwxrwxrwx
Free 3.24 GB of 39.52 GB (8.2%)
Detected drives: [ a ] [ c ] [ d ] [ e ] [ f ]
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

/**
 * String helper utility class.
 *
 * This class includes some Java-like functions for parsing strings,
 * as well as some functions for getting qualifiers / unqualifying phing-style
 * classpaths.  (e.g. "phing.util.StringHelper").
 *
 * @author Hans Lellelid <hans@xmpl.org>
 * @package phing.system.util
 */
class StringHelper {

    private static 
$TRUE_VALUES = array("on""true""t""yes");
    private static 
$FALSE_VALUES = array("off""false""f""no");
    
    
/**
     * Replaces identifier tokens with corresponding text values in passed string.
     *
     * @param array $strings Array of strings to multiply. (If string is passed, will convert to array)
     * @param array $tokens The tokens to search for.
     * @param array $replacements The values with which to replace found tokens.
     * @return string
     */
    
public static function multiply($strings$tokens$replacements) {
        
$strings = (array) $strings;
        
$results = array();
        foreach (
$strings as $string) {
            
$results[] = str_replace($tokens$replacements$string);
        }        
        return 
$results;
    }

    
/**
     * Remove qualification to name.
     * E.g. eg.Cat -> Cat
     * @param string $qualifiedName
     * @param string $separator Character used to separate.
     */
    
public static function unqualify($qualifiedName$separator '.') {
        
// if false, then will be 0
        
$pos strrpos($qualifiedName$separator);
        if (
$pos === false) { 
            return 
$qualifiedName;  // there is no '.' in the qualifed name
        
} else {
            return 
substr($qualifiedName$pos 1); // start just after '.'
        
}
    }

    
/** 
     * Converts a string to an indexed array of chars
     * There's really no reason for this to be used in PHP, since strings
     * are all accessible using the $string{0} notation.
     * @param string $string
     * @return array
     * @deprecated
     */
    
public static function toCharArray($str) {
        
$ret=array();
        
$len=strlen($str);
        for (
$i=0$i $len$i++) {
            
$ret[] = $str{$i};
        }
        return 
$ret;
    }
    
    
/**
     * Get the qualifier part of a qualified name.
     * E.g. eg.Cat -> eg
     * @return string
     */    
    
public static function qualifier($qualifiedName$seperator '.') {
        
$pos strrchr($qualifiedName$seperator);
        if (
$pos === false) {
            return 
'';
        } else {
            return 
substr($qualifiedName0$pos);
        }
    }
    
    
/**
     * @param array $columns String[]
     * @param string $prefix
     * @return array String[]
     */ 
    
public static function prefix$columns$prefix) {
        if (
$prefix == null) return $columns;
        
$qualified = array();
        foreach(
$columns as $key => $column) {
            
$qualified[$key] = $prefix $column;
        }        
        return 
$qualified;
    }
    
    
/**
     *
     * @return string
     */ 
    
public static function root($qualifiedName$separator '.') {
        
$loc strpos($qualifiedName$separator);
        return (
$loc === false) ? $qualifiedName substr($qualifiedName0$loc);
    }
    
    
/**
     * @return int
     */
    
public static function hashCode($string) {
        return 
crc32($string);
    }
    
    
/**
     * @return boolean
     */ 
    
public static function booleanValue($s) {
        if (
is_bool($s)) {
            return 
$s// it's already boolean (not a string)
        
}
        
// otherwise assume it's something like "true" or "t"
        
$trimmed strtolower(trim($s));
        return (boolean) 
in_array($trimmedself::$TRUE_VALUES);
    }

    
/** tests if a string is a representative of a boolean */
    
public static function isBoolean($s) {

        if (
is_bool($s)) {
            return 
true// it already is boolean
        
}
        
        if (
$s === "" || $s === null || !is_string($s)) {
            return 
false// not a valid string for testing
        
}

        
$test trim(strtolower($s));
        return (boolean) 
in_array($testarray_merge(self::$FALSE_VALUESself::$TRUE_VALUES));
    }
        
    
/**
     * Creates a key based on any number of passed params.
     * @return string
     */
    
public static function key() {
        
$args func_get_args();
        return 
serialize($args);
    }    
    
    
/** tests if a string starts with a given string */
    
public static function startsWith($check$string) {
        if (
$check === "" || $check === $string) {
            return 
true;
        } else {
            return (
strpos($string$check) === 0) ? true false;
        }
    }
    
    
/** tests if a string ends with a given string */
    
public static function endsWith($check$string) {
        if (
$check === "" || $check === $string) {
            return 
true;
        } else {
            return (
strpos(strrev($string), strrev($check)) === 0) ? true false;
        }
    }            

    
/**
     * a natural way of getting a subtring, php's circular string buffer and strange
     * return values suck if you want to program strict as of C or friends 
     */
    
public static function substring($string$startpos$endpos = -1) {
        
$len    strlen($string);
        
$endpos = (int) (($endpos === -1) ? $len-$endpos);
        if (
$startpos $len-|| $startpos 0) {
            
trigger_error("substring(), Startindex out of bounds must be 0<n<$len"E_USER_ERROR);
        }
        if (
$endpos $len-|| $endpos $startpos) {
            
trigger_error("substring(), Endindex out of bounds must be $startpos<n<".($len-1), E_USER_ERROR);
        }
        if (
$startpos === $endpos) {
            return (string) 
$string{$startpos};
        } else {
            
$len $endpos-$startpos;
        }
        return 
substr($string$startpos$len+1);
    }

    
/**
     * Does the value correspond to a slot variable?
     * @param string $value    
     */
    
public static function isSlotVar($value) {
        
$value trim($value);
        if (
$value === "") return false;
        return 
preg_match('/^%\{([\w\.\-]+)\}$/'$value);
    }
    
    
/**
     * Extracts the variable name for a slot var in the format %{task.current_file}
     * @param string $var The var from build file.
     * @return string Extracted name part.
     */
    
public static function slotVar($var) {
        return 
trim($var'%{} ');
    }
    
}



:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0156 ]--