Skip to content

HotPatch

PeratX edited this page May 9, 2020 · 1 revision

Module HotPatch

sf.json Format

{
  "name": "Example",
  "version": "1.0",
  "api": 6,
  "description": "Just an example",
  "author": "iTX Technologies",
  "main": "Example\\Main",
  "website": "https://itxtech.org",
  "dependency": [
    {
      "name": "Example/ExampleModule",
      "version": "1.0.0",
      "optional": true
    }
  ],
  "hotPatch": [
    {
      "class": "Example\\Main",
      "method": "foo"
    }
  ]
}

Method need to be patched

//only support this code style!
public function foo(string $arg0, int $arg1) : int{
    echo $arg0;
    return $arg1++;
}

Command to run

> module hotpatch Example

HotPatch for Example took 0.001 s
Clone this wiki locally