Ferreteria/v0.5/registry/feature

From Woozle Writes Code
< Ferreteria‎ | v0.5‎ | registry
Revision as of 12:38, 25 May 2022 by Woozle (talk | contribs) (updated code)
Jump to navigation Jump to search

Feature registration

Feature registration for non-Dropin classes from config/portable/features.php:

use ferret\login as FL;
class csFeatureSetup {
    static public function OnSetup() {
        $oReg = data\caFeature::FeatureClassRegistry();
        
          // user-login Features
          $oReg->AddFeature(FL\account\cFeature::class);
          $oReg->AddFeature(FL\client\cFeature::class);
          $oReg->AddFeature(FL\group\cFeature::class);
          $oReg->AddFeature(FL\permit\cFeature::class);
          $oReg->AddFeature(FL\perm\xacct\cFeature::class);
          $oReg->AddFeature(FL\session\cFeature::class);

          // node-data
          $oReg->AddFeature(data\node\cFeature::class);
          
    }
}

For an example of how to read the Feature Registry, see cDropinLink::InvokeFeature().