Ferreteria/v0.5/registry/feature: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
m (3 revisions imported: moving this project here)
m (updated code)
Line 2: Line 2:
{{l/ver|Feature}} registration for non-{{l/ver|Dropin}} classes from {{l/ferreteria/code|config/portable/features.php}}:
{{l/ver|Feature}} registration for non-{{l/ver|Dropin}} classes from {{l/ferreteria/code|config/portable/features.php}}:
<syntaxhighlight lang=php>
<syntaxhighlight lang=php>
class csSetup {
use ferret\login as FL;
class csFeatureSetup {
     static public function OnSetup() {
     static public function OnSetup() {
         $oReg = FD\caFeature::FeatureClassRegistry();
         $oReg = data\caFeature::FeatureClassRegistry();
          
          
           $oReg->AddFeature(FU\account\cFeature::class);
          // user-login Features
           $oReg->AddFeature(FU\client\cFeature::class);
           $oReg->AddFeature(FL\account\cFeature::class);
           $oReg->AddFeature(FU\perm\cFeature::class);
           $oReg->AddFeature(FL\client\cFeature::class);
           $oReg->AddFeature(FU\session\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);
            
            
          $oReg->AddFeature(FDN\cFeature::class);
     }
     }
}</syntaxhighlight>
}</syntaxhighlight>


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

Revision as of 12:38, 25 May 2022

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().