Permalink
Browse files

MDL-37686 xmldb: Fixed coding guidelines errors in generated code

  • Loading branch information...
FMCorz committed Feb 6, 2013
1 parent 1918a24 commit a665e1b0135911ecc808cf34413f831a0d56ae94
@@ -239,22 +239,22 @@ function upgrade_savepoint_php($structure) {
switch ($plugintype ) {
case 'lib': // has own savepoint function
$result = XMLDB_LINEFEED .
- ' // Main savepoint reached' . XMLDB_LINEFEED .
+ ' // Main savepoint reached.' . XMLDB_LINEFEED .
' upgrade_main_savepoint(true, XXXXXXXXXX);' . XMLDB_LINEFEED;
break;
case 'mod': // has own savepoint function
$result = XMLDB_LINEFEED .
- ' // ' . $pluginname . ' savepoint reached' . XMLDB_LINEFEED .
+ ' // ' . ucfirst($pluginname) . ' savepoint reached.' . XMLDB_LINEFEED .
' upgrade_mod_savepoint(true, XXXXXXXXXX, ' . "'$pluginname'" . ');' . XMLDB_LINEFEED;
break;
case 'block': // has own savepoint function
$result = XMLDB_LINEFEED .
- ' // ' . $pluginname . ' savepoint reached' . XMLDB_LINEFEED .
+ ' // ' . ucfirst($pluginname) . ' savepoint reached.' . XMLDB_LINEFEED .
' upgrade_block_savepoint(true, XXXXXXXXXX, ' . "'$pluginname'" . ');' . XMLDB_LINEFEED;
break;
default: // rest of plugins
$result = XMLDB_LINEFEED .
- ' // ' . $pluginname . ' savepoint reached' . XMLDB_LINEFEED .
+ ' // ' . ucfirst($pluginname) . ' savepoint reached.' . XMLDB_LINEFEED .
' upgrade_plugin_savepoint(true, XXXXXXXXXX, ' . "'$plugintype'" . ', ' . "'$pluginname'" . ');' . XMLDB_LINEFEED;
}
return $result;
@@ -170,10 +170,10 @@ function create_table_php($structure, $table) {
// Add contents
$result .= XMLDB_LINEFEED;
- $result .= ' // Define table ' . $table->getName() . ' to be created' . XMLDB_LINEFEED;
+ $result .= ' // Define table ' . $table->getName() . ' to be created.' . XMLDB_LINEFEED;
$result .= ' $table = new xmldb_table(' . "'" . $table->getName() . "'" . ');' . XMLDB_LINEFEED;
$result .= XMLDB_LINEFEED;
- $result .= ' // Adding fields to table ' . $table->getName() . XMLDB_LINEFEED;
+ $result .= ' // Adding fields to table ' . $table->getName() . '.' . XMLDB_LINEFEED;
// Iterate over each field
foreach ($table->getFields() as $field) {
// The field header, with name
@@ -186,7 +186,7 @@ function create_table_php($structure, $table) {
// Iterate over each key
if ($keys = $table->getKeys()) {
$result .= XMLDB_LINEFEED;
- $result .= ' // Adding keys to table ' . $table->getName() . XMLDB_LINEFEED;
+ $result .= ' // Adding keys to table ' . $table->getName() . '.' . XMLDB_LINEFEED;
foreach ($keys as $key) {
// The key header, with name
$result .= ' $table->add_key(' . "'" . $key->getName() . "', ";
@@ -199,7 +199,7 @@ function create_table_php($structure, $table) {
// Iterate over each index
if ($indexes = $table->getIndexes()) {
$result .= XMLDB_LINEFEED;
- $result .= ' // Adding indexes to table ' . $table->getName() . XMLDB_LINEFEED;
+ $result .= ' // Adding indexes to table ' . $table->getName() . '.' . XMLDB_LINEFEED;
foreach ($indexes as $index) {
// The index header, with name
$result .= ' $table->add_index(' . "'" . $index->getName() . "', ";
@@ -212,7 +212,7 @@ function create_table_php($structure, $table) {
// Launch the proper DDL
$result .= XMLDB_LINEFEED;
- $result .= ' // Conditionally launch create table for ' . $table->getName() . XMLDB_LINEFEED;
+ $result .= ' // Conditionally launch create table for ' . $table->getName() . '.' . XMLDB_LINEFEED;
$result .= ' if (!$dbman->table_exists($table)) {' . XMLDB_LINEFEED;
$result .= ' $dbman->create_table($table);' . XMLDB_LINEFEED;
$result .= ' }' . XMLDB_LINEFEED;
@@ -250,12 +250,12 @@ function drop_table_php($structure, $table) {
// Add contents
$result .= XMLDB_LINEFEED;
- $result .= ' // Define table ' . $table->getName() . ' to be dropped' . XMLDB_LINEFEED;
+ $result .= ' // Define table ' . $table->getName() . ' to be dropped.' . XMLDB_LINEFEED;
$result .= ' $table = new xmldb_table(' . "'" . $table->getName() . "'" . ');' . XMLDB_LINEFEED;
// Launch the proper DDL
$result .= XMLDB_LINEFEED;
- $result .= ' // Conditionally launch drop table for ' . $table->getName() . XMLDB_LINEFEED;
+ $result .= ' // Conditionally launch drop table for ' . $table->getName() . '.' . XMLDB_LINEFEED;
$result .= ' if ($dbman->table_exists($table)) {' . XMLDB_LINEFEED;
$result .= ' $dbman->drop_table($table);' . XMLDB_LINEFEED;
$result .= ' }' . XMLDB_LINEFEED;
@@ -293,12 +293,12 @@ function rename_table_php($structure, $table) {
// Add contents
$result .= XMLDB_LINEFEED;
- $result .= ' // Define table ' . $table->getName() . ' to be renamed to NEWNAMEGOESHERE' . XMLDB_LINEFEED;
+ $result .= ' // Define table ' . $table->getName() . ' to be renamed to NEWNAMEGOESHERE.' . XMLDB_LINEFEED;
$result .= ' $table = new xmldb_table(' . "'" . $table->getName() . "'" . ');' . XMLDB_LINEFEED;
// Launch the proper DDL
$result .= XMLDB_LINEFEED;
- $result .= ' // Launch rename table for ' . $table->getName() . XMLDB_LINEFEED;
+ $result .= ' // Launch rename table for ' . $table->getName() . '.' . XMLDB_LINEFEED;
$result .= ' $dbman->rename_table($table, ' . "'NEWNAMEGOESHERE'" . ');' . XMLDB_LINEFEED;
// Add the proper upgrade_xxxx_savepoint call
Oops, something went wrong.

0 comments on commit a665e1b

Please sign in to comment.