Skip to content

Instantly share code, notes, and snippets.

@pguso
Forked from davedevelopment/gist:2884984
Created February 2, 2016 11:30
Show Gist options
  • Select an option

  • Save pguso/e92a0769e5c1636eb8b3 to your computer and use it in GitHub Desktop.

Select an option

Save pguso/e92a0769e5c1636eb8b3 to your computer and use it in GitHub Desktop.

Revisions

  1. Dave Marshall created this gist Jun 6, 2012.
    17 changes: 17 additions & 0 deletions gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/usr/bin/env php
    <?php
    # bin/routes

    $app = require __DIR__ . '/../app/bootstrap.php';

    $routes = $app['routes']->all();

    foreach($routes as $route) {
    $cr = new ReflectionFunction($route->getDefault('_controller'));
    echo sprintf("%s %s => %s@%d\n",
    $route->getRequirement('_method'),
    $route->getPattern(),
    str_replace(dirname(__DIR__) . '/', '', $cr->getFileName()),
    $cr->getStartLine()
    );
    }