Exemplo n.º 1
0
 private static function _config($file)
 {
     global $config;
     $path = CONFIG_DIR . suffix($file, ".php");
     if (!is_file($path)) {
         return false;
     }
     if (!isImport($path)) {
         require_once restorationPath($path);
         self::$config = $config;
     }
 }
Exemplo n.º 2
0
 protected function _package($packages = "", $recursive = false, $getContents = false)
 {
     if (!is_string($packages)) {
         Error::set('Error', 'stringParameter', 'packages');
         return false;
     }
     if (!empty($this->parameters['usable'])) {
         $getContents = $this->parameters['usable'];
     }
     if (!empty($this->parameters['recursive'])) {
         $recursive = $this->parameters['recursive'];
     }
     $this->parameters = array();
     $eol = eol();
     $return = '';
     if (is_dir($packages)) {
         $packageFiles = Folder::allFiles(suffix($packages), $recursive);
         if (!empty($packageFiles)) {
             foreach ($packageFiles as $val) {
                 $val = restorationPath($val);
                 if ($getContents === true) {
                     $return .= $this->something($val, '', true);
                 } else {
                     $this->something($val);
                 }
             }
             return $return;
         } else {
             return false;
         }
     } elseif (is_file($packages)) {
         return $this->something($packages, '', $getContents);
     }
 }
Exemplo n.º 3
0
 protected static function tryAgainCreateClassMap($class)
 {
     self::createClassMap();
     // Sınıf bilgileri alınıyor...
     $classInfo = self::getClassFileInfo($class);
     // Böyle bir sınıf varsa dahil ediliyor...
     if (file_exists($classInfo['path'])) {
         require_once restorationPath($classInfo['path']);
     } else {
         die(getErrorMessage('Error', 'classError', $class));
     }
 }
Exemplo n.º 4
0
 public static function data()
 {
     //------------------------------------------------------------------------------------------------
     // Page
     //------------------------------------------------------------------------------------------------
     //
     // @var string
     //
     //------------------------------------------------------------------------------------------------
     $page = '';
     //------------------------------------------------------------------------------------------------
     // Function
     //------------------------------------------------------------------------------------------------
     //
     // @var string
     //
     //------------------------------------------------------------------------------------------------
     $function = 'index';
     //------------------------------------------------------------------------------------------------
     // Parameters
     //------------------------------------------------------------------------------------------------
     //
     // @var array
     //
     //------------------------------------------------------------------------------------------------
     $parameters = array();
     //------------------------------------------------------------------------------------------------
     // Segments
     //------------------------------------------------------------------------------------------------
     //
     // @var string
     //
     //------------------------------------------------------------------------------------------------
     $segments = '';
     //------------------------------------------------------------------------------------------------
     // Is File
     //------------------------------------------------------------------------------------------------
     //
     // @var string
     //
     //------------------------------------------------------------------------------------------------
     $isFile = '';
     //------------------------------------------------------------------------------------------------
     // Request Uri
     //------------------------------------------------------------------------------------------------
     //
     // @var string
     //
     //------------------------------------------------------------------------------------------------
     $requestUri = requestUri();
     //------------------------------------------------------------------------------------------------
     //  $_GET kontrolü yapılarak temel URL bilgisi elde ediliyor.
     //------------------------------------------------------------------------------------------------
     $url = explode('?', $requestUri);
     //------------------------------------------------------------------------------------------------
     //  Temel URL adresi / karakteri ile bölümlere ayrılıyor.
     //------------------------------------------------------------------------------------------------
     $segments = explode('/', $url[0]);
     //------------------------------------------------------------------------------------------------
     //  Controller/Sayfa: Controller/ dizini içinde çalıştırılacak dosya adı.
     //------------------------------------------------------------------------------------------------
     if (isset($segments[0])) {
         $page = $segments[0];
         $isFile = restorationPath(CONTROLLERS_DIR . suffix($page, '.php'));
         // Kontrolcüler Controllers/ dizini içinde
         // farklı bir dizinde yer alıyorsa bu bölüm
         // ile o kontrolcülere erişim sağlanıyor.
         if (!is_file($isFile)) {
             $if = '';
             $nsegments = $segments;
             for ($i = 0; $i < count($segments); $i++) {
                 $if .= $segments[$i] . '/';
                 $ifTrim = rtrim($if, '/');
                 $isF = restorationPath(CONTROLLERS_DIR . suffix($ifTrim, '.php'));
                 if (is_file($isF)) {
                     $page = divide($ifTrim, '/', -1);
                     $isFile = $isF;
                     $segments = $nsegments;
                     break;
                 }
                 array_shift($nsegments);
             }
         }
         unset($segments[0]);
         $pageControl = strtolower($page);
         // Bir Controller/ dosyası index kelimesi ile isimlendirilemez!
         if ($pageControl === 'index' || $pageControl === 'main') {
             // Hatayı rapor et.
             report('Error', lang('Error', 'controllerNameError', $pageControl), 'ControllerNameError');
             // Hatayı ekrana yazdır.
             die(Error::message('Error', 'controllerNameError', $pageControl));
         }
     }
     //------------------------------------------------------------------------------------------------
     //  Restore Modu
     //------------------------------------------------------------------------------------------------
     if (APPMODE === 'restoration') {
         Restoration::mode();
     }
     //------------------------------------------------------------------------------------------------
     //  Fonksiyon: Çalıştırılacak dosyaya ait yöntem adı.
     //------------------------------------------------------------------------------------------------
     if (isset($segments[1])) {
         $function = $segments[1];
         unset($segments[1]);
     }
     //------------------------------------------------------------------------------------------------
     //  Parametreler: Çalıştırılacak yönteme gönderilecek parametreler.
     //------------------------------------------------------------------------------------------------
     if (isset($segments[2])) {
         $parameters = $segments;
     }
     //------------------------------------------------------------------------------------------------
     // Return Array
     //------------------------------------------------------------------------------------------------
     //
     // @key array  $parameters
     // @key string $page
     // @key string $file
     // @key string $function
     //
     //------------------------------------------------------------------------------------------------
     return array('parameters' => $parameters, 'page' => $page, 'file' => $isFile, 'function' => $function);
 }
Exemplo n.º 5
0
if (Config::get('Htaccess', 'createFile') === true) {
    createHtaccessFile();
}
//----------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------
// Fonksiyon Yükleme İşlemleri
//----------------------------------------------------------------------------------------------------
$starting = Config::get('Starting');
if ($starting['autoload']['status'] === true) {
    $startingAutoload = Folder::allFiles(AUTOLOAD_DIR, $starting['autoload']['recursive']);
    //------------------------------------------------------------------------------------------------
    // Otomatik Olarak Yüklenen Fonksiyonlar
    //------------------------------------------------------------------------------------------------
    if (!empty($startingAutoload)) {
        foreach ($startingAutoload as $file) {
            $file = restorationPath(suffix($file, '.php'));
            if (is_file($file)) {
                require_once $file;
            }
        }
    }
}
//----------------------------------------------------------------------------------------------------
// El ile Yüklenen Fonksiyonlar
//----------------------------------------------------------------------------------------------------
if (!empty($starting['handload'])) {
    Import::handload($starting['handload']);
}
//----------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------
// Composer Autoload İşlemi
Exemplo n.º 6
0
function baseUrl($uri = '', $index = 0)
{
    if (!is_string($uri)) {
        return false;
    }
    if (!is_numeric($index)) {
        $index = 0;
    }
    $newBaseDir = BASE_DIR;
    if (BASE_DIR !== "/") {
        $baseDir = substr(BASE_DIR, 1, -1);
        if ($index < 0) {
            $baseDir = explode("/", $baseDir);
            $newBaseDir = "/";
            for ($i = 0; $i < count($baseDir) + $index; $i++) {
                $newBaseDir .= suffix($baseDir[$i]);
            }
        }
    }
    $host = host();
    return sslStatus() . $host . $newBaseDir . restorationPath(cleanInjection($uri));
}