Exemplo n.º 1
0
 /**
  * Tests to get collation definition for different collations.
  */
 public function testGetDefinition()
 {
     // Get definition for utf8_unicode_ci
     $defCi = Collation::getDefinition('utf8_unicode_ci');
     $defCs = Collation::getDefinition('utf8_unicode_cs');
     $def = Collation::getDefinition('utf8_unicode');
     // Check type
     $this->assertType('string', $defCi);
     $this->assertType('string', $defCs);
     $this->assertType('string', $def);
     // Check case sensitivity
     $this->assertContains('(' . Yii::t('collation', 'ci') . ')', $defCi);
     $this->assertContains('(' . Yii::t('collation', 'cs') . ')', $defCs);
     $this->assertNotContains('(' . Yii::t('collation', 'ci') . ')', $def);
     $this->assertNotContains('(' . Yii::t('collation', 'cs') . ')', $def);
 }
Exemplo n.º 2
0
Arquivo: form.php Projeto: cebe/chive
';
	var row = $('#' + idPrefix).closest("tr").prev();
	row.attr('id', 'columns_<?php 
    echo $column->COLUMN_NAME;
    ?>
');
	row.children('td:eq(1)').html('<?php 
    echo $column->COLUMN_NAME;
    ?>
');
	row.children('td:eq(2)').html(<?php 
    echo CJSON::encode($column->COLUMN_TYPE);
    ?>
);
	row.children('td:eq(3)').html('<?php 
    echo $column->COLLATION_NAME ? '<dfn class="collation" title="' . Collation::getDefinition($column->COLLATION_NAME) . '">' . $column->COLLATION_NAME . '</dfn>' : '';
    ?>
');
	row.children('td:eq(4)').html('<?php 
    echo Yii::t('core', $column->isNullable ? 'yes' : 'no');
    ?>
');
	row.children('td:eq(5)').html(<?php 
    echo !is_null($column->COLUMN_DEFAULT) ? CJSON::encode($column->COLUMN_DEFAULT) : ($column->isNullable ? CJSON::encode('<span class="null">NULL</span>') : '\'\'');
    ?>
);
	row.children('td:eq(6)').html('<?php 
    echo $column->EXTRA;
    ?>
');
	$('#' + idPrefix).parent().slideUp(500, function() {
Exemplo n.º 3
0
    }
    ?>
					</td>
					<td>
						<?php 
    echo $table->getRowCount();
    ?>
					</td>
					<td>
						<?php 
    echo $table->ENGINE;
    ?>
					</td>
					<td>
						<dfn title="<?php 
    echo Collation::getDefinition($table->TABLE_COLLATION);
    ?>
"><?php 
    echo $table->TABLE_COLLATION;
    ?>
</dfn>
					</td>
					<td style="text-align: right">
						<?php 
    echo Formatter::fileSize($table->DATA_LENGTH + $table->INDEX_LENGTH);
    ?>
					</td>
					<td style="text-align: right">
						<?php 
    echo Formatter::fileSize($table->DATA_FREE);
    ?>
Exemplo n.º 4
0
					<td>
						<?php 
    echo $column->COLUMN_NAME;
    ?>
					</td>
					<td>
						<?php 
    echo $column->COLUMN_TYPE;
    ?>
					</td>
					<td>
						<?php 
    if (!is_null($column->COLLATION_NAME)) {
        ?>
							<dfn class="collation" title="<?php 
        echo Collation::getDefinition($column->COLLATION_NAME);
        ?>
">
								<?php 
        echo $column->COLLATION_NAME;
        ?>
							</dfn>
						<?php 
    }
    ?>
					</td>
					<td>
						<?php 
    echo Yii::t('core', strtolower($column->IS_NULLABLE));
    ?>
					</td>
Exemplo n.º 5
0
Arquivo: list.php Projeto: cebe/chive
    ?>
" />
					</td>
					<td>
						<?php 
    echo CHtml::link(CHtml::encode($model->SCHEMA_NAME), Yii::app()->createUrl('schema/' . urlencode($model->SCHEMA_NAME)));
    ?>
					</td>
					<td class="count">
						<?php 
    echo $model->tableCount;
    ?>
					</td>
					<td>
						<dfn class="collation" title="<?php 
    echo Collation::getDefinition($model->DEFAULT_COLLATION_NAME);
    ?>
">
							<?php 
    echo $model->DEFAULT_COLLATION_NAME;
    ?>
						</dfn>
					</td>
					<td>
						<?php 
    echo Html::icon('privileges', 16, true, 'core.privileges');
    ?>
					</td>
					<td>
						<?php 
    if (Yii::app()->user->privileges->checkSchema($model->SCHEMA_NAME, 'ALTER')) {
Exemplo n.º 6
0
    echo $charset['Description'];
    ?>
</th>
				</tr>
			</thead>
			<tbody>
				<?php 
    foreach ($charset['collations'] as $collation) {
        ?>
					<tr>
						<td><?php 
        echo $collation['Collation'];
        ?>
</td>
						<td><?php 
        echo Collation::getDefinition($collation['Collation'], false);
        ?>
</td>
					</tr>
				<?php 
    }
    ?>
			</tbody>
		</table>
	</div>
<?php 
}
?>

<script type="text/javascript">
breadCrumb.set([
Exemplo n.º 7
0
Arquivo: form.php Projeto: cebe/chive
<?php

CHtml::generateRandomIdPrefix();
if (!$schema->isNewRecord && $isSubmitted) {
    ?>
	<script type="text/javascript">
	var idPrefix = '<?php 
    echo CHtml::$idPrefix;
    ?>
';
	var row = $('#' + idPrefix).closest("tr").prev();
	row.find("td dfn.collation").html("<?php 
    echo $schema->DEFAULT_COLLATION_NAME;
    ?>
").attr("title", "<?php 
    echo Collation::getDefinition($schema->DEFAULT_COLLATION_NAME);
    ?>
");
	$('#' + idPrefix).parent().slideUp(500, function() {
		$('#' + idPrefix).parents("tr").remove();
	});
	Notification.add('success', '<?php 
    echo Yii::t('core', 'successEditSchema', array('{schema}' => $schema->SCHEMA_NAME));
    ?>
', null, <?php 
    echo CJSON::encode($sql);
    ?>
);
	</script>
<?php 
}