The parameter $servers_for_file is available to you (which is an array of servers), you should return one of them (or return an empty array if you do not want any of them to be used).
Internally, $servers_for_file looks like this:
$servers_for_file[0] = array('url' => 'http://cdn1.com/image.jpg', 'server' => 'cdn1.com'); $servers_for_file[1] = array('url' => 'http://cdn2.net/image.jpg', 'server' => 'cdn2.net');
Eventually, you should always end your code with something like:
return $servers_for_file[$some_index];
Default behavior (pick the first server found — note that multiple servers can only be found if you're using File Conveyor), one would write:
return $servers_for_file[0];
$filename = basename($servers_for_file[0]['url']); $unique_file_id = hexdec(substr(md5($filename), 0, 5)); return $servers_for_file[$unique_file_id % count($servers_for_file)];