lib/MwbExporter/Bootstrap.php
protected function scanFormatters($dirs)
    {
        $dirs = is_array($dirs) ? $dirs : array($dirs);
        foreach ($dirs as $key => $dir) {
            $namespace = null;
            if (is_string($key)) {
                $namespace = $dir;
                $dir = $key;
            }
            if (is_dir($dir)) {
                $parts = array('*', '*', 'Formatter.php');
                if (null == $namespace) {
                    $parts = array_merge(array('*', 'MwbExporter', 'Formatter'), $parts);
                }
                $pattern = implode(DIRECTORY_SEPARATOR, array_merge(array($dir), $parts));
                foreach (glob($pattern) as $filename) {
                    $parts = explode(DIRECTORY_SEPARATOR, dirname(realpath($filename)));
                    $exporter = array_pop($parts);
                    $module = array_pop($parts);
                    $class = sprintf('%s\\%s\\%s\\Formatter', $namespace ?: '\\MwbExporter\\Formatter', $module, $exporter);
                    $this->registerFormatter(array($module, $exporter), $class);
                }
            }
        }

        return $this;
    }
protected function scanFormatters($dirs)
    {
        $dirs = is_array($dirs) ? $dirs : array($dirs);
        foreach ($dirs as $key => $dir) {
            $namespace = null;
            if (is_string($key)) {
                $namespace = $dir;
                $dir = $key;
            }
            if (is_dir($dir)) {
                $parts = array('*', '*', 'Formatter.php');
                if (null == $namespace) {
                    $parts = array_merge(array('*', 'MwbExporter', 'Formatter'), $parts);
                }
                $pattern = implode(DIRECTORY_SEPARATOR, array_merge(array($dir), $parts));
                foreach (glob($pattern) as $filename) {
                    $parts = explode(DIRECTORY_SEPARATOR, dirname(realpath($filename)));
                    $exporter = array_pop($parts);
                    $module = array_pop($parts);
                    $class = sprintf('%s\\%s\\%s\\Formatter', $namespace ?: '\\MwbExporter\\Formatter', $module, $exporter);
                    $this->registerFormatter(array($module, $exporter), $class);
                }
            }
        }

        return $this;
    }
protected function scanFormatters ( $ dirs ) { $ dirs = is_array ( $ dirs ) ? $ dirs : array ( $ dirs ) ; foreach ( $ dirs as $ key => $ dir ) { $ namespace = null ; if ( is_string ( $ key ) ) { $ namespace = $ dir ; $ dir = $ key ; } if ( is_dir ( $ dir ) ) { $ parts = array ( '*' , '*' , 'Formatter.php' ) ; if ( null == $ namespace ) { $ parts = array_merge ( array ( '*' , 'MwbExporter' , 'Formatter' ) , $ parts ) ; } $ pattern = implode ( DIRECTORY_SEPARATOR , array_merge ( array ( $ dir ) , $ parts ) ) ; foreach ( glob ( $ pattern ) as $ filename ) { $ parts = explode ( DIRECTORY_SEPARATOR , dirname ( realpath ( $ filename ) ) ) ; $ exporter = array_pop ( $ parts ) ; $ module = array_pop ( $ parts ) ; $ class = sprintf ( '%s\\%s\\%s\\Formatter' , $ namespace ? : '\\MwbExporter\\Formatter' , $ module , $ exporter ) ; $ this -> registerFormatter ( array ( $ module , $ exporter ) , $ class ) ; } } } return $ this ; }
Scan directories for available formatters.

Try to guess if schema formatter (or exporter) is present in the specified directory
which is named according to convention: MwbExporter\Formatter\*\*\Formatter.php.

@param array $dirs
@return \MwbExporter\Bootstrap
Scan directories for available formatters .