Beispiel #1
0
 /**
  * Default constructor for directory base
  * @param string $path
  */
 function __construct($path)
 {
     if (!Str::endsWith($path, '/')) {
         $path .= '/';
     }
     if (!Str::startsWith($path, '/')) {
         $path = '/' . $path;
     }
     $cwd = getcwd();
     if (strpos($path, $cwd) === false) {
         $path = $cwd . $path;
     }
     $path = Str::flipDS($path);
     $this->path = $path;
 }
Beispiel #2
0
 function testStartEndsWith()
 {
     $str = 'hello world';
     $this->assertTrue(\qtil\StringUtil::startsWith($str, 'hello'));
     $this->assertTrue(\qtil\StringUtil::endsWith($str, 'world'));
 }