|
- <?php
-
-
-
- namespace common\helpers;
-
- class Souke
- {
- public static function getVersions()
- {
- $versionsArray = [];
- $pathVersions = \Yii::getAlias('@common/versions');
-
- if(is_dir($pathVersions))
- {
- $directory = opendir($pathVersions);
- while( $child = readdir($directory) ){
- if($child != '.' && $child != '..' && $child != '_macros.php'){
- $version = str_replace('.php', '', $child);
- $versionsArray[] = $version;
- }
- }
- }
-
- rsort($versionsArray, SORT_NATURAL);
-
- return $versionsArray;
- }
- }
|