public function test_not_end_with__multiple_match() { $assertion = \UString::notEndWith('http://www.example.com/\\/', array('\\', '/')); $this->assertEquals('http://www.example.com', $assertion); }
protected function getDefaultBaseUri() { $baseUri = NULL; if (isset($_SERVER['DOCUMENT_ROOT']) && isset($_SERVER['SCRIPT_FILENAME'])) { $rootFolderPath = \UString::notEndWith($_SERVER['DOCUMENT_ROOT'], '/'); $scriptFolderPath = dirname($_SERVER['SCRIPT_FILENAME']); if (\UString::isStartWith($rootFolderPath, $scriptFolderPath)) { $baseUri = \UString::notStartWith($rootFolderPath, $scriptFolderPath); } } if (empty($baseUri)) { $baseUri = '/'; } return $baseUri; }
public static function doNotEndWith(&$haystack, $needles) { $haystack = \UString::notEndWith($haystack, $needles); }