This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Basic script to perform global search on all tables of an AppGini application. | |
| * Create a new file inside the hooks folder and name it 'global-search.php' then copy this code to it. | |
| * Related post: https://forums.appgini.com/phpbb/viewtopic.php?f=2&t=1689&p=4510 | |
| */ | |
| /* Assuming this custom file is placed inside 'hooks' */ | |
| define('PREPEND_PATH', '../'); | |
| $hooks_dir = dirname(__FILE__); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function json_response($message = null, $code = 200) | |
| { | |
| // clear the old headers | |
| header_remove(); | |
| // set the actual code | |
| http_response_code($code); | |
| // set the header to make sure cache is forced | |
| header("Cache-Control: no-transform,public,max-age=300,s-maxage=900"); |