public static function endWith($haystack, $needle) { if (!\UString::isEndWith($haystack, $needle)) { $haystack .= $needle; } return $haystack; }
public function actionView() { $path = $this->getPublicPath(); if (preg_match('@^asset[a-zA-Z0-9]{10}/.*$@', $path)) { $path = '/' . substr($path, 16); } $realPath = \Staq::App()->getFilePath('/public' . $path); if (empty($realPath) || is_dir($realPath) || \UString::isEndWith($realPath, '.php')) { return NULL; } $this->renderStaticFile($realPath); return TRUE; }
public function test_is_end_with__multiple_no_match() { $test = \UString::isEndWith('Ubiq is so cool', array('boring', 'classy')); $this->assertFalse($test); }
public static function isParentStack($stackable) { \UObject::doConvertToClass($stackable); return \UString::isEndWith($stackable, '\\__Parent'); }