get_sorted_dirlist(null,JPATH_SITE.DS.$pathtodir,null);
// print_r($dirs);
// foreach( $dirs as $dir )
// {
// echo NL.str_repeat($the_char, $level);
// echo $dir.'
';
//
// //-- recurse...
// EasyCreatorModelDirInfo::projDirInfo( $pathtodir.$dir, $level + 1);//, $total, $link );
// }
//
// //files
// $files = $dirobj->filelist;
// foreach( $files as $file )
// {
//
// //echo $the_path.'
';
// //echo $pathtodir.'
';
// //echo $file.'
';
// //echo $the_file.'
';
//
// $xx = str_replace( DS, '.', $pathtodir);
// $style = '';
// if( $the_path
// && $the_path == $pathtodir
// && $file == $the_file )
// {
// $style = 'style="color: red; font-weight: bold;"';
// }
// $task = JRequest::getVar('task');
// # $s_file =( $link ) ? ''.$file.'' : $file;
// # $s_file =( $js ) ? ''.$file.'' : $s_file;
// $s_file = ''.$file.'';
//
// echo NL.str_repeat($the_char, $level).$s_file.'
';
// # $total++;
// }
//
// $level--;
//
// }// function
// function read_recursiv( $path )
// {
// $result = array();
// $handle = opendir( $path );
// if( $handle )
// {
// while( false !== ( $file = readdir( $handle )))
// {
// if( $file != "." && $file != ".." )
// {
// if( is_file( $file ))
// {
// #echo $file."";
// }
// $name = $path . "/" . $file;
// if (is_dir($name))
// {
// $ar = $this->read_recursiv($name);
// foreach ($ar as $value)
// {
// $result[] = $value;
// }// foreach
// } else
// {
// $result[] = $name;
// }
// }
// }// while
// }
// closedir($handle);
// return $result;
// }// function
/**
* gets the number of code lines of all the files of a given path by extension
*
* @param string $path path to file
* @param string $filter_ext extension
* @return array count files, lines
*/
function getCodeLines( $path, $filterExtensions )
{
$files = $this->files($path,'.'.$filterExtensions, true, true, array('.svn'));
$cnt_lines = 0;
$cnt_files = 0;
foreach( $files as $fileName )
{
$cnt_lines += count(explode("\n", JFile::read($fileName)));
$cnt_files ++;
}//foreach
$project_data = array(
'cnt_files' => $cnt_files,
'cnt_lines' => $cnt_lines
);
return $project_data;
}// function
}// class