示例#1
0
 public static function mode()
 {
     // Eğer ip tadilat ipsi olarak ayarlanmış ise
     // bu ip'li bilgisayar tamir modundan etkilenmez.
     if (isRepmac()) {
         return false;
     }
     // Tamir moduna geçildiği durumnda tadilat makinesi olarak belirlenmeyen
     // diğer kullanıcı bilgisayarlarında herhangi bir hata ile karşı karşıya
     // kalmamaları için hata raporlama kapatılıyor.
     error_reporting(0);
     // Config/Repair.php dosyasında tadilata alınacak sayfalar belirtilir.
     // Burada ayarlarda belirtilen sayfa isimleri bilgisi alınıyor.
     $repairConfig = Config::get('Repair');
     $repairPages = $repairConfig['pages'];
     $routePate = strtolower($repairConfig['routePage']);
     $currentPath = strtolower(currentPath());
     // Eğer Config/Repair.php dosyasında pages = "all" olarrak alınmış ise
     // tüm sayfalar için tadilat modu uygulanıyor demektir.
     if (is_string($repairPages)) {
         if ($repairPages === "all") {
             if ($currentPath !== $routePate) {
                 redirect($repairConfig['routePage']);
             }
         }
     }
     // Sayfalar tek tek çağrılıyor..
     if (is_array($repairPages) && !empty($repairPages)) {
         // Eğer Config/Repair.php dosyasında pages = array("all") olarrak alınmış ise
         // tüm sayfalar için tadilat modu uygulanıyor demektir.
         if ($repairPages[0] === "all") {
             if ($currentPath !== $routePate) {
                 redirect($repairConfig['routePage']);
             }
         }
         foreach ($repairPages as $k => $rp) {
             // Yönlendirme sayfası bir anahtar-değer çifti içeriyorsa bu sayfaya yönlenmesi sağlanır
             if (strstr($currentPath, strtolower($k))) {
                 redirect($rp);
             } else {
                 // Eğer gelen sayfa o anki url içinde geçiyorsa yani sonuc -1 den büyükse
                 // yönlendirme sayfası olarak belirlene sayfaya yönlendir.
                 if (strstr($currentPath, strtolower($rp))) {
                     if ($currentPath !== $routePate) {
                         redirect($repairConfig['routePage']);
                     }
                 }
             }
         }
     }
 }
示例#2
0
 public static function mode()
 {
     if (self::isMachinesIP() === true) {
         return false;
     }
     error_reporting(0);
     $projects = \Config::get('Project');
     $restoration = $projects['restoration'];
     $restorationPages = $restoration['pages'];
     $routePage = strtolower($restoration['routePage']);
     $currentPath = strtolower(currentPath());
     if (is_string($restorationPages)) {
         if ($restorationPages === "all") {
             if ($currentPath !== $routePage) {
                 redirect($restoration['routePage']);
             }
         }
     }
     if (is_array($restorationPages) && !empty($restorationPages)) {
         if ($restorationPages[0] === "all") {
             if ($currentPath !== $routePage) {
                 redirect($restoration['routePage']);
             }
         }
         foreach ($restorationPages as $k => $rp) {
             if (strstr($currentPath, strtolower($k))) {
                 redirect($rp);
             } else {
                 if (strstr($currentPath, strtolower($rp))) {
                     if ($currentPath !== $routePage) {
                         redirect($restoration['routePage']);
                     }
                 }
             }
         }
     }
 }
示例#3
0
//--------------------------------------------------------------------------------------------------
// BASE_PATH
//--------------------------------------------------------------------------------------------------
//
// @return example.com/
//
//--------------------------------------------------------------------------------------------------
define('BASE_PATH', basePath());
//--------------------------------------------------------------------------------------------------
// CURRENT_PATH
//--------------------------------------------------------------------------------------------------
//
// @return current/
//
//--------------------------------------------------------------------------------------------------
define('CURRENT_PATH', currentPath());
//--------------------------------------------------------------------------------------------------
// PREV_PATH
//--------------------------------------------------------------------------------------------------
//
// @return prev/
//
//--------------------------------------------------------------------------------------------------
define('PREV_PATH', prevPath());
//--------------------------------------------------------------------------------------------------
// HOST
//--------------------------------------------------------------------------------------------------
//
// @return example.com
//
//--------------------------------------------------------------------------------------------------
示例#4
0
 public function current(bool $isPath = true) : string
 {
     return currentPath($isPath);
 }