Modified: trunk/Sungrazr/Server/Api.php (91 => 92)
--- trunk/Sungrazr/Server/Api.php 2007-12-17 19:50:01 UTC (rev 91)
+++ trunk/Sungrazr/Server/Api.php 2007-12-17 19:51:07 UTC (rev 92)
@@ -26,9 +26,13 @@
*
* Config keys are ...
*
- * `life`
- * : (int) The lifetime of each cache entry in seconds.
+ * `phpdoc`
+ * : (dependency) Config container for the Sungrazr_Docs_Phpdoc
+ * dependency object.
*
+ * `cache`
+ * : (array) Factory configuration for a Solar_Cache adapter.
+ *
* @var array
*
*/
@@ -149,25 +153,41 @@
foreach ($this->api[$class]['methods'] as $method => $info) {
if ($info['from'] == 'Solar_Base' ||
in_array($method, $this->_magic_methods)) {
-
unset($this->api[$class]['methods'][$method]);
-
}
}
+ // drop non-public properties, and properties from Solar_Base
foreach ($this->api[$class]['properties'] as $property => $info) {
if ($info['from'] == 'Solar_Base' || $info['access'] != 'public') {
-
- unset($this->api[$class]['properties'][$property]);
-
+ unset($this->api[$class]['properties'][$property]);
}
}
+ // remap with namespace
+ $ns = '';
+ if (! empty($namespace)) {
+ if ($namespace == 'auto') {
+ $ns = strtolower(end(explode('_', $class))) . '.';
+ } else {
+ $ns = (string) $namespace . '.';
+ }
+ }
+
+ // populate server api
+ $this->api[$class]['server_api'] = array();
+ foreach ($this->api[$class]['methods'] as $method => $info) {
+ $server_method = $ns . $method;
+ // keep track of where method originated
+ $info['callback'] = array($class, $method);
+ $this->api[$class]['server_api'][$server_method] = $info;
+ }
+
// cache result
$this->_addCachedClass($class);
-
+
+ // done!
return true;
-
}
/**