function __construct($underscore) { if (count($underscore->xpath('leafValues')) != 1) { trigger_error("Ill-formed Weak Classifer: no leaf values: " . $underscore->__toString()); } $this->internals = array(); $this->leaves = array(); $pieces = split_text((string) $underscore->xpath('leafValues')[0]); while (count($pieces) > 0) { $this->leaves[] = array_shift($pieces) + 0; } if (count($underscore->xpath('internalNodes')) != 1) { tigger_error("Ill-formed Weak Classifier: no internal nodes: " . $underscore->__toString()); } $pieces = split_text((string) $underscore->xpath('internalNodes')[0]); while (count($pieces) > 0) { $this->internals[] = new InternalNode($pieces); } }
private function chmod() { if (!($handle = opendir(CACHE_PATH))) { tigger_error("Cache - Could not open the cache directory for reading: " . CACHE_PATH, E_USER_ERROR); } while ($cache = readdir($handle)) { if (preg_match("#^(.+?)\\.A5\$#", $cache, $name)) { @chmod(CACHE_PATH . $cache, 0777); } } }