Ejemplo n.º 1
0
 public static function endWith($haystack, $needle)
 {
     if (!\UString::isEndWith($haystack, $needle)) {
         $haystack .= $needle;
     }
     return $haystack;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 public function test_is_end_with__multiple_no_match()
 {
     $test = \UString::isEndWith('Ubiq is so cool', array('boring', 'classy'));
     $this->assertFalse($test);
 }
Ejemplo n.º 4
0
 public static function isParentStack($stackable)
 {
     \UObject::doConvertToClass($stackable);
     return \UString::isEndWith($stackable, '\\__Parent');
 }