thekid/rfc — Issue #71: RFC 0071: Class / Classloader associations
Author: thekid
Created: 2011-10-09 14:52:14+00:00
State: closed
Labels: implemented, rfc

Scope of Change
====
The XP framework's core will store class / classloader associations and
provide reflective means of retrieving them.

Rationale
====
Annotations and other reflective means are broken when using the
io.cca.ArchiveClassLoader.

Functionality
====

Mapping storage
----
The existance of a key by name "classloader.{fqcn}" in the XP-registry
denotes a different classloader is used, its absence means the default
class loader was used.

lang.ClassLoader API extension
----
A new method getClassBytes() will be added to lang.ClassLoader(). It
will load a class' sourcecode when given a fully qualified classname.

lang.XPClass::detailsForClass() changes
----
Instead of loading the class bytes by file_get_contents(), the
detailsForClass() method will use the class' classloader's loadClassBytes()
method.

Additions to lang.XPClass' interface
----
A new method getClassLoader() will be added to lang.XPClass. It will
return the ClassLoader instance the class was loaded with.

The XPClass::getClassLoader() method:

```php
name))) {
$cl= &ClassLoader::getDefault();
}
return $cl;
}
?>
```

Security considerations
====
n/a

Speed impact
====
Slightly slower

Dependencies
====
n/a

Related documents
====
- http://xp-framework.net/rfc/contrib/rfc0071.diff
Patch implementing this RFC

Comments
====
- friebe, Tue Aug 22 17:24:53 CEST 2006
Set status to discussion. Use a rather small time period as this
does not break anything.