本文整理汇总了PHP中QType类的典型用法代码示例。如果您正苦于以下问题:PHP QType类的具体用法?PHP QType怎么用?PHP QType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __set
public function __set($strName, $mixValue)
{
switch ($strName) {
case '_ResizeData':
// Internal only. Do not use. Called by JS above to keep track of user selection.
try {
$data = QType::Cast($mixValue, QType::String);
$a = explode(",", $data);
$this->aryOriginalSize['width'] = $a[0];
$this->aryOriginalSize['height'] = $a[1];
$this->aryNewSize['width'] = $a[2];
$this->aryNewSize['height'] = $a[3];
// update dimensions
$this->strWidth = $this->aryNewSize['width'];
$this->strHeight = $this->aryNewSize['height'];
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
default:
try {
parent::__set($strName, $mixValue);
break;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
}
示例2: __set
public function __set($strName, $mixValue)
{
switch ($strName) {
case "Lat":
try {
return $this->fltLat = QType::Cast($mixValue, QType::Float);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "Long":
try {
return $this->fltLong = QType::Cast($mixValue, QType::Float);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
default:
try {
return parent::__set($strName, $mixValue);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
}
示例3: __set
public function __set($strName, $mixValue)
{
switch ($strName) {
case '_ResizeData':
// Internal only. Do not use. Called by qcubed.resizable to keep track of changes.
try {
$data = QType::Cast($mixValue, QType::ArrayType);
$this->aryOriginalSize = $data['originalSize'];
$this->aryNewSize = $data['size'];
// update dimensions
$this->Width = $this->aryNewSize['width'];
$this->Height = $this->aryNewSize['height'];
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
default:
try {
parent::__set($strName, $mixValue);
break;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
}
示例4: testCasting
public function testCasting()
{
define('_FAIL_', 'fail');
$cases = array(array("25.0", "25.0", (double) 25.0, QType::Float), array("25.1", "25.1", (double) 25.1, QType::Float), array(25.0, "25.0", (double) 25.0, QType::Float), array(25.1, "25.1", (double) 25.1, QType::Float), array(true, "true", _FAIL_, QType::Float), array("true", "true", _FAIL_, QType::Float), array(false, "false", _FAIL_, QType::Float), array("false", "false", _FAIL_, QType::Float), array(1, "1", (double) 1, QType::Float), array(0, "0", (double) 0, QType::Float), array("1", "1", (double) 1, QType::Float), array("0", "0", (double) 0, QType::Float), array("25", "25", (double) 25, QType::Float), array(25, "25", (double) 25, QType::Float), array(34.51666666667, "34.51666666667", (double) 34.51666666667, QType::Float), array(2147483648, "2147483648", (double) 2147483648, QType::Float), array(-2147483648, "-2147483648", (double) -2147483648, QType::Float), array(-2147483649, "-2147483649", (double) -2147483649, QType::Float), array("34.51666666667", "34.51666666667", (double) 34.51666666667, QType::Float), array("2147483648", "2147483648", (double) 2147483648.0, QType::Float), array("-2147483648", "-2147483648", (double) -2147483648.0, QType::Float), array("-2147483649", "-2147483649", (double) -2147483649.0, QType::Float), array("25.0", "25.0", _FAIL_, QType::Integer), array("25.1", "25.1", _FAIL_, QType::Integer), array(25.0, "25.0", (int) 25, QType::Integer), array(25.1, "25.1", _FAIL_, QType::Integer), array(true, "true", _FAIL_, QType::Integer), array("true", "true", _FAIL_, QType::Integer), array(false, "false", _FAIL_, QType::Integer), array("false", "false", _FAIL_, QType::Integer), array(1, "1", 1, QType::Integer), array(0, "0", 0, QType::Integer), array("1", "1", 1, QType::Integer), array("0", "0", 0, QType::Integer), array("25", "25", 25, QType::Integer), array(25, "25", 25, QType::Integer), array(34.51666666667, "34.51666666667", _FAIL_, QType::Integer), array(2147483648, "2147483648", 2147483648, QType::Integer), array(-2147483648, "-2147483648", (int) -2147483648, QType::Integer), array(-2147483649, "-2147483649", -2147483649, QType::Integer), array("34.51666666667", "34.51666666667", _FAIL_, QType::Integer), array("2147483648", "2147483648", 2147483648, QType::Integer), array("-2147483648", "-2147483648", (int) -2147483648, QType::Integer), array("-2147483649", "-2147483649", -2147483649, QType::Integer), array(1.8446744073709552E+21, "1844674407370955161616", (double) 1.8446744073709552E+21, QType::Float), array(1.8446744073709552E+21, "1844674407370955161616", "fail", QType::Integer), array("1844674407370955161616", "1844674407370955161616", "1844674407370955161616", QType::Float), array("1844674407370955161616", "1844674407370955161616", "1844674407370955161616", QType::Integer), array(6, '6', '6', QType::String), array(6.94, '6.94', '6.94', QType::String), array(0.694 * 10, '6.94', '6.94', QType::String));
foreach ($cases as $case) {
$value = (string) $case[1] . '(' . gettype($case[0]) . ')';
if ($case[2] === _FAIL_) {
try {
QType::Cast($case[0], $case[3]);
$this->fail("Excepted exception was not thrown casting " . $value . " to " . $case[3]);
} catch (QInvalidCastException $e) {
$this->pass("Casting " . $value . " to " . $case[3] . " caused a QInvalidCastException");
unset($e);
}
} else {
try {
$castValue = QType::Cast($case[0], $case[3]);
$newValue = $castValue . '(' . gettype($castValue) . ')';
$this->assertIdentical($castValue, $case[2], "{$value} cast as a " . $case[3] . " is {$newValue}");
} catch (Exception $e) {
$this->fail("Exception caused when casting {$value} to " . $case[3] . ": {$e->getMessage()}");
}
}
}
}
示例5: __set
public function __set($strName, $mixValue)
{
$this->blnModified = true;
switch ($strName) {
// APPEARANCE
case "Text":
try {
$this->strText = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "HtmlEntities":
try {
$this->blnHtmlEntities = QType::Cast($mixValue, QType::Boolean);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
default:
try {
parent::__set($strName, $mixValue);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
break;
}
}
示例6: __set
public function __set($strName, $mixValue)
{
switch ($strName) {
case "Once":
try {
return $this->blnOnce = QType::Cast($mixValue, QType::Boolean);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "Rendered":
try {
return $this->blnRendered = QType::Cast($mixValue, QType::Boolean);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "KeyCode":
try {
return $this->strKeyCode = $mixValue;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
default:
try {
return parent::__set($strName, $mixValue);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
}
示例7: __set
public function __set($strName, $mixValue)
{
$this->blnModified = true;
switch ($strName) {
case "Query":
try {
$this->strQuery = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "TotalQuery":
try {
$this->strTotalQuery = QType::Cast($mixValue, QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
default:
try {
parent::__set($strName, $mixValue);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
break;
}
}
示例8: __set
public function __set($strName, $mixValue)
{
switch ($strName) {
case '_SelectedIndex':
// Internal Only. Used by JS above. Do Not Call.
try {
$this->mixActive = QType::Cast($mixValue, QType::Integer);
// will cause ->Active getter to always return index of content item that is currently active
} catch (QInvalidCastException $objExc) {
try {
$this->mixActive = QType::Cast($mixValue, QType::Boolean);
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
break;
default:
try {
parent::__set($strName, $mixValue);
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
break;
}
}
示例9: __set
public function __set($strName, $mixValue)
{
switch ($strName) {
case "Value":
try {
return $this->strValue = QType::Cast($mixValue, QType::String);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "Text":
try {
return $this->strText = QType::Cast($mixValue, QType::String);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case "Selected":
try {
return $this->blnSelected = QType::Cast($mixValue, QType::Boolean);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
default:
try {
return parent::__set($strName, $mixValue);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
}
示例10: __set
public function __set($strName, $mixValue)
{
//$this->blnModified = true;
switch ($strName) {
case "ReadyFunction":
// The name of a javascript function to call after the CKEditor instance is ready, so that you can do further initialization
// This function will receive the formId and controlId as parameters, and "this" will be the ckeditor instance.
try {
$this->strJsReadyFunc = \QType::Cast($mixValue, \QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
break;
case "Configuration":
// The configuration string. Could be a name of an object, or a javascript object (sourrounded by braces {})
try {
$this->strConfiguration = \QType::Cast($mixValue, \QType::String);
break;
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
break;
default:
try {
parent::__set($strName, $mixValue);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
break;
}
}
示例11: ConfigureBaseProperties
/**
* Sets up the base-level configuration properties for this database,
* namely DB Profiling and Database Index
*
* @param integer $intDatabaseIndex
* @return void
*/
protected function ConfigureBaseProperties($intDatabaseIndex)
{
// Setup DatabaseIndex
$this->intDatabaseIndex = $intDatabaseIndex;
// Setup Profiling Array (if applicable)
$this->blnEnableProfiling = QType::Cast(QApplication::$ConnectionStringArray[$intDatabaseIndex]['profiling'], QType::Boolean);
if ($this->blnEnableProfiling) {
$this->strProfileArray = array();
}
}
示例12: __construct
public function __construct($strKey = null, $blnBase64 = null, $strCipher = null, $strMode = null)
{
// Get the Key
if (is_null($strKey)) {
$strKey = self::$Key;
}
// Get the Base64 Flag
try {
if (is_null($blnBase64)) {
$this->blnBase64 = QType::Cast(self::$Base64, QType::Boolean);
} else {
$this->blnBase64 = QType::Cast($blnBase64, QType::Boolean);
}
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
// Get the Cipher
if (is_null($strCipher)) {
$strCipher = self::$Cipher;
}
// Get the Mode
if (is_null($strMode)) {
$strMode = self::$Mode;
}
$this->objMcryptModule = mcrypt_module_open($strCipher, null, $strMode, null);
if (!$this->objMcryptModule) {
throw new QCryptographyException('Unable to open LibMcrypt Module');
}
// Determine IV Size
$intIvSize = mcrypt_enc_get_iv_size($this->objMcryptModule);
// Create the IV
if (self::$RandomSource != MCRYPT_RAND) {
// Ignore All Warnings
set_error_handler('QcodoHandleError', 0);
$intCurrentLevel = error_reporting();
error_reporting(0);
$strIv = mcrypt_create_iv($intIvSize, self::$RandomSource);
error_reporting($intCurrentLevel);
restore_error_handler();
// If the RandomNumGenerator didn't work, we revert back to using MCRYPT_RAND
if (strlen($strIv) != $intIvSize) {
srand();
$strIv = mcrypt_create_iv($intIvSize, MCRYPT_RAND);
}
} else {
srand();
$strIv = mcrypt_create_iv($intIvSize, MCRYPT_RAND);
}
$this->strIv = $strIv;
// Determine KeySize length
$intKeySize = mcrypt_enc_get_key_size($this->objMcryptModule);
// Create the Key Based on Key Passed In
$this->strKey = substr(md5($strKey), 0, $intKeySize);
}
示例13: ParsePostData
public function ParsePostData()
{
// Check to see if this Control's Value was passed in via the POST data
if (array_key_exists($this->strControlId, $_FILES) && $_FILES[$this->strControlId]['tmp_name']) {
// It was -- update this Control's value with the new value passed in via the POST arguments
$this->strFileName = $_FILES[$this->strControlId]['name'];
$this->strType = $_FILES[$this->strControlId]['type'];
$this->intSize = QType::Cast($_FILES[$this->strControlId]['size'], QType::Integer);
$this->strFile = $_FILES[$this->strControlId]['tmp_name'];
}
}
示例14: Initialize
private static function Initialize()
{
self::$intDbIndex = QType::Cast(self::$intDbIndex, QType::Integer);
self::$strTableName = QType::Cast(self::$strTableName, QType::String);
// If the database index exists
if (!array_key_exists(self::$intDbIndex, QApplication::$Database)) {
throw new QCallerException('No database defined at DB_CONNECTION index ' . self::$intDbIndex . '. Correct your settings in configuration.inc.php.');
}
$objDatabase = QApplication::$Database[self::$intDbIndex];
// see if the database contains a table with desired name
if (!in_array(self::$strTableName, $objDatabase->GetTables())) {
throw new QCallerException('Table ' . self::$strTableName . ' not found in database at DB_CONNECTION index ' . self::$intDbIndex . '. Correct your settings in configuration.inc.php.');
}
}
示例15: __set
public function __set($strName, $mixValue)
{
switch ($strName) {
case '_SelectedItems':
// Internal only. Do not use. Used by JS above to keep track of selections.
try {
$strItems = QType::Cast($mixValue, QType::String);
$this->arySelectedItems = explode(",", $strItems);
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
break;
case 'SelectedItems':
// Set the selected items to an array of object ids
try {
$aValues = QType::Cast($mixValue, QType::ArrayType);
$aJqIds = array();
foreach ($aValues as $val) {
$aJqIds[] = '"#' . $val . '"';
}
$strJqItems = join(',', $aJqIds);
$strJS = <<<FUNC
\t\t\t\t\t\t\tvar item = jQuery("#{$this->ControlId}");
\t\t\t\t\t\t\t
\t\t\t\t\t\t\tjQuery(".ui-selectee", item).each(function() {
\t\t\t\t\t\t\t\tjQuery(this).removeClass('ui-selected');
\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t
\t\t\t\t\t\t\tjQuery({$strJqItems}).each(function() {
\t\t\t\t\t\t\t\tjQuery(this).addClass('ui-selected');
\t\t\t\t\t\t\t});
FUNC;
$this->arySelectedItems = $aValues;
QApplication::ExecuteJavascript($strJS);
} catch (QInvalidCastException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
break;
default:
try {
parent::__set($strName, $mixValue);
break;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
}