fix path
This commit is contained in:
parent
2174a497b5
commit
d3cce26fbb
2 changed files with 8 additions and 1 deletions
|
|
@ -66,6 +66,9 @@ class Database_PDOStatement extends PDOStatement implements IteratorAggregate
|
||||||
}
|
}
|
||||||
|
|
||||||
function getInt($name) {
|
function getInt($name) {
|
||||||
|
if (!$this->fields) {
|
||||||
|
throw new Error('no fields');
|
||||||
|
}
|
||||||
return (int)$this->fields[$name];
|
return (int)$this->fields[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -173,11 +173,14 @@ class Path
|
||||||
|
|
||||||
public static function makeUrl($path)
|
public static function makeUrl($path)
|
||||||
{
|
{
|
||||||
|
$slash = (isset($path['host']) && strlen($path['path'] > 0) && ($path['path'][0] != '/')) ? '/' : '';
|
||||||
|
|
||||||
return (isset($path['scheme']) ? $path['scheme'] . ':/' : '')
|
return (isset($path['scheme']) ? $path['scheme'] . ':/' : '')
|
||||||
. (isset($path['host']) ? ('/'
|
. (isset($path['host']) ? ('/'
|
||||||
. (isset($path['user']) ? $path['user'] . (isset($path['pass']) ? ':' . $path['pass'] : '') . '@' : '')
|
. (isset($path['user']) ? $path['user'] . (isset($path['pass']) ? ':' . $path['pass'] : '') . '@' : '')
|
||||||
. $path['host']
|
. $path['host']
|
||||||
. (isset($path['port']) ? ':' . $path['port'] : '')) : '')
|
. (isset($path['port']) ? ':' . $path['port'] : '')) : '')
|
||||||
|
. $slash
|
||||||
. $path['path']
|
. $path['path']
|
||||||
. (isset($path['query']) ? '?' . $path['query'] : '')
|
. (isset($path['query']) ? '?' . $path['query'] : '')
|
||||||
. (isset($path['fragment']) ? '#' . $path['fragment'] : '');
|
. (isset($path['fragment']) ? '#' . $path['fragment'] : '');
|
||||||
|
|
@ -286,6 +289,7 @@ class Path
|
||||||
$parts = new Path($file);
|
$parts = new Path($file);
|
||||||
$result [] = $parts->getParts();
|
$result [] = $parts->getParts();
|
||||||
}
|
}
|
||||||
|
|
||||||
// При обьединении ссылок можно обьеденить path, query, fragment
|
// При обьединении ссылок можно обьеденить path, query, fragment
|
||||||
$path = implode(self::SEPARATOR, self::optimize(call_user_func_array('array_merge', $result)));
|
$path = implode(self::SEPARATOR, self::optimize(call_user_func_array('array_merge', $result)));
|
||||||
$parts0->url['path'] = ($parts0->isAbsolute()) ? '/' . $path : $path;
|
$parts0->url['path'] = ($parts0->isAbsolute()) ? '/' . $path : $path;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue