Move assignment of $dir outside of loop

Change-Id: I24009db72d0afbb47532eb2c00329e488461066f
This commit is contained in:
Siebrand Mazeland
2016-03-05 16:25:23 +01:00
parent 53fd91f3c0
commit f03d5659fd

View File

@@ -16,6 +16,8 @@ foreach ( glob( '../fonts/*/font.ini' ) as $inifile ) {
$languages = array(); $languages = array();
$version = null; $version = null;
$dir = dirname( $inifile );
foreach ( $conf as $fontname => $font ) { foreach ( $conf as $fontname => $font ) {
if ( isset( $font['languages'] ) ) { if ( isset( $font['languages'] ) ) {
$languages = explode( ',', $font['languages'] ); $languages = explode( ',', $font['languages'] );
@@ -52,8 +54,6 @@ foreach ( glob( '../fonts/*/font.ini' ) as $inifile ) {
$list['fonts'][$fontname]['fontstyle'] = $font['fontstyle']; $list['fonts'][$fontname]['fontstyle'] = $font['fontstyle'];
} }
$dir = dirname( $inifile );
if ( isset( $font['ttf'] ) ) { if ( isset( $font['ttf'] ) ) {
$list['fonts'][$fontname]['ttf'] = basename( $dir ) . '/' . $font['ttf']; $list['fonts'][$fontname]['ttf'] = basename( $dir ) . '/' . $font['ttf'];
} }