Re-standardise codebase to WP Coding Standards (this time without the line ending changes)
git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2483354 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
05d316ae15
commit
8a859b61f7
30 changed files with 1974 additions and 1979 deletions
37
includes.php
37
includes.php
|
@ -3,36 +3,37 @@
|
|||
* Includes all common files.
|
||||
*
|
||||
* @filesource
|
||||
* @author Stefan Herndler
|
||||
* @package footnotes
|
||||
* @since 1.5.0 14.09.14 13:40
|
||||
*/
|
||||
|
||||
/**
|
||||
* Requires (require_once) all *.php files inside a specific Directory.
|
||||
* 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
|
||||
* @param string $p_str_directory Absolute Directory path to lookup for `*.php` files.
|
||||
*/
|
||||
function MCI_Footnotes_requirePhpFiles($p_str_Directory) {
|
||||
// append slash at the end of the Directory if not exist
|
||||
if (substr($p_str_Directory, -1) != "/") {
|
||||
$p_str_Directory .= "/";
|
||||
|
||||
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_FileName) {
|
||||
// skip all non *.php files
|
||||
if (strtolower(substr($l_str_FileName, -4)) != ".php") {
|
||||
// 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_FileName);
|
||||
require_once $p_str_directory . $l_str_file_name;
|
||||
// phpcs:enable
|
||||
}
|
||||
}
|
||||
|
||||
MCI_Footnotes_requirePhpFiles(dirname(__FILE__) . "/class");
|
||||
MCI_Footnotes_requirePhpFiles(dirname(__FILE__) . "/class/dashboard");
|
||||
MCI_Footnotes_requirePhpFiles(dirname(__FILE__) . "/class/widgets");
|
||||
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' );
|
||||
|
|
Reference in a new issue