1
Changeset 974 – MultiMag

Changeset 974


Ignore:
Timestamp:
Jun 29, 2018, 9:49:10 AM (8 weeks ago)
Author:
blacklight
Message:
  • Исправление загрузчика классов в cli
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/common/core.common.php

    r972 r974  
    2929    $class_name_lc = str_replace('\\', '/', $class_name_lc);
    3030    $class_name = str_replace('\\', '/', $class_name);
    31     $file = $CONFIG['location'] . "/common/" . $class_name_lc . '.php';
    32     if(file_exists($file)) {
    33         include_once $CONFIG['location'] . "/common/" . $class_name_lc . '.php';
    34     }
    35     $file = $CONFIG['location'] . "/common/" . $class_name . '.php';
    36     if(file_exists($file)) {
    37         include_once $CONFIG['location'] . "/common/" . $class_name . '.php';
    38     }
     31    $fname = $CONFIG['location'] . "/common/" . $class_name_lc . '.php';
     32    if(file_exists($fname)) {
     33        include_once $fname;
     34        return;
     35    }
     36    $fname = $CONFIG['location'] . "/common/" . $class_name . '.php';
     37    if(is_readable($fname)) {
     38        include_once $fname;
     39        return;
     40    }
     41    $fname = $CONFIG['site']['location'].'/include/'.$class_name_lc.'.php';
     42    if(is_readable($fname)) {
     43        include_once $fname;
     44        return;
     45    }
     46   
    3947}
    4048
  • trunk/web/core.php

    r971 r974  
    3131            return;
    3232        }
    33     }
    34     $fname = $CONFIG['site']['location'].'/include/'.$lower_class_name.'.php';
    35     if(is_readable($fname)) {
    36         include_once $fname;
    37         return;
    38     }
     33    }   
    3934    $filename = dirname(__DIR__)
    4035        .DIRECTORY_SEPARATOR
Note: See TracChangeset for help on using the changeset viewer.