本文整理汇总了PHP中StringUtils::ends_with方法的典型用法代码示例。如果您正苦于以下问题:PHP StringUtils::ends_with方法的具体用法?PHP StringUtils::ends_with怎么用?PHP StringUtils::ends_with使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringUtils
的用法示例。
在下文中一共展示了StringUtils::ends_with方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: is_controller_class
public static function is_controller_class($class_name)
{
return StringUtils::ends_with($class_name, self::CONTROLLER_NAME_SUFFIX);
}
示例2: str_replace
$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);
示例3: field_needs_quotes
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;
}
}
示例4: set_tolerance_value
/**
* 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;
}
}
示例5: testEndsWith
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!!");
}