Пример #1
0
function filename($template)
{
    if (_has_absolute_path($template)) {
        $template_dir = '';
    } else {
        $template_dir = basedir() ?: default_basedir();
    }
    $template_dir = !empty($template_dir) ? rtrim($template_dir, '/\\') . DIRECTORY_SEPARATOR : $template_dir;
    $template = rtrim($template, '/\\');
    return _slashes_to_directory_separator("{$template_dir}{$template}.php");
}
Пример #2
0
<?php

require_once basedir(__FILE__) . "/../Model/SearchModel.php";
class SearchController extends Controller
{
    public function __construct()
    {
        $this->model = new SearchModel();
    }
}
Пример #3
0
<?php

require_once basedir(__FILE__) . "/../Model/OrderModel.php";
class OrderController extends Controller
{
    public function __construct()
    {
        $this->model = new OrderModel();
    }
}
Пример #4
0
<?php

require_once basedir(__FILE__) . "/../Model/ImageModel.php";
class ImageController extends Controller
{
    public function __construct()
    {
        $this->model = new ImageModel();
    }
}
Пример #5
0
function tryindex($fs, $dir)
{
    global $CFG, $RTI;
    $bdir = basedir($dir);
    $index_file = '';
    $ifile = pathjoin($CFG['cachedir'], $RTI['base'], sha1($dir) . '.idx');
    if (isarchive() && ($index_file = @file_get_contents($ifile)) !== false) {
        return $index_file;
    } else {
        foreach ($fs as $f) {
            if (!isweb($f)) {
                continue;
            }
            if (empty($index_file)) {
                $index_file = $f;
            } elseif (preg_match('/^index/i', $f)) {
                if (preg_match('/^index/i', $index_file)) {
                    if (strlen(getname($f)) < strlen(getname($index_file))) {
                        $index_file = $f;
                    }
                } else {
                    $index_file = $f;
                }
            } elseif (preg_match('/^default/i', $f)) {
                if (preg_match('/^default/i', $index_file)) {
                    if (strlen(getname($f)) < strlen(getname($index_file))) {
                        $index_file = $f;
                    }
                } elseif (!preg_match('/^index/i', $index_file)) {
                    $index_file = $f;
                }
            } elseif (levenshtein($bdir, $f) < levenshtein($bdir, $index_file) && !preg_match('/^index/i', $index_file) && !preg_match('/^default/i', $index_file)) {
                $index_file = $f;
            }
        }
        if (isarchive()) {
            if (!ufile_exists($CFG['cachedir'] . $RTI['base'])) {
                umkdir($CFG['cachedir'] . $RTI['base']);
            }
            file_put_contents($ifile, $index_file);
        }
        return $index_file;
    }
}