Project

General

Profile

« Previous | Next » 

Revision 2113

Added by darkviper almost 10 years ago

+ framework/UpgradeHelper added new method convInfoIni2InfoPhp()

View differences:

branches/2.8.x/CHANGELOG
11 11
! = Update/Change
12 12
===============================================================================
13 13

  
14
01 Dec-2014 Build 2113 Manuela v.d.Decken(DarkViper)
15
+ framework/UpgradeHelper added new method convInfoIni2InfoPhp()
14 16
25 Nov-2014 Build 2112 Manuela v.d.Decken(DarkViper)
15 17
! module/show_menu2/  Changed global Constants into class constants
16 18
25 Nov-2014 Build 2111 Manuela v.d.Decken(DarkViper)
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.4');
54
if(!defined('REVISION')) define('REVISION', '2112');
54
if(!defined('REVISION')) define('REVISION', '2113');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/framework/UpgradeHelper.php
341 341
	}
342 342

  
343 343

  
344
    static public function convInfoIni2InfoPhp($sIniDir)
345
    {
346
        $aVarTypePrefixes = array(
347
            'template' => 'template',
348
            'theme'    => 'template',
349
            'tool'     => 'module',
350
            'page'     => 'module',
351
            'snippet'  => 'module'
352
        );
353
        $aNeededVars = array_flip(
354
            array('directory','name','function','version','platform','author','license','license_terms','description')
355
        );
356
        $aRetval = array();
357
        $sIniDir = rtrim(str_replace('\\', '/', $sIniDir), '/').'/';
358
        if (is_readable($sIniDir.'info.ini')) {
359
            if (($ini = parse_ini_file($sIniDir.'info.ini', true))) {
360
                if (!array_key_exists($ini['info']['type'], $aVarTypePrefixes)) {
361
                    return null;
362
                }
363
                $aRetval['prefix'] = $aVarTypePrefixes[$ini['info']['type']];
364
                $aRetval['function'] = $ini['info']['type'];
365
                unset($aNeededVars['function']);
366
                foreach ($ini['info'] as $sVar => $sValue) {
367
                    $aRetval[$sVar] = $sValue;
368
                    unset($aNeededVars[$sVar]);
369
                }
370
                if (isset($ini['platform']['versions'])) {
371
                    $aRetval['platform'] = $ini['platform']['versions'];
372
                    unset($aNeededVars['platform']);
373
                }
374
                if  (sizeof($aNeededVars) > 0) {
375
                    return null;
376
                }
377
            } else {
378
                return null;
379
            }
380
        } else {
381
            return null;
382
        }
383
        return $aRetval;
384
    } // end of function Ini2PhpInfo
385

  
344 386
} // end of class UpgradeHelper
345 387

  

Also available in: Unified diff