-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
045621a
commit 2446a23
Showing
15 changed files
with
550 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,77 @@ | ||
<? | ||
/** | ||
* SimpleMVC | ||
* | ||
* An open source application development framework for PHP 5.1.6 or newer | ||
* | ||
* @package SimpleMVC | ||
* @author zombiQWERTY | ||
* @copyright Copyright (c) 2014, zombiQWERTY | ||
* @link http://zombiqwerty.ru/simplemvc/ | ||
* @since Version 1.0 | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* Config file with default settings | ||
* | ||
* @package SimpleMVC | ||
* @category Back-controller | ||
* @author zombiQWERTY | ||
* @link http://zombiqwerty.ru/simplemvc/ | ||
*/ | ||
|
||
class Config { | ||
|
||
|
||
/** | ||
* Set the index controller of your app. Can not be 'index' | ||
* Устанавливает главный контроллер Вашего приложения. Не может быть 'index' | ||
*/ | ||
public static $indexPage = 'main'; | ||
|
||
/** | ||
* Set the layout of your app | ||
* Устанавливает шаблон Вашего приложения | ||
*/ | ||
public static $layout = 'default'; | ||
|
||
|
||
|
||
/** | ||
* Switch on/off work with db | ||
* Включает/выключает работу с базой данных | ||
*/ | ||
public static $db = true; | ||
|
||
/** | ||
* Set the db connect host | ||
* Устанавливает хост для соединения с базой данных | ||
*/ | ||
public static $host = 'localhost'; | ||
|
||
/** | ||
* Set the db connect username | ||
* Устанавливает логин для соединения с базой данных | ||
*/ | ||
public static $user = 'root'; | ||
|
||
/** | ||
* Set the db connect password | ||
* Устанавливает пароль для соединения с базой данных | ||
*/ | ||
public static $password = 'zvezda'; | ||
|
||
/** | ||
* Set the database for work with db | ||
* Устанавливает таблицу для работы с базой данных | ||
*/ | ||
public static $database = 'simpleMVC'; | ||
|
||
/** | ||
* Set the db connect charset | ||
* Устанавливает кодировку для соединения с базой данных | ||
*/ | ||
public static $charset = 'utf8'; | ||
|
||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,71 @@ | ||
<? | ||
/** | ||
* SimpleMVC | ||
* | ||
* An open source application development framework for PHP 5.1.6 or newer | ||
* | ||
* @package SimpleMVC | ||
* @author zombiQWERTY | ||
* @copyright Copyright (c) 2014, zombiQWERTY | ||
* @link http://zombiqwerty.ru/simplemvc/ | ||
* @since Version 1.0 | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* Framework Initialization File | ||
* | ||
* @package SimpleMVC | ||
* @category Back-controller | ||
* @author zombiQWERTY | ||
* @link http://zombiqwerty.ru/simplemvc/ | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* Set header charset and Moscow locale | ||
*/ | ||
header('Content-Type: text/html; charset=utf-8'); | ||
setlocale(LC_ALL, 'Russian_Russia.65001'); | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* Define useful consts for work | ||
*/ | ||
define('BASE_URL', 'http://'.$_SERVER['HTTP_HOST']); | ||
define('ROOT' , $_SERVER['DOCUMENT_ROOT']); | ||
define('APPPATH' , ROOT.'/application/'); | ||
define('SYSPATH' , ROOT.'/system/'); | ||
|
||
require_once SYSPATH.'autoload.php'; | ||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* require needful files | ||
*/ | ||
require_once SYSPATH.'autoload.php'; | ||
require_once SYSPATH.'exceptionHandler.php'; | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* Set handler for native php errors | ||
*/ | ||
set_error_handler('exceptionHandler'); | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* Disable magic quotes | ||
*/ | ||
if (!Common::isPhp('5.3')) @set_magic_quotes_runtime(0); | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* Initialization the application | ||
*/ | ||
new Application(); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.