Version 2 (modified by moo, 14 years ago) (diff)


The Scripting Way

Stick with the Scripting Way even if you're writing php extension(s).

Many of us (and i) was thinking about how to write more powerful php extension hardly, once after we get how to write it. But don't you think it's more important to notice what we need/want instead of what we can do? Do not write to write.

XCache use extension+scripting way to do complex thing nicely.

  • XCache Administration
    • XcacheApi to collect list/information from the shared memory.
    • A script to display the information.
  • Coverage Dumper and Viewer
    • A dumper to dump coverage data to file.
      • TheScriptingWay: Provide APIs to get coverage data, and let the script to dump data. (slow, not in XCache)
      • non-[TheScriptingWay]: Dump data by XCache itself, controling by ini settings. (fast, the way XCache is using)
    • A viewer script to show data nicely.
      • APIs to load/decode data from cov-datafiles. (fast)
      • Script to render result. (nice)
  • Disassembler and Decompiler
    • APIs to dump opcode data into php arrays for script.
    • Script to play arround the arrays. (easier to write)

See also: DevelModuleList

FYI: ea/mmcache use plain C to do administration/disassembling, but ea rewrote it in TheScriptingWay after zoeloelip study my XCache :) We learn from each other. And YES, it's much better to maintain code in php than in C.