« Go back

##### RRphpFramework.php [v0.222 WIP] : #####
helper library to modify xml data
... with some special extensions to handle Rocrail plan and configuration files
TODO: migrate printf/echo to Vout

20240828 v0.222
  simplify arrow track handling

20240826 v0.221
  loadPlan(): add support for counters and stats

20240825 v0.220
  fix to save very huge files

20240824 v0.219
  move -arrays to framework

20240821 v0.218
  new function initMissingFileNamesWithDefaults()
  better handling of empty files on open
  improve handling modular plans with "point-" routes to module boundaries

20240818 v0.217
  add support for FIX_ST_FB_FBEVT_EMPTY

20240817 v0.216
  add support for FIX_OCC (occupancy file checks)

20240816 v0.215
  add support for FIX_LC_HOME_INVALID

20240816 v0.214
  improve handling file open
  new function RRcloseFile()

20240815 v0.213
  improve handling file open and add optional content type checking
  move openPlanfile() to here and rename to RRopenFile

20240813 v0.212
  fix validateTurntableId()

20240812 v0.211
  add support for REMOVE_BLOCK_FBS_ENTER2IN

20240812 v0.210
  add support for FIX_MISSING_ACTION : remove non existing actions

20240811 v0.209
  add support for FIX_MISSING_CONDITIONS : remove non existing locos/trains
  add support for FIX_MISSING_PERMISSION : remove non existing locos/trains
  moved some global vars here

20240728 v0.208
  new function bool2valuestring()

20240728 v0.207
  new function getCsvDups()

20240728 v0.206
  add support for FIX_BK_ST_FBEVT_EMPTY (fixes for misconfigured feedback events in block routes)

20240727 v0.205
  open file with invalid char: show line and position of error with an ascii-art arrow

20240727 v0.204
  add support for FIX_ST_MISSING_CMDTYPE

20240726 v0.203
  verbose level 3: show more option details

20240726 v0.202
  add support for FIX_BK_DEST_BLOCK_SIDE

20240725 v0.201
  new functions: getCmdType4id() RRgetNodeSgById()
  some new attributes

20240723 v0.200
  add missing attribute declarations

20240721 v0.199
  new function isCurveNr( , nr ) replaces several dedicated functions
  fix dirall function names
  add support for "curvenr 90" as "curve"

20240717 v0.198
  add support for bk with embeddedstate="true" (3x1 bk + 1x1 bk_state)

20240713 v0.197
  support for --JMRI_IMPORT_LOCOS, --JMRI_OVERWRITE_LOCOS
  add function RRgetNodeLcById()

20240710 v0.196
  add support for --jmri_roster  , --JMRI_IMPORT_FUNCDESC , --JMRI_OVERWRITE_FUNCDESC
  fix return value of RRchangeORaddNODEattr()

20240707 v0.195
  change default for DRY_RUN from FALSE to TRUE
  new options: --FIX_SW_TRAILING_CMD --noFIX_SW_TRAILING_CMD --nodry-run

20240630 v0.194
  new api function getSubnodeList
  improve api functions getSubnodeList/getSubnodeCount

20240629 v0.193
  add funtion isSgBlockstate
  add funtion arrBkSg (sg is configured in which blocks)

20240622 v0.192
  add function searchTerms

20240607 v0.191
  if file loading fails then give more details (try to show line and column)

20240603 v0.190
  rocview.ini : P_gui

20240427 v0.189
  new function homeside2string()

20240312 v0.188
  new function getDestAtScEntry()

20240310 v0.187
  support option --SHOW_OPTIONS
  use  for common texts

20240301 v0.186
  fix for isFakeDcrossing(): also check ports for 8888 an 9999

20240225 v0.185
  additional option for walker: --REPLACE_BLOCK_FB_ENTER2IN

20240224 v0.184
  additional options for walker: --UNKNOWN_OUTPUT_AS_VALID --UNKNOWN_TRACKNR_AS_VALID

20240220 v0.183
  loadPlan(): add missing attribute reads

20240218 v0.182
  improved support for issues created from modular plans

20240210 v0.181
  RRaddNodeToMap : support levelMax arrays (used by RRturn90)

20240207 v0.180
  add function: isCrossing()

20240127 v0.179
  support environment variable RR_COMPATIBLE_FAKEDCROSSING

20240125 v0.178
  add function: isFakeDcrossing()

20240121 v0.177
  RRgetNODEvalue: if requestet node attribute does not exist then try to find an attribute with same name but any case before we return the given default value

20240120 v0.176
  openXMLfile: improve error handling

20240119 v0.175
  openXMLfile/saveXMLfileFormatted : improve handling non UTF-8 encoded files

20240118 v0.174
  add functions: addLocBk2arr valSc findRoute

20240111 v0.173
  add functions to show max upload sizes

20231229 v0.172
  clean up checking for required php modules

20231226 v0.171
  fix URL_TIMER_MAX_100ms

20231226 v0.170
  rewrote and addede functions for fada,pada,mada address check and change

20231224 v0.169
  chkAcAndCond: fix counting problems and errors 
  myDomErrHandle: fix optional context array handling

20231222 v0.168
  chkSwcmdTypeCmd extended by parameter track
  check against MAX_ASPECTS_SG, MAX_TRACKS_TT, MAX_TRACKS_SELTAB

20231220 v0.167
  CTC support blocks with different sizes

20231218 v0.166
  moved array2csv() to here

20231217 v0.165
  optional parameter --checkiid

20231217 v0.164
  CTC statistics

20231209 v0.163
  CTC symbols: support overlap detection

20231202 v0.162
  valLocaIdCsvList: fix counting

20231113 v0.161
  add missing global declaration for attribute fbevent

20231111 v0.160
  add missing global declaration for attribute slaveblocks

20231106 v0.159
  add missing global declaration for attribute accnr

20231101 v0.158
  add missing global declaration for attribute smallsymbol

20231031 v0.157
  add functions to use loadPlan(), global ObjectMap and several other functions of global focus

20231020 v0.156
  openXMLfile : if unknown encoding then use UTF-8
  add functions for UTF-8

20231023 v0.155
  add function getNode4SeltabId
  add function isBkOfSeltab

20231022 v0.154
  typo fix

20231013 v0.153
  add function oriMatch( a, b )

20231011 v0.152
  moved isValidAddress() to here
  add functions isHiddenSwCX*() to detect hidden ccrossing

20231009 v0.151
  new function: isRasterDir
  chkAcAndCond: some basic checks for lc and operator
  atrribute constans for 'straight' 'curvenr' 'tknr'

20231002 v0.150
  function usepattern2string() optional parameter "aspects"

20230930 v0.149
  new function: isValidZname

20230918 v0.148
  new function: usepath2string

20230909 v0.147
  new functions: chkSwcmdTypeCmd type2string

20230826 v0.146
  init empty array SKIPVERIFY

20230823 v0.145
  change keyword detection in bkHasKeyword

20230823 v0.144
  new bk/desc keyword "skip_verify"
  moved function hasKeyword as bkHasKeyword to php-lib
  new constants for tt/track SP_track P_track

20230725 v0.143
  additonal link: URL_TIMER_MAX_100ms

20230724 v0.142
  new function arrBkStateSg

20230622 v0.141
  new function usepattern2string (sg)

20230621 v0.140
  support tracknr 101 as tunnel101
  fixed typeo in special directions

20230613 v0.139
  treat "inline-tunnel" (tracknr 1) as straight

20230611 v0.138
  moved track type checks/rewrite from walker to framework
  special directions for curvenr 100..106

20230610 v0.137
  renamed function "countAttrOccurrence" to "countAttrNonEmpty"

20230610 v0.136
  new function: creBkRtStr

20230608 v0.135
  several functions handle optional parameters with isset()

20230530 v0.134
  constant string for RT_GEN_STRING
  constant for Adesc

20230528 v0.133
  universal variable name functions: getVarName getVarTyp

20230528 v0.132
  chkBkIdCsvList: optimization

20230526 v0.131
  new function getNode4BkOrSbId

20230525 v0.130
  improved function chkSlaveBkList
  moved functions isCsvDisjunct and mergeCsvLists from walker
  new function chkBkMultSlave

20230521 v0.129
  variables and parameter handling for GENERATE_VIA_ROUTES and MAX_VIA_ROUTES

20230520 v0.128
  functions: creBkRtNoteStr creBkRtProbStr

20230518 v0.127
  constants for occ.xml : O_modocc O_modocc_occ

20230509 v0.126
  findExtBlockForTt: changed return for block ids

20230504 v0.125
  chkBkIdCsvList: additional parameters for problems and errors

20230430 v0.124
  Vout*: if first parameter is an empty string then never show line or function name
  chkBkIdCsvkList: rename to chkBkIdCsvList and reformat output also for WEB mode

20230429 v0.123
  changed init of WEB constants

20230429 v0.122
  moved WEB constants to framework

20230427 v0.121
  added validateTourId , validateTpyeId add support for location, tour and clock

20230425 v0.120
  Vout* return length of string

20230419 v0.119
  add function getSubnodeCount( node, subnode )
  add function hasSubnodes( node, subnode )

20230416 v0.118
  add action / condition validation for sw,sg,co,fb,bk,sb,system,location
  additional definition for tourentry
  add function chkCarIdCsv

20230410 v0.117
  additional definition for P_zlevel ( = P_plan_zlevel )

20230401 v0.116
  some more constants for paths ( P_ SP_ )

20230316 v0.115
  additional parameters for export
    --type -t

20230314 v0.114
  additional parameters for export
    --cars
    --operators
    --staging-blocks
    --turntables
    --seltabs

20230311 v0.113
  global arrZlevel and function isValidZlevel

20230307 v0.112
  new option: --blocks

20220228 v0.111
  optional parameter for walker:
    --ADD_FB_TO_GENERATED_ROUTES
    --ADD_FB_TO_VERIFIED_ROUTES

20230221 v0.110
  saveXMLfileFormatted with optional second parameter (save to another filename)

20230221 v0.109
  optional parameters supported (introduced for turn90):
    --LEVELS
    --planout -o (alternate filename to save)

20230124 v0.108
  condition check for st: allow wildcards

20230123 v0.107
  new function chkAcCondState

20230123 v0.106
  fix count for problems in chkAcAndCond

20230122 v0.105
  checks and reports for actions improved

20230121 v0.104
  some functions for lightctrl/light

20230121 v0.103
  new option --REMOVE_DIRECT_ROUTES

20230120 v0.102
  show more details for action control tab

20230113 v0.101
  function human_filesize

20230112 v0.100
  rename validateBkOrSbIdCsvkList to chkBkOrSbIdCsv and adjust output

20230109 v0.99
  rename validateBkIdCsvkList to chkBkIdCsvkList and adjust output

20230107 v0.98
  migrate subfunction output from echo to Vout
  rename: validateSlaveBlockIdCsvkList to chkSlaveBkList
  rename: actionAndConditionCheck to chkAcAndCond

20230105 v0.97
  fixed name for direction $Ddown_left
  handling htmlspecialchars in functions optimized : made optional parameter $HTMLENCODE=TRUE
    RRsetNODEvalue , RRchangeORaddNODEattr
    string2html , toWEB / html2string , fromWEB

20230103 v0.96
  fix error reporting in validateBkIdCsvkList()

20221230 v0.95
  RRnodeAttrExists(node, attrib) : bool

20221225 v0.94
  add MODE_ASSIGN

20221223 v0.93
  support option --SKIP_VERIFY_TT

20221218 v0.92
  add definitions for directions forward and reverse

20221217 v0.91
  sub modes for UPDATE_BLOCK_SGS : SEARCH_BK_SG_MAIN SEARCH_BK_SG_DIST

20221205 v0.90
  getXMLattr : optional param "default"

20221121 v0.89
  support additional option: --REMOVE_ALL_ROUTES

20221120 v0.88
  remove modes: MODE_UPDATE_BKFBS MODE_UPDATE_BKSGS MODE_UPDATE_BKIDS

20221117 v0.87
  support additional options: --REMOVE_BLOCK_FBS --UPDATE_BLOCK_FBS --REMOVE_BLOCK_SGS --UPDATE_BLOCK_SGS
  additional modes: MODE_UPDATE_BKFBS MODE_UPDATE_BKSGS

20221114 v0.86
  new function createXMLpathL to add a missing path element (used in createXMLnode)

20221102 v0.85
  fix error_handler for php8

20221012 v0.84
  validateScheduleId

20221008 v0.83
  toWEB string2html

20221001 v0.82
  findExtBlockForTt returns list of blocks or FALSE

20220527 v0.81
  new variable POINT_ST to force modular plan mode

20220516 v0.80
  Bugfix in RRchangeORaddNODEattr with value '0'

20220507 v0.79
  isDirall isDirAllS isDirAllC

20220503 v0.78
  new: MODE_UPDATE_BKIDS
  UPDATE_BLOCK_IDS as independent option
  some small corrections

20220501 v0.77
  new options: REMOVE_ROUTE_IDS REMOVE_BLOCK_IDS

20220427 v0.76
  moved functions from walker: isStraightArrow isCurveArrow getArrowDirexception

20220424 v0.75
  new option MAX_RT_ELEM , MAX_TRACK2_DISTANCE

20220419 v0.74
  new option VERIFY_ROUTES

20220417 v0.73
  saveXMLfileFormatted : save file with extra formatting (like pretty print)

20220417 v0.72
  RRgetNodeCoById RRgetNodeSwById

20220415 v0.71
  use MODE-variable for easier reuse of code

20220414 v0.70
  RRgetNODEvalue introduce 4th param to use if attribute does not exist and default is sent back

20220413 v0.69
  rename blockexitside2string to blockside2string

20220403 v0.68
  intermediate directions for raster switches

20220401 v0.67
  use defined constants in direction2string

20220318 v0.66
  make functions compatible with php8

20220316 v0.65
  RRgetNodeTyp()

20220315 v0.64
  define path for finder

20220221 v0.63
  RRdeleteNODE()

20220216 v0.62
  change error handling in function validateBkIdCsvkList

20220210 v0.61
  subpath 'swcmd'

20220206 v0.60
  additional params for walker : REMOVE_GENERATED , GENERATE_ROUTES ; all action params default to FALSE (not set)
  Vout5()

20220125 v0.59
  getNode4TtId
  RRgetRouteNodeById_TT_SELTAB_FIRST (temporary)

20220122 v0.58
  check if php extension 'mbstring' multi byte strings
  improved check for required modules

20220122 v0.57
  check if php extension 'xml' (read/write xml and simplexml parser) is available

20220121 v0.56
  changed defaults for ALLOW_ROUTE_ENDS_WITH_BUFFER and STRICT_HEALTH_CHECKS to FALSE

20220121 v0.55
  moved some useful functions from RRwalker to here:
    Vout*
    *2string
  optional parameters supported (mostly for walker):
    UPDATE_ROUTE_IDS
    UPDATE_BLOCK_IDS
    SKIP_ROAD_ELEMENTS
    STRICT_HEALTH_CHECKS
    ALLOW_ROUTE_ENDS_WITH_BUFFER
    SHOW_LINE_NUMBERS	(used by Vout*)

20220121 v0.54
  force functions to bool
    RRchangeSingleNODEattr
    RRchangeORaddNODEattr
    RRsetNODEvalue

20220119 v0.53
  reduced output for (fb) actions at verbose level 1

20220117 v0.52
  support special options for walker

20220115 v0.51
  switch calling parameter VERBOSE from increase level by 1 to absolute num
  --VERBOSE 

20220111 v0.50
  extend RRgetNodeByTypeAndId
  new function RRgetRouteNodeById

20220105 v0.49
  framework: support --version and --releasenotes when called directly

20220103 v0.48
  value2bool

20211230 v0.47
  RRgetNodeObjectById...
  validateTpyeId: new subtype checks : validateCarId validateOperatorId
  validateLcId validateFnId  : added 3rd param
  validateElementId: optional 3rd param (FILE)

20211228 v0.46
  add some constants used by walker

20211227 v0.45
  add missing function: validateSeltabId

20211205 v0.44
  fix syntax errors
  some constants needed for action and condition checks
  changed: RRchangeORaddNODEattr 
  new: RRisNODEattrDEFINED RRsetNODEvalue
  

20211127 v0.43
  backported functions for php7: str_contains, str_ends_with
  function str_contains_umlaut
  renamed validate functions
  added some validate functions

20211126 v0.42
  SP_linkcond
  function validateBlockIdCsvkList: extended optional attributes
  getNode4Id

20211124 v0.41
  function validateCoId

20211123 v0.40
  bugfix in RRcheckAndAdjustPlan
  actionAndConditionCheck: extended optional function parameters

20211121 v0.39
  function timeprocessing2string

20211020 v0.38
  function weekdays2string
  function blockexitside2string
  function validateScId

20211119 v0.37
  function regunits2string
  function fbtype2string

20211110 v0.36
  function convert_umlauts
  functions T_OUT_MB_0 T_OUT_MB_1
  findExtBlockForTt
  bool2string

20211109 v0.35
  path for routeropt
  function RRgetNODEvalue

20211108 v0.34
  make default filenames overwritable by library caller

20211106 v0.33
  move some functions from plan check to library

20211102 v0.32
  move some functions from plancheck to here
  some more values

20211021 v0.31
  new constants for some subpaths

20211020 v0.30
  support for ReleaseNotes

20211009 v0.29
  new constants for paths P_plan P_modplan
  new constants : Atitle , some subpaths

20211007 v0.28
  new constants for paths: rocrail_tcp

20210928 v0.27
  "attributes" start with $A ; "values" start with $V ; "paths" start with "P"
  some more defines

20210923 v0.26
  new constants for paths to lists and elements: system booster weather mv
  linklist lightctrl declist competition digint

20210920 v0.25
  new constants for paths to lists and elements: car sb operator location tour waybilllist

20210807 v0.24
  framework version info

20210607 v0.23
  new constants for paths to lists and elements: rt sc tk vr tx

20210607 v0.22
  new constants pathBKLIST pathBK pathACLIST pathAC

20210605 v0.21
  rearrange help
  special handling of function PRIVATEHELP() now supported

20210603 v0.20
  new options --changedev --lib --device

20210526 v0.19
  new constants for turntables

20210506 v0.18
  new constants pathSTLIST pathST

20210316 v0.17
  new options --setver --setpwd

20210225 v0.16
  new options: --setiid --iid
  some more constants

20210222 v0.15
  new options: --locos --feedbacks --switches --signals --outputs --skipcalc

20210216 v0.14
  error correction

20210110 v0.13
  some global values

20201117 v0.12
  some new variables and functions for data export/import
  new option "-e" "--export" to give custom csv list of attributes for export 
  new option "--dry-run" use "if( $DRY_RUN )" to use

20200624 v0.11
  new option "-w" "--web" "--html" to convert some special chars

20200624 v0.11
  when opening an xml file returns fals then reopen as DOM object and use an own error handler

20200609 v0.10
  help: explain options

20200531 v0.09
  also accept "--verbose"

20200504 v0.08
  VERBOSE option

20200408 v0.07
  catch openxmlfile errors

20200331 v0.06
  read DEBUG value from environment

20190325 v0.05
  optional variable $PRIVATEHELP
  removed option '?' (it never worked)

20170903 v0.04
  modify RRchangeORaddNODEattr to handle change of value correctly

20140503 v0.03
  add plan and module plan handling (RRcheckAndAdjustPlan)

20140427 v0.02
  changed info message for missing file

20140420 v0.01
  initial release

« Go back