Авторизация
 Регистрация   Войти   Забыли пароль? 

Религия PHP-Fusion 7 Bogatyr

Обновлённый PHP-Fusion Bogatyr / Free CMS PHP-Fusion 7 Bogatyr / Creating your php-pages and plug-ins for PHP Fusion 7 Bogatyr / Религия PHP-Fusion 7 Bogatyr


 Russian

Религия запрещает:

 

- использовать в PHP-Fusion ООП (объектно-ориентированное програмирование).

PHP-Fusion создан на базе простых функций для быстрого изучения PHP новичками. А не для вечных мучений.

 

- использовать в PHP-Fusion классы.

Нам достаточно разных названий для функций. Мы просто не инклюдим те функции, которые нам не нужны.

 

Исключение: 

интегрированные скрипты, готовые классы функций в том числе с ООП, например:
/includes/phpmailer_include.php

 

Религия поощряет:

 

- инклюдить минимум php-файлов

Если какие-то функции не требуются, то их не надо инклюдить. Чтобы сайт быстрее работал.

 

- сокращение запросов к БД.

В стандартном PHP-Fusion много запросов к БД. Я стараюсь их сократить. Это можно сделать двумя путями:

1) Запросить сразу несколько однотипных строк из БД, а затем внести полученные данные в массив. И выводить их на странице из двумерного массива.

2) Записать настройки и наиболее часто востребованые страницы (категории) в виде двумерного массива в php-файл. Чтобы при просмотре сайта пользователем данные брались из файла, а не из БД. А при редактировании страниц кеш обновлялся.

Для записи наиболее часто востребованые страниц (категорий) создан кэш CMS и плагинов, а для редактирования и записи настроек плагинов в файл в админке есть специальная страница.

 

- вынести часто используемый код в отдельные файлы с функциями.

Причём сделать это так, чтобы эти же функции могли использоваться другими контентными страницами. Например: инклюды комментариев, рейтингов и другие инклюды.

 

- использование переменных и дифайнов с понятными названиями

аналогичные тем, которые уже используются в PHP-Fusion.

 

- грамотно записывать настройки в CSS

Если плагин генерирует много CSS кода, то лучше записывать средствами PHP настройки в отдельный CSS-файл.

А если мало (одна или несколько строк), то как раз надо добавлять css в <head> функцией add_to_head().

Religion of PHP-Fusion 7 Bogatyr

Обновлённый PHP-Fusion Bogatyr / Free CMS PHP-Fusion 7 Bogatyr / Creating your php-pages and plug-ins for PHP Fusion 7 Bogatyr / Religion of PHP-Fusion 7 Bogatyr


 English

Religion prohibits:

 

- use in PHP-Fusion OOP (object-oriented programming).

PHP-Fusion is based on simple functions for quickly learning PHP beginners. And not for eternal torment.

 

- use classes in PHP-Fusion.

We have enough different names for the functions. We just do not include those functions that we do not need.

 

An exception:

integrated scripts, ready-made function classes, including those with OOP, for example:

/includes/phpmailer_include.php

 

Religion encourages:

 

- include at least php files

If any functions are not required, they do not need to be included. To make the site work faster.

 

- reduction of queries to the database.

In standard PHP-Fusion many database queries. I try to reduce them. This can be done in two ways:

1) Request several rows of the same type from the database at once, and then enter the data into an array. And display them on the page from a two-dimensional array.

2) Write the settings and the most frequently requested pages (categories) as a two-dimensional array into a php file. So that when a user views a site, data is taken from a file, and not from a database. And when editing pages, the cache was updated.

For writing the most frequently requested pages (categories), the CMS cache and plugins are created, and there is a special page for editing and writing plugins settings to the file in the admin panel.

 

- render frequently used code in separate files with functions.

And make it so that the same functions could be used by other content pages. For example: comments, ratings and other inclusions.

 

- use of variables and difines with clear names

 similar to those already used in PHP-Fusion.

 

- correctly write settings in CSS

If the plugin generates a lot of CSS code, it is better to write the PHP settings in a separate CSS file.

And if a little (one or more lines), then just need to add css to the <head> function add_to_head().

Добавить комментарий

Добавить комментарий
Пожалуйста, залогиньтесь для добавления комментария.
Рейтинги
HTML-code and BB-code for blogs and forums

<a href="https://php-fusion.vveb.ws/php-fusion.php?id=39">Религия PHP-Fusion 7 Bogatyr</a>


[url=https://php-fusion.vveb.ws/php-fusion.php?id=39]Религия PHP-Fusion 7 Bogatyr[/url]

Language: Default
 
Код для PHP-Fusion