removed eronius comment
[ga4php.git] / doco / pseudo.txt
1 I am the pseudo code for how gaasd will work...
2
3 start:
4         am I inited?
5                 yes: load from datastore (AD, database, etc)
6                 no: tell any request returns "uninited"
7         figure out my datastore.
8
9         
10 Setup:
11         gaasd starts up with backend set to none
12         index.php, admin.php redirect to setup.php
13         setup.php asks questions (ad/in)
14         setup.php sends gaasd setup instructions
15         gaasd checks config
16         setup.php redirects to admin.php if setup works
17         
18         
19         
20 Plugins, how they work
21 so in globalLib you define a message:
22 define("MSG_STATUS", 18);
23
24 then you define a functional prefix
25 $MESSAGES[MSG_STATUS] = "gaasStatus";
26
27 then in gaasClientMessages you define gaasStatus_clientsend($params) where $params is an array of parameters in the function call
28 this returns a "vals" structure thats sent to "sent" to the server, then gaasStatus_clientrecv(..) which accepts that data back from the server
29
30 then in gaasdMessages.php you define gaasStatus_server(...) which defines a method for handling the data at the server side.
31
32 In code you then call $class->MSG_STATUS(params);
33
34
35 $params in clientsend is the arguments sent via MSG_STATUS([0], [1], ...);
36
37 $params is then played with to create a single text variable (such as a serialised data structure) and returned to the gasdclient and sent to the server
38
39 server receives what clientsend returns in _server($params) as $params.
40
41 server then returns its data via a text variable in the return which is then send back to clientrecv($params) as $params;