예제 #1
0
파일: Plugin.php 프로젝트: jaybill/Bolts
 public static function getInstance()
 {
     if (!self::$instance instanceof self) {
         Bolts_Log::info("Creating plugin manager");
         self::$instance = new self();
     }
     return self::$instance;
 }
예제 #2
0
파일: Acl.php 프로젝트: jaybill/Bolts
 function addRoles($parent_role = null)
 {
     $roles_table = new Roles();
     //dd($roles_table->fetchImmediateChildren(2)->toArray());
     // we start this recursive funtion by looking for roles with no parent.
     if (is_null($parent_role)) {
         $roles = $roles_table->fetchParentless();
     } else {
         $roles = $roles_table->fetchImmediateChildren($parent_role);
         //dd($roles->toArray());
     }
     foreach ($roles as $role) {
         // Add the role and specifiy that as the parent. On the first pass, this is null.
         if (!$this->hasRole($role->id)) {
             Bolts_Log::info("Adding role " . $role->shortname);
             $this->addRole(new Zend_Acl_Role($role->id), $parent_role);
         }
         if (count($roles_table->fetchImmediateChildren($role->id)) > 0) {
             $this->addRoles($role->id);
         }
     }
 }