This repository has been archived on 2023-08-16. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
footnotes/includes.php

38 lines
1.1 KiB
PHP
Raw Normal View History

<?php
/**
* Includes all common files.
*
* @filesource
2021-02-21 11:13:49 +00:00
* @package footnotes
* @since 1.5.0 14.09.14 13:40
*/
/**
* Requires (require_once) all *.php files inside a specific Directory.
*
* @author Stefan Herndler
* @since 1.5.0
* @param string $p_str_directory Absolute Directory path to lookup for *.php files
*/
2021-02-21 11:13:49 +00:00
function mci_footnotes_require_php_files( $p_str_directory ) {
// Append slash at the end of the Directory if not exist.
if ( substr( $p_str_directory, -1 ) != '/' ) {
$p_str_directory .= '/';
}
2021-02-21 11:13:49 +00:00
// Het all PHP files inside Directory.
$l_arr_files = scandir( $p_str_directory );
2021-02-21 11:13:49 +00:00
// Iterate through each class.
foreach ( $l_arr_files as $l_str_file_name ) {
2021-02-21 11:13:49 +00:00
// Skip all non *.php files.
if ( strtolower( substr( $l_str_file_name, -4 ) ) != '.php' ) {
continue;
}
2021-02-21 11:13:49 +00:00
/** @noinspection PhpIncludeInspection */
require_once( $p_str_directory . $l_str_file_name );
}
}
2021-02-21 11:13:49 +00:00
mci_footnotes_require_php_files( dirname( __FILE__ ) . '/class' );
mci_footnotes_require_php_files( dirname( __FILE__ ) . '/class/layout' );
mci_footnotes_require_php_files( dirname( __FILE__ ) . '/class/widgets' );