2026/07/16

From WoozleCodes
Jump to navigation Jump to search
Thursday, July 16, 2026 (#197)
prev ⇐ Wednesday Thursday Friday

References

Main Work

Ferreteria FileSys stuff in order to support sftp in FTM

The past few days have been work on trying to integrate #phpseclib's Stream class into Ferreteria's stream-handling classes, because their SFTP class doesn't present an API for file I/O beyond sending or receiving entire files.

One conclusion: a Stream ($OStream) should not be a property of a Node but of a Fil, because it corresponds to file-data, not folder-data. ...although I see no harm in having the property available in Node but actually be a shortcut to Node->OFilOps. In general, having a controller-object provide API shortcuts to appropriate sub-objects seems like good practice.

Some complicated restructuring is needed.

  • SecLib (objA) expects Local (objB) to have an OServer property, because objA was written to wrap phpseclib's Stream class, which is specifically for phpseclib's SFTP functionality.
  • However, it doesn't make sense for objB to have an OServer, because it's for local filesystems.
  • So, what does OServer do, anyway? Well, objA uses it to get the Entry details for establishing a connection to the remote filesystem when opening a file.
  • Right now, Entry has no podlings -- but I think it's supposed to represent all possibilities for establishing a connection between the code and a filesystem.
    • It already handles e.g. public-key entry via a variant of its $OCred property. The assumption that Host and Cred objects are needed, however, remains inherent. Entry provides these objects as its main API; as is, it can't hide situations where they aren't needed.