src/ImboClient/ImboClient.php
private function getHostForImageIdentifier($imageIdentifier) {
        $dec = ord(substr($imageIdentifier, -1));

        // If this is an old image identifier (32 character hex string),
        // maintain backwards compatibility
        if (preg_match('#^[a-f0-9]{32}$#', $imageIdentifier)) {
            $dec = hexdec($imageIdentifier[0] . $imageIdentifier[1]);
        }

        return $this->serverUrls[$dec % count($this->serverUrls)];
    }
private function getHostForImageIdentifier($imageIdentifier) {
        $dec = ord(substr($imageIdentifier, -1));

        // If this is an old image identifier (32 character hex string),
        // maintain backwards compatibility
        if (preg_match('#^[a-f0-9]{32}$#', $imageIdentifier)) {
            $dec = hexdec($imageIdentifier[0] . $imageIdentifier[1]);
        }

        return $this->serverUrls[$dec % count($this->serverUrls)];
    }
private function getHostForImageIdentifier ( $ imageIdentifier ) { $ dec = ord ( substr ( $ imageIdentifier , - 1 ) ) ; // If this is an old image identifier (32 character hex string), // maintain backwards compatibility if ( preg_match ( '#^[a-f0-9]{32}$#' , $ imageIdentifier ) ) { $ dec = hexdec ( $ imageIdentifier [ 0 ] . $ imageIdentifier [ 1 ] ) ; } return $ this -> serverUrls [ $ dec % count ( $ this -> serverUrls ) ] ; }
Get a predictable hostname for the given image identifier

@param string $imageIdentifier The image identifier
@return string
Get a predictable hostname for the given image identifier