Rumperuu
6a1117be15
* ci: update scripts * release 2.7.1 * remove tracked stylesheets * docs: revert stable tag to 2.7.0 * chore: move Plugin source into own dir * docs: delete info texts These can now be found in the [project wiki][wiki]. [wiki]: https://github.com/markcheret/footnotes/wiki * docs: tweak contributing guide * ci: reflect new directory structure * chore: update gitignore * chore: reflect new dir structure * docs: update documentation * build(linting): add Husky hooks, Markdown linting, lint all MD files * fix pre-push command * fix pre-push command * build: add stylesheet, JS minification * ci: add linting steps * ci: comment out CSS linting step (that's going to be a whole *thing*) * ci: minify all JS files * ci: call correct JS file * chore: lint * ci: fix PHP linting commands * chore: increment version constant string * ci: concat AMP stylesheets * ci: improve build scripts * chore: add assets dir
39 lines
1.2 KiB
PHP
39 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Includes all common files.
|
|
*
|
|
* @filesource
|
|
* @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.
|
|
*/
|
|
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 .= '/';
|
|
}
|
|
// Get all PHP files inside Directory.
|
|
$l_arr_files = scandir( $p_str_directory );
|
|
// Iterate through each class.
|
|
foreach ( $l_arr_files as $l_str_file_name ) {
|
|
// Skip all non-PHP files.
|
|
if ( '.php' !== strtolower( substr( $l_str_file_name, -4 ) ) ) {
|
|
continue;
|
|
}
|
|
// phpcs:disable Generic.Commenting.DocComment.MissingShort
|
|
/** @noinspection PhpIncludeInspection */
|
|
require_once $p_str_directory . $l_str_file_name;
|
|
// phpcs:enable
|
|
}
|
|
}
|
|
|
|
mci_footnotes_require_php_files( dirname( __FILE__ ) . '/class' );
|
|
mci_footnotes_require_php_files( dirname( __FILE__ ) . '/class/dashboard' );
|
|
mci_footnotes_require_php_files( dirname( __FILE__ ) . '/class/widgets' );
|