示例#1
0
 public static function getDefaultDomainUrl($useSSL)
 {
     $urlStr = GTConfig::getProperty("gexin_default_domainurl", null);
     if ($urlStr == null || "" . equals(trim($urlStr))) {
         if ($useSSL) {
             $hosts = array("https://cncapi.getui.com/serviceex", "https://telapi.getui.com/serviceex", "https://api.getui.com/serviceex", "https://sdk1api.getui.com/serviceex", "https://sdk2api.getui.com/serviceex", "https://sdk3api.getui.com/serviceex");
         } else {
             $hosts = array("http://sdk.open.api.igexin.com/serviceex", "http://sdk.open.api.gepush.com/serviceex", "http://sdk.open.api.getui.net/serviceex", "http://sdk1.open.api.igexin.com/serviceex", "http://sdk2.open.api.igexin.com/serviceex", "http://sdk3.open.api.igexin.com/serviceex");
         }
     } else {
         $list = explode(",", $urlStr);
         $hosts = array();
         foreach ($list as $value) {
             if (strpos($value, "https://") === 0 && !$useSSL) {
                 continue;
             }
             if (strpos($value, "http://") === 0 && $useSSL) {
                 continue;
             }
             if ($useSSL && strpos($value, "http") != 0) {
                 $value = "https://" . $value;
             }
             array_push($hosts, $value);
         }
     }
     return $hosts;
 }
示例#2
0
 public function find($username, $start = 0, $limit = 10)
 {
     $queryBuilder = $this->manager->createQueryBuilder(Document\User::REPOSITORY);
     $queryBuilder->limit($limit)->skip($start);
     if ($username) {
         $queryBuilder->field("username") . equals($username);
     }
     return $queryBuilder->getQuery()->execute();
 }
 /**
  * @test
  */
 public function cacheFileContainsSerializedAnnotationData()
 {
     $annotations = new Annotations('someTarget');
     AnnotationCache::put($annotations);
     AnnotationCache::__shutdown();
     $data = unserialize(file_get_contents(vfsStream::url('root/annotations.cache')));
     assert($data, hasKey('someTarget'));
     assert(unserialize($data['someTarget']), equals($annotations));
 }
示例#4
0
 public static function getDefaultDomainUrl()
 {
     $urlStr = GTConfig::getProperty("gexin_default_domainurl", null);
     if ($urlStr == null || "" . equals(trim($urlStr))) {
         $hosts = array("http://sdk.open.api.igexin.com/serviceex", "http://sdk.open.api.gepush.com/serviceex", "http://sdk.open.api.getui.net/serviceex");
         for ($i = 0; $i < 3; $i++) {
             array_push($hosts, "http://sdk" . $i . ".open.api.igexin.com/serviceex");
         }
         return $hosts;
     }
     return explode(",", $urlStr);
 }
function signParams($params, $privateKey)
{
    ksort($params);
    $unencoded = $encoded = "";
    foreach ($params as $param => $value) {
        if (!equals("debug-component", $param)) {
            $unencoded .= "&" . $param . "=" . $value;
        }
        $encoded .= "&" . $param . "=" . rawurlencode($value);
    }
    $unencoded = substr($unencoded, 1);
    $encoded = substr($encoded, 1);
    return $encoded . "&signature=" . sha1($privateKey . "&" . $unencoded);
}
示例#6
0
 public function coopBuilderYResearcher()
 {
     if ($this->colaLibre($this->builder) && $this->colaLibre($this->researcher)) {
         $this->builder->escanear();
         $this->researcher->escanear();
         $objetivo = $this->researcher->buscarObjetivos($this->builder->getEdificios());
         switch ($objetivo["tipo"]) {
             case "construcción":
                 $this->builder->construirEdificio($objetivo["edificio"]);
                 if (equals($objetivo["edificio"], $GLOBALS["stringLab"])) {
                     //Si se manda construir Laboratorio de Investigación, la cola del Researcher se sincronizará
                     $this->researcher->finCola = $this->builder->finCola;
                 }
                 break;
             case "investigación":
                 $this->researcher->investigar($objetivo["investigación"]);
                 break;
         }
     }
 }
示例#7
0
 public function menu()
 {
     $menu = M("node");
     $id = $_POST["id"];
     if ($id == null || "" . equals($id)) {
         //$list=$menu->select();
         $con['level'] = array('elt', 2);
         $con['ismenu'] = 1;
         $list = $menu->where($con)->select();
         //$list=$list["0"];attributes
         //$list['info'] = 'info';
         //dump($list);
         //$this->ajaxReturn($list,"没有id",1);
         $list = json_encode($list);
         //$list.put('state','open');
         echo $list;
         //输出json数据
     } else {
         $list = $menu->where('pid=' + $id)->select();
         //$this->ajaxReturn($list,"有id",1);
     }
 }
示例#8
0
							<dd><input type="checkbox" name="banned" <?php 
    echo equals($update_user_data['banned'], true, ' checked ');
    ?>
/> <?php 
    echo lang('banned');
    ?>
</dd>
							<dd><input type="checkbox" name="moderator" <?php 
    echo equals($update_user_data['moderator'], true, ' checked ');
    ?>
/> <?php 
    echo lang('moderator');
    ?>
</dd>
							<dd><input type="checkbox" name="admin" <?php 
    echo equals($update_user_data['admin'], true, ' checked ');
    ?>
/> <?php 
    echo lang('admin');
    ?>
</dd>
						</dl>
						<dl class="input">
							<dt><?php 
    echo lang('email');
    ?>
</dt>
							<dd><input type="text" name="email" class="border" style="width: 40%" value="<?php 
    echo switchs($_POST['email'], $update_user_data['email']);
    ?>
"></dd>
示例#9
0
"><?php 
echo lang('edit_account');
?>
</a></li>
			<li><a href="<?php 
echo $config['url_path'];
?>
/users.php?a=avatar" class="<?php 
echo equals($action, "avatar", "menu-current", "menu");
?>
"><?php 
echo lang('edit_avatar');
?>
</a></li>
			<li><a href="<?php 
echo $config['url_path'];
?>
/users.php?a=profile" class="<?php 
echo equals($action, "profile", "menu-current", "menu");
?>
"><?php 
echo lang('edit_profile');
?>
</a></li>
<?php 
load_hook('user_navigation');
?>
			<div class="clear"></div>
		</ul>
		
		<div class="clear"></div>
示例#10
0
 /**
  * @test
  * @since  5.0.0
  */
 public function parseFromNonExistingSectionReturnsDefault()
 {
     assert($this->properties->parse('doesNotExist', 'rangeValue8'), equals(new Parse(null)));
 }
示例#11
0
				<dd><input type="checkbox" id="bbcode" name="bbcode" <?php 
                echo equals($config['bbcode'], true, ' checked ');
                ?>
/> <label for="bbcode"><?php 
                echo lang('allow_bbcode');
                ?>
</label></dd>
				<dd><input type="checkbox" id="bbcode_url" name="bbcode_url" <?php 
                echo equals($config['bbcode_url'], true, ' checked ');
                ?>
/> <label for="bbcode_url"><?php 
                echo lang('allow_bbcode_url');
                ?>
</label></dd>
				<dd><input type="checkbox" id="bbcode_image" name="bbcode_image" <?php 
                echo equals($config['bbcode_image'], true, ' checked ');
                ?>
/> <label for="bbcode_image"><?php 
                echo lang('allow_bbcode_img');
                ?>
</label></dd>
			</dl>
		</div>
		
		<br clear="both" />

		<h3 class="title admin"><?php 
                echo lang('message_settings');
                ?>
</h3>
		
示例#12
0
文件: test.php 项目: reoring/sabel
isTrue($id->increment);
isNull($id->default);
isFalse($id->nullable);
equals($id->max, PHP_INT_MAX);
isTrue($name->isString());
isFalse($name->primary);
isFalse($name->increment);
equals($name->default, "default name");
isTrue($name->nullable);
equals($name->max, 128);
isTrue($test->isString());
isFalse($test->primary);
isFalse($test->increment);
isNull($test->default);
isTrue($test->nullable);
equals($test->max, 255);
isTrue($body->isText());
isFalse($body->primary);
isFalse($body->increment);
isNull($body->default);
isFalse($body->nullable);
isTrue($bool->isBool());
isFalse($bool->primary);
isFalse($bool->increment);
isFalse($bool->default);
isTrue($bool->nullable);
isNull($hoge->ft);
isNull($hoge->dbl);
isNull($hoge->sint);
isNull($hoge->bint);
Sabel_Db_Connection::closeAll();
示例#13
0
 /**
  * @test
  * @since  8.1.0
  */
 public function defaultRootpathIsAlwaysTheSame()
 {
     assert(Rootpath::default(), equals(Rootpath::default()));
 }
 public function es_admin()
 {
     return $this->Nombre . equals("admin");
 }
示例#15
0
文件: profile.php 项目: KR3W/NinkoBB
    } else {
        $default = $user_data['sex'];
    }
}
?>
								<select name="gender" class="border">
									<option value="male"<?php 
echo equals($default, "male", " selected", "");
?>
>Male</option>
									<option value="female"<?php 
echo equals($default, "female", " selected", "");
?>
>Female</option>
									<option value="anonymous"<?php 
echo equals($default, "anonymous", " selected", "");
?>
>Anonymous</option>
								</select>
							</dd>
		    			</dl>
    				</td>
    			</tr>
    			<tr>
    				<td class="form">

							<dl class="input">
								<dt><?php 
echo lang('msn');
?>
</dt>
示例#16
0
<?php

require_once dirname(__FILE__) . '/KindEditorDriver.php';
$driver = new KindEditorDriver('test/dialog.html');
// drag dialog
$prevTop = intval($driver->script("return KindEditor('.ke-dialog').css('top')"));
$prevLeft = intval($driver->script("return KindEditor('.ke-dialog').css('left')"));
$driver->selector('.ke-dialog-header')->drag(100, 200);
equals(intval($driver->script("return KindEditor('.ke-dialog').css('top')")), $prevTop + 200);
equals(intval($driver->script("return KindEditor('.ke-dialog').css('left')")), $prevLeft + 100);
// close dialog
$driver->selector('.ke-dialog-icon-close')->click();
$driver->close();
示例#17
0
        <td valign="top" class="form">
            <div>
                <label for="sticky">
                    <input id="sticky" type="checkbox" name="sticky" class="border" <?php 
    echo equals($post['sticky'], true, ' checked ');
    ?>
/> 
                    <?php 
    echo lang('sticky_topic');
    ?>
                </label>
            </div>
            
            <div>
                <label for="closed">
                    <input id="closed" type="checkbox" name="closed" class="border" <?php 
    echo equals($post['closed'], true, ' checked ');
    ?>
/> 
                    <?php 
    echo lang('closed_topic');
    ?>
                </label>
            </div>
        </td>
<?php 
}
?>
    </tr>
</table>
</form>
示例#18
0
 /**
  * @param $matchs array
  * @param $matchTested array
  * @return bool
  */
 public static function matchCanBeDone($matchs, $matchTested)
 {
     foreach ($matchs as $match) {
         if ($match->getCreneau() . equals($matchTested . getCreneau())) {
             foreach ($match->getJoueursId() as $joueurId) {
                 foreach ($matchTested->getJoueursId() as $joueurTested) {
                     if ($joueurId == $joueurTested) {
                         return false;
                     }
                 }
             }
         }
     }
     return true;
 }
示例#19
0
function test()
{
    $name = 'Name';
    $gender = 'Gender';
    $studentInfo = array($name, $gender);
    $studentTbl = 'students';
    $classIdCol = 'classId';
    $classIdVal = '1';
    return select($studentInfo) . from($studentTbl) . where(equals($classIdCol, $classIdVal)) . orderBy($name);
    // should return:
    // SELECT Name, Gender FROM students WHERE classId = '1' ORDER BY Name
}
示例#20
0
 /**
  * @test
  */
 public function storeUsesDriver()
 {
     $dummyDriver = new DummyDriver();
     $image = new Image('foo', $dummyDriver, $this->handle);
     $image->store('bar');
     assert($dummyDriver->lastStoredFileName(), equals('bar'));
     assert($dummyDriver->lastStoredHandle(), isSameAs($this->handle));
 }
示例#21
0
 public function isAccountType($vs_account_type)
 {
     return $this->is_account_type . equals(vs_account_type);
 }
示例#22
0
 public function validateColumn($field, $value, array $column, Model $obj, $process = null, $isStrict = false)
 {
     $require = isset($column['require']) && (bool) $column['require'];
     $allowEmpty = isset($column['empty']) ? (bool) $column['empty'] : !$require;
     $isEmail = isset($column['email']) && (bool) $column['email'] ? true : false;
     $error = false;
     if (!empty($column['numeric'])) {
         if (!is_numeric($value)) {
             $error = [Model::ERR_NOT_NUMERIC];
         } elseif ($column['numeric'] >= 3 && !is_float($value)) {
             $error = [Model::ERR_NOT_FLOAT];
         } elseif (!empty($column['min']) && is_numeric($column['min']) && (!empty($column['max']) && is_numeric($column['max'])) && ($value < $column['min'] || $value > $column['max'])) {
             $error = [Model::ERR_NUMERIC_LESS_GREAT_THAN, 'min' => $column['min'], 'max' => $column['max']];
         } elseif (!empty($column['min']) && is_numeric($column['min']) && $value < $column['min']) {
             $error = [Model::ERR_NUMERIC_LESS_THAN, 'min' => $column['min']];
         } elseif (!empty($column['max']) && is_numeric($column['max']) && $value > $column['max']) {
             $error = [Model::ERR_NUMERIC_GREET_THAN, 'max' => $column['max']];
         }
     } else {
         $length = mb_strlen($value);
         if (!$allowEmpty && $length <= 0) {
             $error = [Model::ERR_NOT_ALLOW_EMPTY];
         } else {
             // 字符最小长度
             if ((!$allowEmpty || $length > 0) && (!empty($column['min']) && is_numeric($column['min'])) && (!empty($column['max']) && is_numeric($column['max'])) && ($length < $column['min'] || $length > $column['max'])) {
                 $error = [Model::ERR_STR_LEN_LESS_GREAT_THAN, 'min' => $column['min'], 'max' => $column['max']];
             } elseif ((!$allowEmpty || $length > 0) && (!empty($column['min']) && is_numeric($column['min'])) && $length < $column['min']) {
                 $error = [Model::ERR_STR_LEN_LESS_THAN, 'min' => $column['min']];
             } elseif ((!$allowEmpty || $length > 0) && (!empty($column['max']) && is_numeric($column['max'])) && $length > $column['max']) {
                 $error = [Model::ERR_STR_LEN_GREET_THAN, 'max' => $column['max']];
             } elseif ((!$allowEmpty || $length > 0) && $isEmail && !$this->isEmail($value, $obj, $process)) {
                 $error = [Model::ERR_NOT_EMAIL];
             } elseif ((!$allowEmpty || $length > 0) && !empty($column['pattern']) && !$this->isMatch($value, $column['pattern'], $obj, $process)) {
                 if (!empty($column['sample'])) {
                     $error = [Model::ERR_NOT_MATCH_SAMPLE, 'sample' => $column['sample']];
                 } else {
                     $error = [Model::ERR_NOT_MATCH];
                 }
             } elseif ((!$allowEmpty || $length > 0) && !empty($column['equal']) && (!isset($obj[$column['equal']]) || !equals($obj[$column['equal']], $value))) {
                 $error = [Model::ERR_NOT_EQUAL, 'equalLabel' => $obj->getLabel($column['equal'])];
             } elseif ((!$allowEmpty || $length > 0) && !empty($column['options']) && is_array($column['options']) && !empty($column['inRange']) && !isset($column['options'][$value])) {
                 $error = [Model::ERR_NOT_IN_RANGE];
             } elseif ($isStrict && !empty($column['unique']) && !$this->isUnique($value, $field, $obj, $process)) {
                 $error = [Model::ERR_DUPLICATE, 'value' => $value];
             }
         }
     }
     return $error;
 }
示例#23
0
function notCurrentlyServedUser($userInRestEmail)
{
    global $currentUserEmail;
    return !equals($currentUserEmail, $userInRestEmail);
}
示例#24
0
echo equals($action, "topics", "menu-current", "menu");
?>
"><?php 
echo lang('manage_topics');
?>
</a></li>
			<li><a href="<?php 
echo $config['url_path'];
?>
/admin.php?a=posts" class="<?php 
echo equals($action, "posts", "menu-current", "menu");
?>
"><?php 
echo lang('manage_posts');
?>
</a></li>
			<li><a href="<?php 
echo $config['url_path'];
?>
/admin.php?a=plugins" class="<?php 
echo equals($action, "plugins", "menu-current", "menu");
?>
"><?php 
echo lang('manage_plugins');
?>
</a></li>
<?php 
load_hook('admin_navigation');
?>
			<div class="clear"></div>
		</ul>
 /**
  * @test
  * @since  2.0.0
  * @group  bug213
  */
 public function validIniStringReturnsInstance()
 {
     $properties = ModifiableProperties::fromString("[foo]\nbar=baz");
     assert($properties->section('foo'), equals(['bar' => 'baz']));
 }
示例#26
0
/**
 * Inserts the title input into profile edit page
 * @global array
 * @global array
 */
function profile_nav_link($action)
{
    global $config, $user_data;
    echo '<li><a href="' . $config['url_path'] . '/plugins/titles.php?a=revisions" class="' . equals($action, "revisions", "menu-current", "menu") . '">' . lang('revisions_c') . '</a></li>';
}
	private function getSQLForLevels( $language = "<ANY>" ) {
		global $classAttributeLevels, $dataSet;

		$o = OmegaWikiAttributes::getInstance();
		// TO DO: Add support for multiple languages here
		return
			selectLatest(
				array( $dataSet->bootstrappedDefinedMeanings->definedMeaningId, $dataSet->expression->spelling ),
				array( $dataSet->definedMeaning, $dataSet->expression, $dataSet->bootstrappedDefinedMeanings ),
				array(
					'name IN (' . implodeFixed( $classAttributeLevels ) . ')',
					equals( $dataSet->definedMeaning->definedMeaningId, $dataSet->bootstrappedDefinedMeanings->definedMeaningId ),
					equals( $dataSet->definedMeaning->expressionId, $dataSet->expression->expressionId )
				)
			);
	}
 if (!function_exists('notequals')) { function notequals($a,$b) { return !equals($a, $b);  } }
	public function __construct( $definedMeaningId ) {
		$dc = wdGetDataSetContext();
		$dbr = wfGetDB( DB_SLAVE );

		global
			$wgDefaultClassMids, $dataSet;

		$queryResult = $dbr->query(
			SelectLatestDistinct(
				array(
					$dataSet->classAttributes->attributeMid,
					$dataSet->classAttributes->attributeType,
					$dataSet->bootstrappedDefinedMeanings->name
				),
				array( $dataSet->classAttributes, $dataSet->bootstrappedDefinedMeanings ),
				array(
					equals( $dataSet->classAttributes->levelMid, $dataSet->bootstrappedDefinedMeanings->definedMeaningId ),
					sqlOr(
						in( $dataSet->classAttributes->classMid,
							selectLatest(
								array( $dataSet->classMemberships->classMid ),
								array( $dataSet->classMemberships ),
								array( equals( $dataSet->classMemberships->classMemberMid, $definedMeaningId ) )
							)
						),
						inArray( $dataSet->classAttributes->classMid, $wgDefaultClassMids )
					)
				)
			)
		);

		$this->classAttributes = array();
		
		while ( $row = $dbr->fetchRow( $queryResult ) ) {
			$classAttribute = new ClassAttribute();
			$classAttribute->attributeId = $row[0];
			$classAttribute->type = $row[1];
			$classAttribute->levelName = $row[2];
			
			$this->classAttributes[] = $classAttribute;
		}
	}
示例#30
0
 /**
  * @test
  */
 public function parameterReturnsExactReflectionParameter()
 {
     assert(parameter('refParam', $this, 'example')->getName(), equals('refParam'));
 }