Class information | All sources on /Servers/htdocs/test/2013/TagAndBin/server/php and sub paths | Fri 7 Nov 14 at 10:57 | ||
Key to link symbols | ![]() |
![]() |
![]() |
![]() |
Member visibility | ![]() |
![]() |
![]() |
![]() |
Other symbols | ![]() |
![]() |
![]() |
|
Highlighting | Globals | Object property(dot notation) | Objects | Functions |
Table of batch availabilities Response to ListOfAvailableBatches() | ||
![]() |
Description of criteria used to select slates | |
![]() |
Array of BatchInfo objects | |
![]() |
Optional message |
![]() ![]() |
7 | Option for ListOfAvailableBatches() |
![]() ![]() |
2 | .batchMode enumeration |
![]() ![]() |
1 | .batchMode enumeration |
![]() ![]() |
4 | .batchMode enumeration |
![]() |
When responding to NextAvailableBatch() | |
![]() |
One of the BM_ values | |
![]() |
||
![]() |
||
![]() |
||
![]() |
||
![]() |
How many available (When responding to ListOfAvailableBatches()) |
Complete batch of work being returned (Client to server) | ||
![]() |
Batch id --> BatchInfo.id | |
![]() |
one of the BM_ values | |
![]() |
? Possibly flag abandoned/cancelled | |
![]() |
Number with definite result | |
![]() |
When screener finished last sample (local time) | |
![]() |
When batch was received by client (local time) | |
![]() |
Array of SampleReturn objects | |
![]() |
Must match $samples | |
![]() |
Must match current slate | |
![]() |
When screener started first sample (local time) |
CurrentBatchForUser![]() ![]() |
$UserId $BATCHES | ||||||||||||||||||||||||||||||||||||||
EndBatch![]() ![]() |
$UserId $SessionId $BatchId $Data $BATCHES $SAMPLES $LOGS $MESSAGES $RECEIPTS | ||||||||||||||||||||||||||||||||||||||
GetBackEndVersion![]() ![]() |
() | ||||||||||||||||||||||||||||||||||||||
GetListOfAvailableSlates![]() ![]() |
$UserId=null $Modes='ALL' | ||||||||||||||||||||||||||||||||||||||
GetMOTD![]() ![]() |
() | ||||||||||||||||||||||||||||||||||||||
GetMessages![]() ![]() |
$userId $Number | ||||||||||||||||||||||||||||||||||||||
GetSlate![]() ![]() |
$SlateId | ||||||||||||||||||||||||||||||||||||||
IsUserLoggedIn![]() ![]() |
$UserId $SESSIONS | ||||||||||||||||||||||||||||||||||||||
IsValidBatch![]() ![]() |
$UserId $SessionId $BatchId $BATCHES | ||||||||||||||||||||||||||||||||||||||
IsValidSession![]() ![]() |
$UserId $SessionId $SESSIONS | ||||||||||||||||||||||||||||||||||||||
IsValidUser![]() ![]() |
$UserId $Password $USERS | ||||||||||||||||||||||||||||||||||||||
ListOfAvailableBatches![]() ![]() |
$SlateName=null $UserId=null $Modes='ALL' $BATCHES | All arguments are ignored. Anything here will be 'new' UserId and Modes are ignored. | |||||||||||||||||||||||||||||||||||||
ListReceipts![]() ![]() |
$userId $Number | ||||||||||||||||||||||||||||||||||||||
Login![]() ![]() |
$UserId $Password $LOGS $SESSIONS $USERS | This is a little complicated round the edges... 1 Check password etc. (Obviously fail if bad) 2 What to do if user is already logged-in? (ie has a session open) Send message 'already logged in' ... Make sure the USER record matches. This is the important bit as the USER keeps track of logins as well and we might have a duff reset of the USER. (Theres a lot of possible mis-matches) | |||||||||||||||||||||||||||||||||||||
Logout![]() ![]() |
$UserId $SESSIONS $BATCHES | ||||||||||||||||||||||||||||||||||||||
NextAvailableBatch![]() ![]() |
$SlateName=null $UserId=null $Modes='ALL' | ||||||||||||||||||||||||||||||||||||||
PutMessage![]() ![]() |
$UserId $Context $Message | ||||||||||||||||||||||||||||||||||||||
StartBatch![]() ![]() |
$UserId $SessionId $SlateId $Mode $BATCHES $SAMPLES | ||||||||||||||||||||||||||||||||||||||
![]() |
|
![]() |
null | Possibly specify a function for this column |
![]() |
'' | Name of field (Case sensitive) |
![]() |
'' | Text to go in heading. May be html. |
![]() |
'' | <td...../td> with ? at value-substitution point. Blank is equiv to '<td>?</td>' |
![]() |
false | Are we using this to identify records? |
Displayed![]() |
() | |
__construct![]() |
$FieldName $Heading='' $Html='<td>?</td>' $IsIndex=false $Custom=null |
![]() |
'' | HTML for update/delete buttons as applicable |
![]() |
'' | HTML for an add button if applicable |
![]() |
null | array of ColumnSpecs |
![]() |
null | Used if passed a TextFile object |
![]() |
'' | Used if raw access to textfile |
![]() |
null | specification for whole table |
![]() |
'' | Table title and heading and |
BuildFramework![]() |
() | |
CreateTR![]() |
$Record | Create the html for a row Record is an object. If none of the columns is marked as isIndex then we look in the record for a property called 'id'; |
CreateTable![]() |
$Filters=null $SortBy='' $SortUp=true | |
SetColumns![]() |
$Columns | |
SetLayout![]() |
$Layout | |
__construct![]() |
$FileNameOrObject $LayoutSpec $ColumnSpecs |
Response to Login() request | ||
![]() |
Optional MOTD etc. Line to go in BatchesListing | |
![]() |
Boolean | |
![]() |
Unique nonce or null if $ok is false | |
![]() |
As supplied |
id AUTOTIME type 'BadData','UserAct','SysFault' text | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BadDataError![]() |
$ErrorMsg | The supplied arguments are not suitable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Display![]() |
() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
OddActivityError![]() |
$ErrorMsg | Probably the user is trying to do something not permitted | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SystemFault![]() |
$ErrorMsg | There is some server error | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
UserActivity![]() |
$Msg | Everyday, normal, activity | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
__construct![]() ![]() |
() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|
|
Contains a complete message to or from user | ||
![]() |
Context text (eg ref to batch/ix to identify sampla) | |
![]() |
not yet used | |
![]() |
user id | |
![]() |
body of message | |
![]() |
UNIX timestamp (local to sender) | |
![]() |
user id |
id AutoTime from str -> user to str -> user message str use format subjecttext context str Reference to data eg sample id done boolean backId reference to previous message id | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Add![]() |
$From $To $Message $Link='' | Link has tech info about any connected data eg reference to sample | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DeleteMessage![]() |
$Id | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DeleteOldMessages![]() |
$DaysOld | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DeleteUsersMessages![]() |
$UserId | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Display![]() |
() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
History![]() |
$Id | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Journalise![]() |
() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ListUnread![]() |
$Recipient | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ListUserHistory![]() |
$UserId $Role $Limit | Role is From,To or both | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MarkDone![]() |
$Id | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reply![]() |
$Id $Message $Done=true | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
__construct![]() ![]() |
() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|
|
Information about the work done on a batch in user-readable form | ||
![]() |
Unique identifier of batch --> BatchInfo.id | |
![]() |
String date/time (Server) T/stamp for when receipt was created | |
![]() |
String date/time (Client) | |
![]() |
Unique identifier of receipt | |
![]() |
Error or 'OK thanks message' | |
![]() |
Number of samples without picks | |
![]() |
"Process", "Check" or "Practise" | |
![]() |
Number of samples offered | |
![]() |
Id or description | |
![]() |
String date/time (Client) | |
![]() |
Number 0..4 EndBatch() response (2=OK) | |
![]() |
***See Receipt object definition*** id AutoInc batchId str -> batch.id userId str -> user.id status num 0..4 (2=OK) message str started str date/time hh:mm dd-mmm-yy Client time finished str date/time hh:mm dd-mmm-yy Client time created str date/time hh:mm dd-mmm-yy Server time sampleCount num Total in batch missingCount num Number not picked - hopefully 0 slate str name of slate mode 'Select','Check' or 'Practise' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AddReceipt![]() |
$ReceiptData | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GetReceiptsForUser![]() |
$UserId $EarliestId | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
__construct![]() ![]() |
() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|
|
A single item to be examined (Server to Client) | ||
![]() |
Batch id --> BatchInfo.id | |
![]() |
Either html or a filename | |
![]() |
Not used at present | |
![]() |
Globally unique sample identifier | |
![]() |
Count within the batch 1..batch size | |
![]() |
An optional identifier that is meaningful in 'real world' eg "Mary Smith's test result-left side" | |
![]() |
Content type I=Image filename H=As-is HTML |
A single item having been examined (Client to Server) This is SampleData modified: REMOVED ADDED .reference .dwellTime .content .tagNums .type .screeners note .flags .timestamp | ||
![]() |
Batch id --> BatchInfo.id | |
![]() |
ms On screener's screen | |
![]() |
Globally unique | |
![]() |
Count within the batch 1..batch size | |
![]() |
Client local time | |
![]() |
Optional message (alert) from screener | |
![]() |
tag numbers array. Special values: Zero length array=not attempted. String=Abandoned/skipped |
id AUTOTIME batchId status U/S/P filename payload annotation optional string with external reference etc. index int 1...batch size sent timestamp received timestamp dwell milliseconds on client screen picks Array of numbers 0-19 note screenersNote | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CreateBatch![]() |
$BatchId $ArrayOfFilenames | Create a batch-load of samples given the (image) filenames | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Display![]() |
() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MarkSent![]() |
$SampleId | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
UpdatePicks![]() |
$SampleId $Dwell $Picks $Note='' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WipeBatch![]() |
$BatchId | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
__construct![]() ![]() |
() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|
|
Display![]() |
() | | id=>Required identifier | sid=>num session | slateId=>str name | mode=>int see above | uid=>str user | startTime=>int -1 = not yet | endTime=>int -1 = not yet | sent=>num how many left | doneCount=>num How many completed when batch returned | sesNonce SessionNonce valid for a user/session | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IsUserLoggedIn![]() |
$UserId | Can we find any live sessions for this user. Return null or first session id | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
NewSession![]() |
$UserId | Returns session Id of new session or false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SessionsForUser![]() |
$UserId $LiveOnly=false | Return array of matching records (or null). LiveOnly set true for only open sessions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
__construct![]() ![]() |
() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|
|
Describes a protocol for screening (Server to Client) | ||
![]() ![]() |
'classify' | Constant. Classify with 1 key (or alt+ 1 key) |
![]() ![]() |
'menu' | Constant. Triggers actions in menu.js for mode property |
![]() ![]() |
'pattern' | Fixed number of stages each for a single tag. |
![]() ![]() |
'tag' | Add 1 or more tags |
![]() ![]() |
'tree' | Multi-level classification with lower levels being greater level of detail. |
![]() |
HTML for finished screen | |
![]() |
CSS | |
![]() |
HTML for help panel | |
![]() |
Unique alpaha or numeric | |
![]() |
Longer description | |
![]() |
HTML for introductory instructions | |
![]() |
Array of SlateKeyDef objects | |
![]() |
See SM_ constants above | |
![]() |
True if allow skipping of samples AKA Don't know allowed | |
![]() |
HTML for layout of exch sample | |
![]() |
Simple, short description |
Defines a key assignment for Slate.keys array | ||
![]() |
text to appear in tips optional | |
![]() |
0-9 or 0-9 with 'a' suffix. required | |
![]() |
text to appear on grid required |
![]() |
'' | |
![]() |
'' | |
![]() |
'' | |
![]() |
'' | |
![]() |
'' |
Random access to text files (JSON) Arbitary objects. No locking! No security! No nothing! | ||
![]() ![]() |
true | |
![]() ![]() |
||
![]() |
-1 | Used to add entropy to auto incrementing using timestamp |
![]() |
0 | Autotime values are normally just current UNIX timestamp |
![]() |
'' | possible error message |
![]() |
'' | what's the name of the file |
![]() |
0 | Last read/write time by this object of file |
![]() |
false | version in memory is newer than version on disc |
![]() |
'' | Name of field being used as an Id (if any) |
![]() |
true | write after every change. If False use Flush() or unset() |
![]() |
'' | How do we deal with missing Ids for insert |
![]() |
false | We've got records |
![]() |
'' | Most recent id created |
![]() |
-1 | if auto-incrementing |
![]() |
array() | data. (Array of arraysstrings in JSON) |
![]() |
false | set true to block pending writes when doing bulk changes |
AddOneRecord![]() |
$Record | See Set(); Record is either an assoc array or an object. If an object then the public properties will be used. The id field will be set according to the normal Set() rules Returns the value of the id field. Example: | $myStructure['serial']=$table->Add($myStructure); | if($table->Error()){ print('ERROR! '.$myStructure['serial']); [T] |
Clear![]() |
() | Remove the file from disc and all records from memory. Note that subsequent changes will cause a file to be recreated. |
Collect![]() |
$ArrayOfCursors $FieldNames='' | Given an array of cursors Return a data array See GetValuesForCursor() for FieldNames and Return formats |
ColumnSet![]() |
$Cursors $FieldName $NewValue | Bulk update of records Cursors array of index pointers into records FieldName name of field to update. If it doesn't exist it will be created NewValue either a value or null if field is to be unset (No callback facility for NewValue yet) |
CreateRecord![]() |
$Data | Low-level add array of data. Return cursor. Normally use Set() |
CursorOf![]() |
$Id | Look up the cursor for the Id that matches the Index Field Return -1 if not found or error |
DeleteId![]() |
$Id | Delete the record specified by the Id. Return true if successful |
DeleteRecord![]() |
$Cursor | WARNING Not safe to be called multiple times without a re-getting of cursors. Typically use DeleteRecords() when you've got a bunch of records to delete. |
DeleteRecords![]() |
$ArrayOfCursors | Always use this when deleting multiple records |
Describe![]() |
$NoOfRecordsToList=3 | Return HTML table of fields discovered and other basic info and stats |
Error![]() |
() | Return any error from *last* call or empty string. Example | $myTable->Set($stuff); | if($myTable->Error())print('Oh noes!'); |
FindFieldMatch![]() |
$FieldNameOrIndex $LowValue $HighValue=null | Return array of cursors or null. If HighValue is omitted then this is an equality test |
FindMatching![]() |
$ArrayOfMatchCriteria | Each element of array is array of three or four values: AndOrFlag, FieldName, Low/equals. High AndOrFlag ... 'AND' or 'OR' (Ignored for 1st filter) Returns array of index pointers into records or null |
FindRecords![]() |
$CallbackFilter=null $ArgsArray=null | Select records based on some callback function If there is no callback then Return them all Return an array of cursors or null |
Flush![]() |
() | Purge anything in the buffer to disc |
GetValuesForCursor![]() |
$Cursor $FieldNames='' | Cursor is numeric index into records array FieldNames describes what fields are to be returned (a) Array (b) String with one or more fields split by commas eg 'foo,bar,fox' (c) Empty string Returns (A) empty array if nothing found (B) array of field=>value pairs (C) single value if only one field returned |
GetValuesForId![]() |
$Id $FieldNames | Id is value to match with id field given in create FieldNames See GetValuesForCursor() Empty string is all. Returns (a) empty array if nothing found (b) array of field=>value pairs (c) single value if only one field returned |
InstantGetFromFile![]() ![]() |
$Filename $IndexField $Id $FieldNames | Returns null if not found Deprecated |
InstantRecordReplace![]() ![]() |
$Filename $IndexField $Record | Instant update of a specific record Return empty string for OK or error message Deprecated |
ReadRecord![]() |
$Cursor | Cursor is just an index into the records. NOTE Any sort, insert or delete action will invalidate a previously obtained cursor. |
ResumeWrites![]() |
() | See SuspendWrites() If there are any pending changes these will be written immediately |
Set![]() |
$Records $UpdateMode='REPLACE' | Multi-record insert/update Records ........ Array of records(ie. array(array(fname=>val,fname=>val)) UpdateMode ..... (String) How to deal with unspecified existing data REPLACE ...... New record completely replaces existing UNION ........ Combine the two records FRESHEN ...... Only update existing fields in existing record Example old : name=>Fred age=>44 wife=>Mary new : name=>Fred age=>45 job=>Mechanic REPLACE : name=>Fred age=>45 job=>Mechanic UNION : name=>Fred age=>45 wife=>Mary job=>Mechanic (wife unaffected) FRESHEN : name=>Fred age=>45 wife=>Mary (job ignored) Returns an array of records - Possibly with with an id field added - With a SETRESULT field set to 'OK' or an error message string - Special case of a null array indicates an error Errors: String in ->err or empty string if all OK Each result has a SETRESULT field If any failures in records (ie any not OK) then ->err will be set |
Sort![]() |
$Fieldname $Ascending=true | Sort the table im memory. Notes (a) This will destroy cursor pointings! (b) Flush must be called if you want the results saved to disk |
SuspendWrites![]() |
() | Temporarily halt immediate writes. This is used when making batch changes. See also ResumeWrites() |
Tabulate![]() |
$Fields $Matches=null $SortField='' $SortUp=true | Returns data in a two-dimensional array Fields is an array of field names or '*' for all Matches is a array to be passed to FindMatching() or '*' for no filtering qv. SortField and SortUp are arguments for Sort() qv. |
UnionSet![]() |
$Records | See Set(); Use for updating a subset of fields without removing any unspecified eg Data : Age=40,Name=Fred,Wife=Mary Args : Age=41 Will just update age field. (Set() would remove wife/name) |
UpdateRecord![]() |
$Cursor $Data | Low-level replace record Normally use Set(). See also CreateRecord(). |
_CR![]() |
$R1 $R2 | Compare records. Called by Sort() |
_Close![]() |
() | |
_FM![]() |
$Args $Record | Args ... array of $FieldName,$LowValue,$HighValue Called by FindFieldMatch() |
_GetFreshAutoInc![]() |
() | Bump-up using a plus-one serial. |
_GetFreshAutoTime![]() |
() | Use timestamp as id but be prepared to bump-up from actual current if we've got a clash from adding a batch of records all in one go |
_GetFreshId![]() |
$InsertIdMode | We want to insert a record but we need an id for it. RAND10 ....... 10 Character random hash RAND20 ....... 20 Character random hash AUTOINC ...... Auto-increment AUTOTIME ..... Timestamp+auto-increment Return -1 if an issue |
_GetFreshRand![]() |
$Length | Return a unique id with the specified length |
_IdExists![]() |
$Id | Does the specified Id exist. See CursorOf() Outside callers would use FindFieldMatch() |
_Read![]() |
() | Load data from disc into memory ready for use |
_Write![]() |
$Force=false | if Force is true it will override (but not reset) writesSuspended flag |
__construct![]() |
$Filename $IdField='' $InsertIdMode='RAND10' $ImmediateWrites=true | Filename Complete text file path IdField Name of field to use to identify records InsertIdMode ... How to deal with Records that have blank/missing IdFields REQUIRED ..... Blank ID's not allowed RAND10 ....... 10 Character random hash(default) AUTOINC ...... Auto-increment AUTOTIME ..... Timestamp+auto-increment DISALLOW ..... Raise an error if we try to update an existing record ImmediateWrites Boolean (defaults to true) which writes after every change |
__destruct![]() |
() | We may have buffered writes. Before destroying we may need to flush it. |
id REQUIRED pwHash str currentBatch str currentSession str missing or MT string if logged-out lastLogin timestamp sessions array of pointers to sessions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AddUser![]() |
$UserId $Password | User must be new (if not Returns false) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CheckPassword![]() |
$UserId $Password | Return boolean | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DeleteUser![]() |
$UserId | Remove user from this table. NB NO checking of related tables | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Display![]() |
() | | id=>ATI | uid=>str | startTime=>int | endTime=>int | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EndSession![]() |
$UserId | Log-out user from session | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HashPw![]() |
$UserId $Password | Creat a hash from pw and user Id | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IsLoggedIn![]() |
$UserId | Return -1 if user id is bad 0 if user is not logged into a session 1 if user has a current session | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
StartSession![]() |
$UserId $SessionId | Return -1 if user id is bad 0 if OK 1 if user has a current session.(Fails! Use external handler to clean-up any open session. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
UpdatePassword![]() |
$UserId $Password | Change for existing user. New user is an error (Return false) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
__construct![]() ![]() |
() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|
|
![]() | ![]() | * Actual interfaces should extend this. * |
![]() | Specific interface methods are described in BackEndInterface.php | |
![]() | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | ***NOTE*** These are described here primarily for the purposes of documentation. These are data-only objects rather than functional classes. Incomming (ie. from client) will be assoc arrays (via JSON of course) Outgoing will be converted into plain JSON data automatically. For example a LoginResponse will be coded in PHP something like $LogResp->message = 'foo'; while a BatchReturn (from client) will be coded as $bid = $BatchRet['batchId']; Being arrays means the incomming data can be extracted() but note some data structures are nested arrays. |
![]() sesfun.php /win/Server/htdocs/vulpeculox/misc/php/dump.php NoDB1Data.php NoDB1Slate.php NoDB1Interface.php DATA_PATH : ../../../data/NoDB1/ SLATE_PATH : ../../../slates/ UNSORTED_PATH : DATA_PATH . unsorted/ ....... From POV of PHP code CLI_UNSORTED_PATH : /test/2013/TagAndBin/data/NoDB1/unsorted/ ....... From POV of *client* BATCH_PATH : DATA_PATH . batches/ SORTED_PATH : DATA_PATH . sorted/ BATCH_SIZE : 5 ALLOW_PARTIAL_BATCHES : false ....... allow smaller than standard batches? SLATE_ID : shapesbin ....... only one in this application USER_DATA : users.json ....... catalogue of users id|pw SESSION_DATA : session.json ....... currently active sessions BATCH_DATA : batch.json ....... currently active batches LOG_DATA : log.json ....... documentary record | * Uses just the file system * Method is single classification by moving files from unsorted to sorted bins * * Architecture * All code in this file. Various functions are implemented with GET argument 'action' * eg NoDB1.php?action=batchup * * Notes * This is not meant to be production-quality code | |
![]() fileTabulate.php | ![]() ![]() ![]() ![]() ![]() ![]() ![]() | * USERS, SESSIONS, BATCHES, PICKS and LOGS |
![]() ../BackEndInterface.php ../DataInterface.php ARGS_IN_GET : ΩULL ....... passed to interface methods to indicate that DATEFORMAT : D j M y H:i ....... day d mon yy hh:mm | ![]() | Note: All the public facing calls have the following structure public function Foo($A1,$A2...){ if($A1==ARGS_IN_GET){ return $this->StartBatch(Arg('A1'),Arg('A2')...); } The purpose of this is to allow the NoDB program to accept an 'Action' parameter from GET then in effect say "I can't be bothered fishing out the GETs, so you do it Foo(). I'll flag the need to do this with an out of band first arg." |
![]() | ||
![]() /win/Server/htdocs/vulpeculox/misc/php/dump.php fileUtils.php | ![]() ![]() ![]() | * File tabulation through to screen and back. * Basic CRUD eventually. For now just display. |
![]() /win/Server/htdocs/vulpeculox/misc/php/dump.php | ![]() | * File access utilities * Basic CRUD * * |
![]() EDITED : false LOG_PATH : ../../logs/ SLATES : ../../slates/ VULPECULOX_VERSION : 0.0 PHP FILE MOVE Dec13 IMPLEMENTERS_VERSION : undefined LOG_FRONTEND : true LOG_BACKEND : true | //====================================================================== // ooooo ooo .o8 // `888b. `8' "888 // 8 `88b. 8 .ooooo. .ooooo. .oooo888 .oooo.o // 8 `88b. 8 d88' `88b d88' `88b d88' `888 d88( "8 // 8 `88b.8 888ooo888 888ooo888 888 888 `"Y88b. // 8 `888 888 .o 888 .o 888 888 o. )88b // o8o `8 `Y8bod8P' `Y8bod8P' `Y8bod88P" 8""888P' // .o8 o8o . o8o // "888 `"' .o8 `"' // .ooooo. .oooo888 oooo .o888oo oooo ooo. .oo. .oooooooo // d88' `88b d88' `888 `888 888 `888 `888P"Y88b 888' `88b // 888ooo888 888 888 888 888 888 888 888 888 888 // 888 .o 888 888 888 888 . 888 888 888 `88bod8P' // `Y8bod8P' `Y8bod88P" o888o "888" o888o o888o o888o `8oooooo. // d" YD // "Y88888P' //====================================================================== | |
![]() | ?> | |
![]() | require_once('common.php'); // read the slate name and make sure it is sensible $slateName = $_GET['slate']; if(!$slateName){$slateName='welcome';} if(preg_match("/[a-z]{4,20}/i",$slateName)==0){$slateName='welcome';} // find it in the slates $fname = SLATES . $slateName . '/slate.js'; if(!file_exists($fname)){ header("HTTP/1.0 404 File $fname Not Found"); die(); } // read the data (JSON), strip comments $slateArray = file($fname); $slateText = ''; foreach($slateArray as $l){ $split = explode('//',$l); if($split[0]){$slateText .= $split[0];} } //print('<hr>'.$slateText.'<hr>'); // Decode/encode to tidy-up any json errors try{ $slateData = json_decode($slateText); $slateJson = json_encode($slateData); }catch(Exception $e) { header("HTTP/1.0 501 File $fname is faulty"); exit; } //print_r($slateData); // Read the template file and insert into the slate $fname = SLATES . $slateName . '/template.htm'; if(!file_exists($fname)){ header("HTTP/1.0 404 File $fname Not Found"); die(); } $slateData->template=file_get_contents($fname); // Read remaining optional slate files into the slate object $fname = SLATES . $slateName . '/help.htm'; if(file_exists($fname)){$slateData->help=file_get_contents($fname);} $fname = SLATES . $slateName . '/instruction.htm'; if(file_exists($fname)){$slateData->instruction=file_get_contents($fname);} $fname = SLATES . $slateName . '/completion.htm'; if(file_exists($fname)){$slateData->completion=file_get_contents($fname);} $fname = SLATES . $slateName . '/slate.css'; if(file_exists($fname)){$slateData->css=file_get_contents($fname);} // return the slate to the client send(json_encode($slateData)); ?> |