forked from mirzaev/minimal
		
	обновил чёто забыл уже
This commit is contained in:
		
							
								
								
									
										0
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								composer.json
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								composer.json
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								composer.lock
									
									
									
										generated
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								composer.lock
									
									
									
										generated
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								mirzaev/minimal/system/controller.php
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								mirzaev/minimal/system/controller.php
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										4
									
								
								mirzaev/minimal/system/core.php
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										4
									
								
								mirzaev/minimal/system/core.php
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							@@ -90,9 +90,9 @@ final class core
 | 
				
			|||||||
   *
 | 
					   *
 | 
				
			||||||
   * @param ?string $uri Маршрут
 | 
					   * @param ?string $uri Маршрут
 | 
				
			||||||
   *
 | 
					   *
 | 
				
			||||||
   * @return ?string Сгенерированный ответ (HTML, JSON...)
 | 
					   * @return string|int|null Ответ
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
  public function start(string $uri = null): ?string
 | 
					  public function start(string $uri = null): string|int|null
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    // Обработка запроса
 | 
					    // Обработка запроса
 | 
				
			||||||
    return $this->__get('router')->handle($uri, core: $this);
 | 
					    return $this->__get('router')->handle($uri, core: $this);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										0
									
								
								mirzaev/minimal/system/model.php
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								mirzaev/minimal/system/model.php
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										6
									
								
								mirzaev/minimal/system/router.php
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										6
									
								
								mirzaev/minimal/system/router.php
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							@@ -52,8 +52,10 @@ final class router
 | 
				
			|||||||
   * @param ?string $uri URI запроса (https://domain.com/foo/bar)
 | 
					   * @param ?string $uri URI запроса (https://domain.com/foo/bar)
 | 
				
			||||||
   * @param ?string $method Метод запроса (GET, POST, PUT...)
 | 
					   * @param ?string $method Метод запроса (GET, POST, PUT...)
 | 
				
			||||||
	 * @param ?core $core Инстанция системного ядра
 | 
						 * @param ?core $core Инстанция системного ядра
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 * @return string|int|null Ответ
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
  public function handle(?string $uri = null, ?string $method = null, ?core $core = new core): ?string
 | 
					  public function handle(?string $uri = null, ?string $method = null, ?core $core = new core): string|int|null
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    // Инициализация значений по умолчанию
 | 
					    // Инициализация значений по умолчанию
 | 
				
			||||||
    $uri ??= $_SERVER['REQUEST_URI'] ?? '/';
 | 
					    $uri ??= $_SERVER['REQUEST_URI'] ?? '/';
 | 
				
			||||||
@@ -124,7 +126,7 @@ final class router
 | 
				
			|||||||
							$controller = new $controller;
 | 
												$controller = new $controller;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
              // Инициализация инстанции ядра модели
 | 
					              // Инициализация инстанции ядра модели
 | 
				
			||||||
              if (class_exists($model = $core->namespace . '\\models\\' . $route['model'] . $core->model::POSTFIX)) $controller->model = new $model;
 | 
					              if (class_exists($model = $core->namespace . '\\models\\' . $route['model'] . $core->model::POSTFIX));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
              // Вызов связанного с маршрутом методв и возврат (успех)
 | 
					              // Вызов связанного с маршрутом методв и возврат (успех)
 | 
				
			||||||
              return $controller->{$route['method']}($data['vars'] + $_REQUEST, $_FILES);
 | 
					              return $controller->{$route['method']}($data['vars'] + $_REQUEST, $_FILES);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user