|
|
@@ -0,0 +1,18 @@ |
|
|
|
(ns scan.lang.php.laravel5.scan |
|
|
|
(:require [clojure.string :as str])) |
|
|
|
|
|
|
|
(def |
|
|
|
^{} |
|
|
|
routes |
|
|
|
(fn [project-path] |
|
|
|
(let [route-file (str project-path "/routes/web.php")] |
|
|
|
(map (fn [hit] |
|
|
|
(let [[_ verb raw-params] hit |
|
|
|
params (map (fn [e] (str/trim (str/escape e {\' ""}))) (str/split raw-params #",")) |
|
|
|
[route ctl] params] |
|
|
|
{:verb verb |
|
|
|
:route route |
|
|
|
:ctl ctl})) |
|
|
|
(re-seq |
|
|
|
#"router->(.*)\((.*)\)" |
|
|
|
(slurp route-file)))))) |