2017 © Pedro Peláez
 

utility self-modifying-code

Runtime modification of class definitions

image

linusshops/self-modifying-code

Runtime modification of class definitions

  • Wednesday, May 10, 2017
  • by linusshops
  • Repository
  • 4 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Self Modifying Code (SMC)

Build Status, (*1)

Requires Runkit and Reflection, (*2)

SMC provides a convenient way to reload functionality while you are in a REPL or debug console., (*3)

Ever test something in the console, and realize while you're debugging what needs to be changed? Normally, you'd have to terminate the session, losing any accumulated context from your console session. SMC allows you to reload a class or method definition in mid-execution (similar to REPL environments provided by lisp and clojure)., (*4)

Due to a limitation in runkit, if you are currently executing a class, you cannot reload the whole thing. However, you can reload individual methods as well., (*5)

:fire::fire::fire::fire::fire::fire:, (*6)

This is ONLY intended to be used as a debugging aid or in a REPL environment., (*7)

If you are using this to implement functionality, you need to seriously re-evaluate your decisions., (*8)

:fire::fire::fire::fire::fire::fire:, (*9)

Installation

If runkit is not installed, install it with pecl install runkit., (*10)

Add linusshops/self-modifying-code to your composer.json., (*11)

Usage

All reload methods return a boolean indicating if SMC was able to redefine the requested identifier., (*12)

All reload methods are able to accept either a string class definition, or an instance of the class itself., (*13)

Reload a class

SMC::reload_class('SomeClassName')

Reload a class method

SMC::reload_method('SomeClassName', 'methodName')

The Versions

10/05 2017

dev-master

9999999-dev https://github.com/linusshops/self-modifying-code

Runtime modification of class definitions

  Sources   Download

MIT

The Requires

  • php ^5.0.0

 

debugging linus shops canadas motorcycle mx canada

10/05 2017

0.0.3

0.0.3.0 https://github.com/linusshops/self-modifying-code

Runtime modification of class definitions

  Sources   Download

MIT

The Requires

  • php ^5.0.0

 

debugging linus shops canadas motorcycle mx canada

16/12 2015

0.0.2

0.0.2.0 https://github.com/linusshops/self-modifying-code

Runtime modification of class definitions

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

debugging linus shops canadas motorcycle mx canada

11/12 2015

0.0.1

0.0.1.0 https://github.com/linusshops/self-modifying-code

Runtime modification of class definitions

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

debugging linus shops canadas motorcycle mx canada