public static function is_controller_class($class_name)
 {
     return StringUtils::ends_with($class_name, self::CONTROLLER_NAME_SUFFIX);
 }
Exemple #2
0
             $update_name = str_replace('stopfile_', '', $filename);
             $update_name = str_replace('.txt', '', $update_name);
             $updater_utils->record_update($update_name);
         }
     }
     $mysqli->commit();
 }
 /*
  *****   ALL UPDATES SHOULD NOW BE PLACED IN DATESTAMPED FILES IN THE version5 FOLDER   *****
  *
  *****   UPDATE FILES CAN BE CREATED BY RUNNING /updates/create_update.php
  */
 // Run individual update files
 $files = scandir($migration_path);
 foreach ($files as $file) {
     if (StringUtils::ends_with($file, '.php')) {
         include $migration_path . '/' . $file;
         $mysqli->commit();
     }
 }
 $mysqli->commit();
 /*
  *****   NOW UPDATE THE INSTALLER SCRIPT   *****
  */
 // End of updates -----------------------------------------------------------------
 // Final housekeeping activities - put all updates above this line
 $updated = $updater_utils->update_version($version, $string, $cfg_web_root);
 if ($updated !== true) {
     echo "<li class=\"error\">" . $string['couldnotwrite'] . "</li>";
 }
 $updater_utils->execute_query('FLUSH PRIVILEGES', true);
 private function field_needs_quotes($field)
 {
     $all_fields = $this->__getAllFields();
     $type = $all_fields[$field]["type"];
     if (StringUtils::ends_with($type, "text") || StringUtils::starts_with($type, "varchar") || StringUtils::starts_with($type, "date") || StringUtils::starts_with($type, "time")) {
         return true;
     } else {
         return false;
     }
 }
 /**
  * Set the full marks tolerance for the question
  * @param unknown_type $value
  */
 private function set_tolerance_value($value, $type_string, &$val_target, &$type_target)
 {
     if (StringUtils::ends_with($value, '%')) {
         $val = rtrim($value, '%');
         $type = '%';
     } else {
         $val = $value;
         $type = '#';
     }
     if ($val != $val_target or $type != $type_target) {
         $old_type = $type_target == '#' ? '' : $type_target;
         $type_target = $type;
         $this->set_modified_field($type_string, $val_target . $old_type);
         $val_target = $val;
     }
 }
Exemple #5
0
 function testEndsWith()
 {
     $this->assertTrue(StringUtils::ends_with("ProvaDiRegistrazione", "Registrazione"), "Il controllo di fine stringa non e' corretto!!");
     $this->assertFalse(StringUtils::ends_with("ProvaDiRegistrazione", "zionerr"), "Il controllo di fine stringa non e' corretto!!");
     $this->assertFalse(StringUtils::ends_with("ProvaDiRegistrazione", "Prova"), "Il controllo di fine stringa non e' corretto!!");
 }