- Точка входа
+
+ #
+ Файлы preinclude.php и postinclude.php
+
- PinPIE require to be included in main entry point of your project, and all requests have to be rerouted to that file. Generally, the main entry point for site code is `ROOT/index.php`. This file require to have `include 'pinpie/pinpie.php';` line to start PinPIE working.
- This, in fact, are the only things you have to do to start using PinPIE.
-
- About preinclude.php and postinclude.php
- For every request there are to files, that will be included if they exist. Before processing a page file `ROOT/preinclude.php` will be included. And `ROOT/postinclude.php` will be included after page is processed and assembled. If you will upgrade PinPIE with new version, this files will not be overwritten, because this
- files doesn't exist in PinPIE project. So feel free to modify them corresponding your needs.
+ При каждом запросе PinPIE попытается подключить два файла, если они существуют:
+ = scx("ROOT/preinclude.php") ?> и = scx("ROOT/preinclude.php") ?>,
+ где = scx("ROOT") ?> это константа корневого пути.
+ Пути к этим файлам можно изменить в конфиге.
+
+
+ Сначала проверяется существование файла = scx("ROOT/preinclude.php") ?>.
+ Если он есть — он инклудится. Его отличие от = scx("ROOT/index.php") ?> в том,
+ что в момент его инклуда уже заданы основные параметры PinPIE: прочитан конфиг,
+ определён файл-обработчик запроса =scx('PinPIE::$document', 'php')?>, который можно изменить
+ по своему усмотрению.
+
+ Данный файл подходит для размещения кода автозагрузчика классов.
+ Впрочем, для этой задачи подходит и = scx("ROOT/index.php") ?>.
+
+ Потом, когда закончена обработка запроса, PinPIE пытается включить файл = scx("ROOT/preinclude.php") ?>.
+ Этот файл подходит для вывода дебаг информации и отложенных действий,
+ например с помощью fastcgi_finish_request().
+
+
+ При обновлении файлов PinPIE на новую версию, эти файлы не пропадут и не будут перезаписаны,
+ т.к. они отсутствуют в самом PinPIE. Так что можете уверенно использовать эти файлы
+ для своих нужд.
+