protected function scanAddonDefinition($definitionFile) {
        if (!file_exists($definitionFile)) {
            throw new \Exception("missing definition file");
        }

        // Prepare addon info array
        $definition = [
            'path'      => dirname($definitionFile),
            'requires'  => []
        ];

        // Read from definition file
        $definitionData = json_decode(file_get_contents($definitionFile), true);
        if (!$definitionData) {
            throw new \Exception("failed to parse definition file");
        }
        $definition = array_merge_recursive($definition, $definitionData);

        // Check that we got everything we need
        $requiredKeys = ['name', 'description', 'author', 'version'];
        $requiredMatch = array_fill_keys($requiredKeys, null);

        $requirementCheck = array_intersect_key($definition, $requiredMatch);
        if (count($requirementCheck) < count($requiredKeys)) {
            $missing = array_diff_key($requiredMatch, $definition);
            throw new \Exception("missing definition fields (".implode(',',array_keys($missing)).")");
        }

        return $definition;
    }