Add SQL bridge, support functions, cron jobs, error handling, and PyPI version pinning so Python triggers match PHP capabilities. Co-authored-by: Cursor <cursoragent@cursor.com>
24 lines
669 B
PHP
24 lines
669 B
PHP
<?php
|
|
/**
|
|
* Builds Python constant assignments from SYS_PRD_BND.Constants.
|
|
*/
|
|
function getPythonConstantsDefinition() {
|
|
$constants = "";
|
|
|
|
foreach (sql("SELECT Name, Type, Value FROM SYS_PRD_BND.Constants") as $const) {
|
|
switch ($const['Type']) {
|
|
case 'String':
|
|
$val = "'" . str_replace("'", "\\'", $const['Value']) . "'";
|
|
break;
|
|
case 'Json':
|
|
$val = 'json.loads(' . json_encode($const['Value']) . ')';
|
|
break;
|
|
default:
|
|
$val = $const['Value'];
|
|
}
|
|
$constants .= "{$const['Name']} = {$val}\n";
|
|
}
|
|
|
|
return $constants;
|
|
}
|