Modules php name files

9.1. Module structure

The PHP-Nuke modules are PHP-written applications that manage the central part of the site. For example, the «News», «Forum», «Members List» etc. are all modules. Each module, based on it’s complexity, is structured using one part for the user’s and another for the administrator, in this case there are some contents we have to modify. It’s all managed from the modules.php file which alone, carries out the job of authentication and management of the access rights on that module. The modules.php file checks and verifies if the module was activated or not, and verifies the access rights. This saves us a lot of work because we don’t have to insert these controls in every module we create.

We refer you to what is written in Section 6.3 to be more exhaustive.

For example in the avantgo module, in order to load the index.php file, it’s enough to pass the module name to the parameter string, the file that will be searched for is index.php.

If instead we wanted to call a page different from the default index.php (say, print.php), the string we will have to pass is :

That is the file variable with a value (print) that corresponds to the name of the file we want to load without the .php extension.

Inside of the folder modules/nameofmodule there is also a subfolder called «language». In this fashion we manage in a simple and immediate way the multilanguage functionality inside the modules.

The rows modules.php work in this way:

It includes the mainfile.php

Verifies if the module is active

Verifies whether the string passes a file name different from index.php

Verifies the permissions of the module (whether everybody can see it, or only registered users, or only the administrator).

Источник

6.3. Module management

For reasons of order, the modules are managed through the files present in the subdirectories that contain them, every module has its own folder in the interior of the folder «modules».

Читайте также:  Создать метод java горячие клавиши

In order to be loaded, the module files get included in the modules.php file by passing it the aproppriate parameters. The main page of each module must be called index.php, the other possibly pages possibly present in the module will have an additional variable in the inside of parameter strings by which they are called..

For example in the AvantGo module (see ) in order to load the index.php file, it is enough to pass the module name to the parameter string (by default, the file that will be searched for is index.php):

If we instead wanted to call a page other than the default index.php (say, print.php), the string we will have to pass is :

that is the file variable with a value (print) that corresponds to the name of the file we want to load without the .php extension.

Inside the folder modules/nameofmodule there is also a subfolder called «language». In this fashion we manage in a simple and immediate way the multilanguage functionality inside the modules.

The modules.php file works this way:

Verifies whether the module is active or not

Verifies whether the string passes a file name different from index.php

Verifies the permissions of the module (whether everybody can see it, or only registered users, or only the administrator).

Источник

6.3. Module management

For reasons of order, the modules are managed through the files present in the subdirectories that contain them, every module has its own folder in the interior of the folder «modules».

In order to be loaded, the module files get included in the modules.php file by passing it the aproppriate parameters. The main page of each module must be called index.php, the other possibly pages possibly present in the module will have an additional variable in the inside of parameter strings by which they are called..

For example in the AvantGo module (see ) in order to load the index.php file, it is enough to pass the module name to the parameter string (by default, the file that will be searched for is index.php):

Читайте также:  Java console logs windows

If we instead wanted to call a page other than the default index.php (say, print.php), the string we will have to pass is :

that is the file variable with a value (print) that corresponds to the name of the file we want to load without the .php extension.

Inside the folder modules/nameofmodule there is also a subfolder called «language». In this fashion we manage in a simple and immediate way the multilanguage functionality inside the modules.

The modules.php file works this way:

Verifies whether the module is active or not

Verifies whether the string passes a file name different from index.php

Verifies the permissions of the module (whether everybody can see it, or only registered users, or only the administrator).

Источник

PHP 8.0: Apache Handler: Module name and file path changes

The Apache 2 Handler SAPI in PHP 8.0 is renamed, and can affect when PHP is used as an Apache module.

It is recommended to use PHP-FPM with Apache mod_event MPM . However, PHP 8.0 still supports the Apache 2 Handler SAPI, which is integrated with Apache 2 web server as an Apache module.

Module identifier renamed to php_module

In PHP 8.0, the Apache module identifier is renamed to php_module .

In PHP 7.x versions, it was named php7_module , and in PHP 5.x, it was named php5_module .

This means that all references to the Apache module loading configuration needs to be updated:

- LoadModule php7_module "/usr/lib/apache2/modules/libphp7.4.so" + LoadModule php_module "/usr/lib/apache2/modules/libphp8.0.so"

Apache will throw an error similar to the one below if the module name php8_module is used:

Can't locate API module structure `php8_module` in file . 

Apache directives, and any other places the module name is used must be updated to their new name as well:

- + DirectoryIndex index.html default.php index.php AddHandler application/x-httpd-php .php 

Windows DLL file name changes

On Windows, the DLL file name is updated for PHP 8. Module identifier is php_module .

- LoadModule php7_module "W:/php/php-8.0.0-Win32-vc15-x64/php7apache2_4.dll" + LoadModule php_module "W:/php/php-8.0.0-Win32-vc15-x64/php8apache2_4.dll"

It might be necessary to manually update development environment bundles such as XAMPP, Wamp, or Laragon to reflect this.

Backwards Compatibility Impact

Due to the module identifier renaming, errors similar to Can’t locate API module structure php8_module in file might occur, but most distributions, software collections, and PPAs automatically configure the Apache2Handler on behalf of the user, so the chances of end users running into this issue is uncommon.

© 2018-2023 PHP.Watch, with ❤ from Ayesh • About PHP.Watch

Источник

6.3. Module management

For reasons of order, the modules are managed through the files present in the subdirectories that contain them, every module has its own folder in the interior of the folder «modules».

In order to be loaded, the module files get included in the modules.php file by passing it the aproppriate parameters. The main page of each module must be called index.php, the other possibly pages possibly present in the module will have an additional variable in the inside of parameter strings by which they are called..

For example in the AvantGo module (see ) in order to load the index.php file, it is enough to pass the module name to the parameter string (by default, the file that will be searched for is index.php):

If we instead wanted to call a page other than the default index.php (say, print.php), the string we will have to pass is :

that is the file variable with a value (print) that corresponds to the name of the file we want to load without the .php extension.

Inside the folder modules/nameofmodule there is also a subfolder called «language». In this fashion we manage in a simple and immediate way the multilanguage functionality inside the modules.

The modules.php file works this way:

Verifies whether the module is active or not

Verifies whether the string passes a file name different from index.php

Verifies the permissions of the module (whether everybody can see it, or only registered users, or only the administrator).

Источник

Оцените статью