Apache...actory(3pm)

πŸ“¦
version 1.05 Β· 2 versions
, in debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute

πŸ’– Apache2::SiteControl::ManagerFactory πŸ’–

okay so bestie, this is a page from the User Contributed Perl Documentation, and it's giving abstract base class energy. Stay with me, it's shorter than a TikTok. πŸŽ€


✨ NAME ✨

Apache2::SiteControl::ManagerFactory β€” an abstract base class you use as a pattern for producing your own custom PermissionManagers. like, a blueprint for the thing that makes the thing. iykyk. πŸ¦‹


🌸 DESCRIPTION 🌸

so this package? it's a simple abstract base class. that's it. that's the whole vibe. πŸ‘‘

You use it as the base for creating your instances of permission managers. Here's the example straight from the source, no cap:

package MyManagerFactory;

use strict; use Apache2::SiteControl::ManagerFactory;

use base qw(Apache2::SiteControl::ManagerFactory);

our $manager;

sub getPermissionManager {
   return $manager if(defined($manager) &&
$manager->isa(Apache2::SiteControl::ManagerFactory));

   $manager = new Apache2::SiteControl::PermissionManager;

   $manager->addRule(new XYZRule);
   $manager->addRule(new SomeOtherRule);

   return $manager;
}

1;

see how it works? you subclass it, you keep a $manager around, you hand it back if it's already there and it isa the factory, otherwise you spin up a fresh Apache2::SiteControl::PermissionManager and addRule all your rules onto it. main character factory behavior fr fr. πŸ’…


🫢 SEE ALSO 🫢

  • Apache2::SiteControl::PermissionManager
  • Apache::SiteControl::Rule

go read those next, bestie, they're the whole point of this one. ✨


πŸ‘‘ AUTHOR πŸ‘‘

This module was written by Tony Kay, <tkay@uoregon.edu>. icon behavior. πŸ’œ


(the original page leaves this section empty β€” so, respectfully, nothing to report. not me staring at a blank license section πŸ’€)


and that's the whole page, bestie!! this one came from perl v5.26.2, dated 2018-08-31, brought to you by the User Contributed Perl Documentation collection. slay, go write your factory. πŸŒˆπŸ’–