- Added comprehensive AI Assistant system (aiassist/ directory): * Vector search and embedding capabilities * Typebot proxy integration * Elastic search functionality * Message classification and chat history * MCP proxy for external integrations - Implemented Court Status API (GetCourtStatus.php): * Real-time court document status checking * Integration with external court systems * Comprehensive error handling and logging - Enhanced S3 integration: * Improved file backup system with metadata * Batch processing capabilities * Enhanced error logging and recovery * Copy operations with URL fixing - Added Telegram contact creation API - Improved error logging across all modules - Enhanced callback system for AI responses - Extensive backup file storage with timestamps - Updated documentation and README files - File storage improvements: * Thousands of backup files with proper metadata * Fix operations for broken file references * Project-specific backup and recovery systems * Comprehensive file integrity checking Total: 26,461+ files added/modified including AWS SDK, vendor dependencies, and extensive backup system.
74 lines
2.0 KiB
PHP
74 lines
2.0 KiB
PHP
<?php
|
|
require_once dirname(dirname(dirname(__FILE__))).'/lib/limonade.php';
|
|
|
|
function configure()
|
|
{
|
|
option('env', ENV_DEVELOPMENT);
|
|
}
|
|
|
|
function before($route = array())
|
|
{
|
|
#print_r($route); exit;
|
|
#inspect the $route array, looking at various options that may have been passed in
|
|
if (@$route['options']['authenticate'])
|
|
authenticate_user() or halt("Access denied");
|
|
|
|
if (@$route['options']['validation_function'])
|
|
call_if_exists($route['options']['validation_function'], params()) or halt("Woops! Params did not pass validation");
|
|
|
|
}
|
|
|
|
function after($output, $route)
|
|
{
|
|
$time = number_format( microtime(true) - LIM_START_MICROTIME, 6);
|
|
$output .= "\n<!-- page rendered in $time sec., on ".date(DATE_RFC822)." -->\n";
|
|
$output .= "<!-- for route\n";
|
|
$output .= print_r($route, true);
|
|
$output .= "-->";
|
|
return $output;
|
|
}
|
|
|
|
# defaults work the same as always...
|
|
dispatch('/', 'hello_world');
|
|
function hello_world()
|
|
{
|
|
return "Hello world!";
|
|
}
|
|
|
|
# able to pass options to routes, which are also available in the 'before' filter in the $route argument
|
|
dispatch('/account', 'user_account',
|
|
array("authenticate" => TRUE));
|
|
function user_account()
|
|
{
|
|
return "You are authenticated (or rather, you would be if the 'authenticate_user' was real)";
|
|
}
|
|
|
|
# sometimes there param validation rules that are difficult or impossible to implement as a regex
|
|
# Here is an example of attaching a validation function to a route.
|
|
# Call this with /validate/1234 to pass, or with any other argument to fail
|
|
dispatch('/validate/*', 'validate_test',
|
|
array('validation_function' => 'a_silly_validation_function'));
|
|
function validate_test(){
|
|
return "Yup! You've passed the validation test";
|
|
}
|
|
run();
|
|
|
|
//------------------------------
|
|
// Utilities
|
|
//------------------------------
|
|
function authenticate_user()
|
|
{
|
|
//auth the user here...
|
|
return true;
|
|
}
|
|
|
|
|
|
function a_silly_validation_function($params)
|
|
{
|
|
//perhaps this looks something up in the database...
|
|
if (isset($params[0]) && $params[0] == "1234") return true;
|
|
|
|
return false;
|
|
}
|
|
|