Example #1
0
 public function test_not_end_with__multiple_match()
 {
     $assertion = \UString::notEndWith('http://www.example.com/\\/', array('\\', '/'));
     $this->assertEquals('http://www.example.com', $assertion);
 }
Example #2
0
 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;
 }
Example #3
0
 public static function doNotEndWith(&$haystack, $needles)
 {
     $haystack = \UString::notEndWith($haystack, $needles);
 }