I have main PHP file, and dozen of less files, something like modules, they work this way (imaginary file):
if ($_GET["action"] == "login") {
require_once("login.php");
return login_something($_GET["credit"]);
}
That require_once();
and return function(data);
recur a lot in my code. It looks kinda nasty, is there no way to make this action more direct? As in (imaginary code): return require_once("login.php"):login_something($_GET["credit"]);
? Like a one-liner.
Please, don't ask why I seperate functionality of codes in different files, it's easier for me to maintain by just looking at it's name and search through robust code. Instead of scrolling 5000 lines PHP file.