2026/03/18

From Woozle Writes Code
< 2026‎ | 03
Jump to navigation Jump to search
Wednesday, March 18, 2026 (#77)
Tuesday Wednesday Thursday posts:prev <this> next

References

  • 08:26 Actually, I don't think we ever want DoCommand() to close the process, since its I/O is no longer being processed there.
    • It seems asymmetrical to have DoCommand() open the process without closing it, though. Can we open it beforehand? Or is this actually not a problem?
      • The current paradigm of opening it and then returning the Runner-object for processing and closing is, I think, a solution I came up with earlier. Maybe it's fine?
        • I think it has to be -- because we don't have direct access to the Runner-object until DoCommand() returns anyway.
  • 08:57 {local and remote} {schema-listings and exports} working
  • 11:18 Apparently if you pass an object to a function, which then modifies it, the original object is not modified. You have to pass it by reference.
    • The documentation seems to contradict this: «In PHP, an object variable doesn't contain the object itself as value. It only contains an object identifier which allows object accessors to find the actual object. When an object is sent by argument, returned or assigned to another variable, the different variables are not aliases: they hold a copy of the identifier, which points to the same object.» – but in actuality, I had to prefix the argument-name with & in order for an in-function change to propagate back to the caller's version of the passed variable.

Caller code:

  • $oCmdSvr->DoCommand($oCmd)
    • The test code in the next line: $oCmd->QORunner()->HasIt()

Called function definition (the function sets $oCmd->QORunner() so HasIt() will return TRUE):

  • function DoCommand(CLineIface $oCmd) : OpCmdIface - test-code says FALSE
  • function DoCommand(CLineIface &$oCmd) : OpCmdIface - test-code says TRUE

Future test: actually check the object ID at all 3 points (before, inside, and after) -- as well as the ID for the QORunner() object. That should help determine exactly what is happening, and therefore where the documentation should be clarified or corrected.

  • 19:32 We now get as far as diving into the I/O loop, but it gets stuck there and nothing seems to be happening -- so I need to put in some debugging output...
  • 20:49 It's getting stuck reading the process's Lecturer stream. Hm, is that still getting set to non-blocking? It's certainly acting like it's blocking...