1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-2"
http-equiv="content-type">
<title></title>
</head>
<body>
<b>General info</b><br>
<br>
System constist of three parts:<br>
<ol>
<li>MySQL database</li>
<li>PHP interface for
managing MySQL database</li>
<li>C languagae daemon</li>
</ol>
The main target for it is making some
actions, when some
rules are meet. Rules are actions are organized in sequences.<br>
<br>
<b>Rules</b><br>
<br>
You can give many rules in one sequence. Daemon logs into specified DB
and executes given SQL. <br>
<br>
If SQL from all rules give any (non empty) results,
actions are executed.<br>
<br>
<b>Actions</b><br>
<br>
SQL text in each action consist of two or more parts:<br>
<ol>
<li>SQL query with <i>select</i><br>
</li>
<li>optional: "{" char and SQL query with
<i>select</i><br>
</li>
<li>"{" char and action</li>
<li>optional: as many points 3 as required</li>
</ol>
System logs into first specified DB and makes SQL query (like specified
in point 1). <br>
<br>
If you have any logging details in second specified DB and <i>select</i>
after
first "{" char in SQL text, system makes specified <i>select</i> for
each
result returned from point 1<br>
<br>
Each action is done for <i>select</i> results returned from points 1
and 2.
Action can be SQL command or running program on server (can be used for
sending emails and others).<br>
<br>
If you want to force daemon to insert column number x from first select
for any action, use <i>daemon_column</i>x
(<i>daemon_column1</i> for column 1, <i>daemon_column2</i> for
column 2, etc.).
If you want to force daemon to insert column number
x from second select for any action, use <i>daemon2_column</i>x
(<i>daemon2_column1</i> for column 1, <i>daemon2_column2</i> for
column 2, etc.)<br>
<br>
If you want to run program, insert "<i>daemon_run_program
<parameter1<parameter2<</i>".<br>
<br>
<b>Actions - example 1</b><br>
<br>
<i>select txt from a where txt='wartosc'<br>
{<br>
insert into b (bzzz) values ('daemon_column1')<br>
{<br>
insert into b (bzzz) values ('2')</i><br>
<br>
System makes "<i>select txt from a where txt='wartosc</i>'" and for
each result makes<br>
<ol>
<li>"<i>insert into b (bzzz) values
('daemon_column1')</i>"
(instead of <i>daemon_column1</i> there is entered txt column
values)</li>
<li>"<i>insert into b (bzzz) values ('2')</i>"</li>
</ol>
<b>Actions - example 2</b><br>
<br>
<i>select * from a where txt='wartosc'<br>
{<br>
daemon_run_program <c:\windows\notepad.exe<d:\ala.txt<</i><br>
<br>
System makes "<i>select * from a where txt='wartosc'</i>" and for each
result
runs <i>c:\windows\notepad.exe</i> with <i>d:\ala.txt</i> parameter<br>
</body>
</html>
|