Back to FilesystemHelper class

Method getJStreams

public static array
getJStreams
()
Returns a list of J! streams
Returns
  • array
Since
  • 1.7.0

Method getJStreams - Source code

/**
 * Returns a list of J! streams
 *
 * @return  array
 *
 * @since   1.7.0
 */
public static function getJStreams()
{
    static $streams = array();
    if (!$streams) {
        $files = new \DirectoryIterator(__DIR__ . '/Streams');
        /** @var  $file  \DirectoryIterator */
        foreach ($files as $file) {
            // Only load for php files.
            if (!$file->isFile() || $file->getExtension() !== 'php') {
                continue;
            }
            $streams[] = str_replace('stream', '', strtolower($file->getBasename('.php')));
        }
    }
    return $streams;
}