示例#1
0
 public function getParent()
 {
     $result = new String($this->m_sFilename);
     if ($result->lastIndexOf(new java_lang_String("/")) > -1) {
         return $result->substring(0, $result->lastIndexOf(new String("/")));
     } else {
         return Translator_JavaBase::$null;
     }
 }
 public function setPath($path_)
 {
     $this->m_pathParams = [];
     if (0 == String::indexOf($path_, ':')) {
         $pathParams = explode(':', String::substring($path_, 1));
     } else {
         $pathParams = explode(':', $path_);
     }
     foreach ($pathParams as $pathParam) {
         $this->pushPathParam(\str\decodeUrl($pathParam));
     }
     return $this;
 }
示例#3
0
    /**
     * Initializes a new File Object from parent and child or just parent.
     */
    public function __construct($parent = "", $child = "") {
        $parent = new String($parent);
        $child = new String($child);
        
        if($parent->isEmpty())
            throw new Exception("File path cannot be empty.");
            
        if($parent->isEmpty() && $child->isEmpty())
            throw new Exception("File path cannot be empty.");

        if($parent->substring(-1) == $this::seperatorChar && !$child->isEmpty())
            $this->path = $parent . $child;
        else if(!$child->isEmpty())
            $this->path = $parent . $this::seperatorChar . $child;
        else
            $this->path = $parent;
	}
示例#4
0
$currency_symbol = strtoupper($currency1);
$currency_info = $CFG->currencies[$currency_symbol];
API::add('Stats', 'getCurrent', array($currency_info['id']));
API::add('Transactions', 'get', array(false, false, 5, $currency1));
API::add('Orders', 'get', array(false, false, 5, $currency1, false, false, 1));
API::add('Orders', 'get', array(false, false, 5, $currency1, false, false, false, false, 1));
API::add('Currencies', 'getRecord', array('BTC'));
$query = API::send();
$stats = $query['Stats']['getCurrent']['results'][0];
$transactions = $query['Transactions']['get']['results'][0];
$bids = $query['Orders']['get']['results'][0];
$asks = $query['Orders']['get']['results'][1];
$btc_info = $query['Currencies']['getRecord']['results'][0];
$currencies = $CFG->currencies;
$page_title = strip_tags(str_replace('[currency]', $currency_symbol, Lang::string('home-landing-currency')));
$meta_desc = String::substring(strip_tags(str_replace('[currency]', '<strong>' . $currency_symbol . '</strong>', Lang::string('home-landing-currency-explain'))), 300);
include 'includes/head.php';
if ($stats['daily_change'] > 0) {
    $arrow = '<i id="up_or_down" class="fa fa-caret-up" style="color:#60FF51;"></i> ';
} elseif ($stats['daily_change'] < 0) {
    $arrow = '<i id="up_or_down" class="fa fa-caret-down" style="color:#FF5151;"></i> ';
} else {
    $arrow = '<i id="up_or_down" class="fa fa-minus"></i> ';
}
?>
<div class="fresh_projects global_stats">
	<div class="clearfix mar_top6"></div>
	<div class="container">
    	<h1 style="margin-bottom:5px;"><?php 
echo str_replace('BTC', $btc_info['name_' . $CFG->language], str_replace('[currency]', '<strong>' . $currency_info['name_' . $CFG->language] . '</strong>', Lang::string('home-landing-currency')));
?>
示例#5
0
 function aggregate($name, $formula, $header_caption = false, $cumulative_function = false, $run_in_sql = false, $filter = false, $join_path = false, $join_condition = false)
 {
     global $CFG;
     $this->fields[$name] = array('name' => $name, 'formula' => $formula, 'header_caption' => $header_caption ? $header_caption : String::substring($formula, 15), 'method_id' => $CFG->method_id, 'cumulative_function' => $cumulative_function, 'run_in_sql' => $run_in_sql, 'filter' => $filter, 'join_path' => $join_path, 'join_condition' => $join_condition, 'is_op' => 1);
 }
示例#6
0
 public function substring()
 {
     $str = new String('H�llo');
     $this->assertEquals(new String('�llo'), $str->substring(1));
     $this->assertEquals(new String('ll'), $str->substring(2, -1));
     $this->assertEquals(new String('o'), $str->substring(-1, 1));
 }
示例#7
0
文件: String.php 项目: reoring/sabel
 public function testSubString()
 {
     $string = new String("Hello World");
     $str = $string->substring(6);
     $this->assertTrue($str->equals("World"));
     $this->assertTrue($string->equals("Hello World"));
     $str = $string->substring(6, 3);
     $this->assertTrue($str->equals("Wor"));
     $str = $string->substring(1, -1);
     $this->assertTrue($str->equals("ello Worl"));
     $string = new String("あいうえおかきくけこ");
     $str = $string->substring(5);
     $this->assertTrue($str->equals("かきくけこ"));
     $str = $string->substring(6, 3);
     $this->assertTrue($str->equals("きくけ"));
     $str = $string->substring(1, -1);
     $this->assertTrue($str->equals("いうえおかきくけ"));
 }