@@ -0,0 +1,1786 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A'''%0AThis file is used to generate the dependency graph wintin Youkok2 to make it easier for the author to see%0Awhat depends on what.%0A%0AUpload stdout to http://www.webgraphviz.com%0A'''%0A%0Aimport os%0Aimport re%0A%0A%0AFILE_TEMPLATE = %22%22%22%0Adigraph G %7B%0A%3CCONTENT%3E%0A%7D%0A%22%22%22%0A%0ADI_FILE = os.path.join(%0A    os.path.dirname(os.path.abspath(__file__)),%0A    '..',%0A    'youkok2',%0A    'src',%0A    'Common',%0A    'Containers',%0A    'Services.php'%0A)%0A%0ACONTAINER_EXP = r%22new%5CW(?P%3Ccontainer%3E%5Cw*)%5C((?P%3Cgroup%3E%5B%5Cs%5CnA-Za-z%5C$%5C-%5C%3E%5C'%5C,%5C(%5C)%5C: %5D*)%5C)%5C;%22%0AINJECTION_EXP = r%22(?:get%5C(%5C'?(?P%3Cinject%3E(?:%5Cw*)%7C%5Cw*)(?:%5C:%5C:class)?%5C'?%5C))+%22%0A%0A%0Adef get_injections(injections_raw):%0A    injections = re.findall(INJECTION_EXP, injections_raw)%0A%0A    return %5B%5D if injections is None or len(injections) == 0 else injections%0A%0A%0Adef map_container(container):%0A    return %7B%0A        'name': container%5B0%5D,%0A        'injections': get_injections(container%5B1%5D)%0A    %7D%0A%0A%0Adef get_containers(content):%0A    containers_raw = re.findall(CONTAINER_EXP, content)%0A%0A    return %5Bmap_container(container) for container in containers_raw if container%5B1%5D is not None and container%5B1%5D != ''%5D%0A%0A%0Adef save_graph(containers):%0A    unrolled_graph = %5B%5D%0A%0A    for container in containers:%0A        if len(container%5B'injections'%5D) == 0:%0A            continue%0A%0A        for injection in container%5B'injections'%5D:%0A            unrolled_graph.append('    %22%7B%7D%22 -%3E %22%7B%7D%22'.format(container%5B'name'%5D, injection))%0A%0A        # For grouping the containers together%0A        unrolled_graph.append('')%0A%0A    graph = %22%5Cn%22.join(unrolled_graph)%0A%0A    output = FILE_TEMPLATE.replace('%3CCONTENT%3E', graph)%0A%0A    print(output)%0A%0A%0Adef main():%0A    with open(DI_FILE) as f:%0A        content = f.read()%0A%0A    save_graph(get_containers(content))%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add graph mics script