<commit_before><?php

/**
* Class to manage theme of pfc
* @author <NAME> <<EMAIL>>
*/

class themes{
    var $dir_themes; // directory of themes


    
    function themes(){
       $this->dir_themes = dirname(__FILE__)."/../themes/";
    }

    /**
    * Get the list of themes
    * @return array $themes_list
    */
    function getThemesList(){
       $i=0;
       $dir = opendir($this->dir_themes);
       while ($f = readdir($dir)) {
         if(is_dir($this->dir_themes.$f) && $f!="." && $f!="..") {
            $themes_list[$i] = $f;
            $i++;
          }
       }
       
       if($i>0)
         return $themes_list;
       else
         return 0;
    }
    
    /**
    * Get the Author of a theme
    * @param string $theme
    * @return string $author
    */
    function getThemeAuthor($theme){
       if(file_exists($this->dir_themes.$theme."/info.php")){<commit_msg>Add a test for themes directory listing<commit_after><?php

/**
* Class to manage theme of pfc
* @author <NAME> <<EMAIL>>
*/

class themes{
    var $dir_themes; // directory of themes


    
    function themes(){
       $this->dir_themes = dirname(__FILE__)."/../themes/";
    }

    /**
    * Get the list of themes
    * @return array $themes_list
    */
    function getThemesList(){
       $i=0;
       $dir = opendir($this->dir_themes);
       while ($f = readdir($dir)) {
         if(is_dir($this->dir_themes.$f) && $f!="." && $f!=".." && strpos($f,".")===false) {
            $themes_list[$i] = $f;
            $i++;
          }
       }
       
       if($i>0)
         return $themes_list;
       else
         return 0;
    }
    
    /**
    * Get the Author of a theme
    * @param string $theme
    * @return string $author
    */
    function getThemeAuthor($theme){
       if(file_exists($this->dir_themes.$theme."/info.php")){
{'fraction_non_alphanumeric': 0.173391494002181, 'fraction_numerical': 0.003271537622682661, 'mean_word_length': 1.8671875, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2811489', 'n_tokens_mistral': 635, 'n_tokens_neox': 604, 'n_words': 134}