mardi 9 février 2016

Get PHP Class names of classes that extend a class?

I have a PHP Class named Plugins in which I have other plguin style PHP Classes which extend from the PLugins class.

Is there a way to get all the PHP CLass Names that extend from the Plugins class? Perhaps using something like Reflection in PHP

So in my example below, I would be able to get the values:

  • MyTestPlugin
  • AnotherTestPlugin

abstract class Plugins
{
    // class properties and methods
}


class MyTestPlugin extends PLugins
{
    // class properties and methods
}


class AnotherTestPlugin extends PLugins
{
    // class properties and methods
}





Aucun commentaire:

Enregistrer un commentaire