public function sort(array $ids, array $list)
    {
        $data = array();
        foreach ($ids as $key) {

            if (!isset($list[$key])) {
                return array();
            }

            $data[$key] = $list[$key]['sort'];
            foreach (array_keys($list[$key]['requires']) as $dependency) {
                if (!isset($data[$dependency])) {
                    $data[$dependency] = 0;
                }
            }
        }

        arsort($data);
        return array_keys($data);
    }