Project

General

Profile

« Previous | Next » 

Revision 29

Added by Manuela over 6 years ago

modified CoreAutoloader for recognized traits in /frameworks/traits/
activate Autoloading in Phplib_FtanTrait
moved Phplib_FtanTrait to /frameworks/traits/

View differences:

branches/main/admin/interface/version.php
44 44
if (!defined('VERSION_LOADED')) {
45 45
    $sInfo = '
46 46
        VERSION  = "2.10.1-dev"
47
        REVISION = "28"
47
        REVISION = "29"
48 48
        SP       = ""
49 49
    ';
50 50
    foreach (parse_ini_string($sInfo) as $item=>$value) {
branches/main/framework/CoreAutoloader.php
78 78

  
79 79
    public static function autoLoad($sClassName)
80 80
    {
81
        $sTmp = \basename($sClassName);
82
        if (\strtolower(\substr($sTmp, -5)) == 'trait') {
83
            $sClassName = 'bin\traits\\'.$sTmp;
84
        }
81 85
        $aMatches = \preg_split(
82 86
            '=/=',
83 87
            \str_replace('\\', '/',$sClassName.'.php'),
......
85 89
            \PREG_SPLIT_NO_EMPTY
86 90
        );
87 91
        // insert default NS if no one is given
88
        if (\sizeof($aMatches) == 1) { \array_unshift($aMatches, 'framework'); }
92
        if (\sizeof($aMatches) == 1) { \array_unshift($aMatches, 'bin'); }
89 93
        // extract default filename
90 94
        $sClassFileName = \array_pop($aMatches);
91 95
        // translate namespaces into the real dir entries
branches/main/framework/traits/Phplib_FtanTrait.php
1
<?php
2

  
3
/*
4
 * Copyright (C) 2017 Manuela v.d.Decken <manuela@isteam.de>
5
 *
6
 * DO NOT ALTER OR REMOVE COPYRIGHT OR THIS HEADER
7
 *
8
 * This program is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU General Public License as published by
10
 * the Free Software Foundation, version 2 of the License.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License 2 for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License 2
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 */
20
/**
21
 * Description of Phplib_FtanTrait
22
 *
23
 * @package      Vendor_Phplib
24
 * @copyright    Manuela v.d.Decken <manuela@isteam.de>
25
 * @author       Manuela v.d.Decken <manuela@isteam.de>
26
 * @license      GNU General Public License 2.0
27
 * @version      0.0.1
28
 * @revision     $Id$
29
 * @since        File available since 11.11.2017
30
 * @deprecated   no / since 0000/00/00
31
 * @description  xxx
32
 */
33
//declare(strict_types = 1);
34
//declare(encoding = 'UTF-8');
35

  
36
/**
37
 * short description of trait
38
 */
39
trait Phplib_FtanTrait
40
{
41
    public function set_ftan($aFtan)
42
    {
43
        $aResult = [
44
            'FTAN_NAME'  => $aFtan['name'],
45
            'FTAN_VALUE' => $aFtan['value']
46
        ];
47
        if (isset($aFtan['remain'])) { $aResult['FTAN_REMAIN'] = $aFtan['remain']; }
48
        if (isset($aFtan['previous'])) { $aResult['FTAN_PREVIOUS'] = $aFtan['previous']; }
49
        $this->set_var($aResult);
50
    }
51
}
0 52

  
branches/main/include/phplib/template.inc
67 67
 * Ticket #812 depricated Fix 2009/11/25
68 68
 */
69 69

  
70
if (is_readable(__DIR__.'/FtanTrait.php') and !trait_exists('\FtanTrait', false)) {
71
    include __DIR__.'/FtanTrait.php';
72
}
73

  
74 70
class Template
75 71
{
76
    use \FtanTrait;
72
    use \Phplib_FtanTrait;
77 73
 /**
78 74
  * Serialization helper, the name of this class.
79 75
  *

Also available in: Unified diff