示例#1
0
 public function testComposeArray()
 {
     $this->assertEquals('This is a string and a 2', fText::compose('This is %s and a %d', array('a string', 2)));
     $this->assertEquals('This is a string', fText::compose('This is %s', array('a string')));
     $this->assertEquals('This is a 2', fText::compose('This is a %d', array(2)));
 }
示例#2
0
 /**
  * Resets the configuration of the class
  *
  * @internal
  *
  * @return void
  */
 public static function reset()
 {
     self::$compose_callbacks = array('pre' => array(), 'post' => array());
 }
示例#3
0
<?php

require __DIR__ . '/translate.php';
fText::registerComposeCallback('pre', 'translate');
fSession::setPath(SESSIONS_PATH);
fSession::setLength('1 day 2 hours');
fORMDatabase::attach(new fDatabase('mysql', DB_NAME, DB_USER, DB_PASS, DB_HOST));
fAuthorization::setLoginPage(SITE_BASE . '/login2');