return str_replace(join($ds, $parts), $ds . '[***]', $path); } /** * GET arguments settings */ $arg_ln = isset($_GET['ln']) ? $_GET['ln'] : 'en'; function getPhpClassManualLink($class_name, $ln = 'en') { return sprintf('http://php.net/manual/%s/class.%s.php', $ln, strtolower($class_name)); } if (file_exists($a = __DIR__ . '/../vendor/autoload.php')) { require_once $a; } else { die('You need to run Composer on your project to use this interface!'); } $repo = !empty($_GET) && isset($_GET['repo']) ? $_GET['repo'] : \Library\Helper\Url::resolvePath(__DIR__ . '/..', true); // ----------------------------------- // Page Content // ----------------------------------- ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Test & documentation of PHP "git-api" package</title> <meta name="description" content="A set of PHP classes to crypt and uncrypt" /> <!-- Bootstrap --> <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"> <!-- Font Awesome -->
/** * @covers ../../../src/Library/Helper/Url::resolveHttp() * @covers ../../../src/Library/Helper/Url::resolvePath() */ public function testResolvers() { $this->checkNoArg('resolveHttp'); $url = 'domain.com/index.php?param=A¶m1=test1¶m2=test2'; $this->assertEquals('http://' . $url, \Library\Helper\Url::resolveHttp($url)); $this->assertEquals('http://' . $url, \Library\Helper\Url::resolveHttp('http://' . $url)); $this->checkNoArg('resolvePath'); $path = 'my/path/../to/./a/file'; $realpath = 'my/to/a/file'; $this->assertEquals($realpath, \Library\Helper\Url::resolvePath($path)); }
protected function _find() { if ($this->isInited()) { return; } $this->reset(); foreach ($this->directories as $dir) { $this->_findByDirectory(UrlHelper::resolvePath($dir)); } $this->setInited(true); }