original_string: public function populateEntitiesFromInstall()
      {
          if ($this->automaticallyPopulated) {
              // already run
              return;
          }
  
          foreach (scandir(BASE_PATH) as $key => $entity) {
              if ($key == "themes") {
                  continue;
              }
  
              $dir = DocumentationHelper::normalizePath(Controller::join_links(BASE_PATH, $entity));
  
              if (is_dir($dir)) {
                  // check to see if it has docs
                  $docs = Controller::join_links($dir, 'docs');
  
                  if (is_dir($docs)) {
                      $entities[] = array(
                          'Path' => $docs,
                          'Title' => DocumentationHelper::clean_page_name($entity),
                          'Version' => 'master',
                          'Branch' => 'master',
                          'Stable' => true
                      );
                  }
              }
          }
  
          Config::inst()->update(
              'DocumentationManifest',
              'register_entities',
              $entities
          );
  
          $this->automaticallyPopulated = true;
      }
code: public function populateEntitiesFromInstall()
      {
          if ($this->automaticallyPopulated) {
              // already run
              return;
          }
  
          foreach (scandir(BASE_PATH) as $key => $entity) {
              if ($key == "themes") {
                  continue;
              }
  
              $dir = DocumentationHelper::normalizePath(Controller::join_links(BASE_PATH, $entity));
  
              if (is_dir($dir)) {
                  // check to see if it has docs
                  $docs = Controller::join_links($dir, 'docs');
  
                  if (is_dir($docs)) {
                      $entities[] = array(
                          'Path' => $docs,
                          'Title' => DocumentationHelper::clean_page_name($entity),
                          'Version' => 'master',
                          'Branch' => 'master',
                          'Stable' => true
                      );
                  }
              }
          }
  
          Config::inst()->update(
              'DocumentationManifest',
              'register_entities',
              $entities
          );
  
          $this->automaticallyPopulated = true;
      }
code_tokens: public function populateEntitiesFromInstall ( ) { if ( $ this -> automaticallyPopulated ) { // already run return ; } foreach ( scandir ( BASE_PATH ) as $ key => $ entity ) { if ( $ key == "themes" ) { continue ; } $ dir = DocumentationHelper :: normalizePath ( Controller :: join_links ( BASE_PATH , $ entity ) ) ; if ( is_dir ( $ dir ) ) { // check to see if it has docs $ docs = Controller :: join_links ( $ dir , 'docs' ) ; if ( is_dir ( $ docs ) ) { $ entities [ ] = array ( 'Path' => $ docs , 'Title' => DocumentationHelper :: clean_page_name ( $ entity ) , 'Version' => 'master' , 'Branch' => 'master' , 'Stable' => true ) ; } } } Config :: inst ( ) -> update ( 'DocumentationManifest' , 'register_entities' , $ entities ) ; $ this -> automaticallyPopulated = true ; }
docstring: Scans the current installation and picks up all the SilverStripe modules
  that contain a `docs` folder.
  
  @return void
docstring_tokens: Scans the current installation and picks up all the SilverStripe modules that contain a docs folder .