ManagerAPI::botHash PHP Method

botHash() protected method

Allow workers to get the hash of a bot file so that they know that they downloaded the file correctly
protected botHash ( )
    protected function botHash()
    {
        if (isset($_GET['userID'])) {
            $userID = $_GET['userID'];
            $s3Client = $this->loadAwsSdk()->createS3();
            if (isset($_GET['compile']) && $s3Client->doesObjectExist(COMPILE_BUCKET, "{$userID}")) {
                return array("hash" => md5($s3Client->getObject(['Bucket' => COMPILE_BUCKET, 'Key' => "{$userID}"])['Body']));
            } else {
                if (!isset($_GET['compile']) && $s3Client->doesObjectExist(BOT_BUCKET, "{$userID}")) {
                    return array("hash" => md5($s3Client->getObject(['Bucket' => BOT_BUCKET, 'Key' => "{$userID}"])['Body']));
                } else {
                    return "Bot file does not exist";
                }
            }
        }
    }