It's a PHP project that acts as a Front Controller for whatever APIs one may create.
It heavily works on the concept of Convention over configuration. Hence the application will have some pre-defined, reserverd query parameters. We're going to go through them. Let's assume the base_url is http:\\localhost:80
1. app or a
http:\\localhost:80?app=Xyz indicates Xyz class will be executed but its file has to be included in index.php. Since no method is passed. default_method() will be executed i.e. if it exists.
One predefined App is db
2. method or m
http:\\localhost:80?method=hello indicates hello() method will be executed. Since no class (app) is passed. DefaultApp.hello() will be executed i.e. if it exists.
Predefined methods are get, create, update, delete
3. debug
In your code call CommonUtil.debug($msg, $debugType) or CommonUtil.d($msg) to print log messages on the web page but the logs won't be visible until you add debug as the query parameter.
http:\\localhost:80?app=Xyz&method=hello&debug it will show debug messages produced by CommonUtil.debug('xyz msg', '') or CommonUtil.d('xyz msg')
http:\\localhost:80?app=Xyz&method=hello&debug-all it will show all the debug messages.
http:\\localhost:80?app=Xyz&method=hello&debug-my it will show debug messages produced by CommonUtil.debug('xyz msg', 'my'). But make an additional entry of my in GlobalConfig.php $debug_types array. debug-my can be written in many ways my_debug, debug_my, debugmy, mydebug, my-debug.
4. table or tab or t
http:\\localhost:80?app=db&m=get&table=tab-employee It will fetch all the entries from tab-employee table, given the correct db configuration is available in DBConfig.php
5. column1 or col1 or c1 and value1 or val1 or v1
http:\\localhost:80?app=db&m=get&table=tab-employee&col1=name&val1=Anurag It will fetch all the entries that have Anurg value in the name column
#TODOLIST
- valnot1 or notval1 for not equal to in where clause
- Call.php
- Logs to file must have levels