ChooseBaseUrl should return an index
Enforce chooseBaseUrl to return an integer index to the baseUrls member.
This commit is contained in:
parent
07673dcd38
commit
0d041c3f8a
@ -108,15 +108,15 @@ class UrlPackage extends Package
|
||||
* Determines which base URL to use for the given path.
|
||||
*
|
||||
* Override this method to change the default distribution strategy.
|
||||
* This method should always return the same base URL for a given path.
|
||||
* This method should always return the same base URL index for a given path.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return string The base URL for the given path
|
||||
* @return int The base URL index for the given path
|
||||
*/
|
||||
protected function chooseBaseUrl($path)
|
||||
{
|
||||
return fmod(hexdec(substr(hash('sha256', $path), 0, 10)), count($this->baseUrls));
|
||||
return (int) fmod(hexdec(substr(hash('sha256', $path), 0, 10)), count($this->baseUrls));
|
||||
}
|
||||
|
||||
private function getSslUrls($urls)
|
||||
|
Reference in New Issue
Block a user