Hallo Leute,
hab gerade etwas Stress mit meinem lieben Hoster. Da ich leider keinen anderen habe und nicht weiß, ob es an einem Limit auf meinem Server liegt, oder das Problem woanders her kommt, möchte ich fragen, ob jemand kurz etwas für mich testen kann: Es ist eine kleine Funktion, die lediglich Dateien aus einem Ordner sucht und lädt. Leider bricht sie bei mir immer nach 3 Dateien ab und erkennt keine weitere als is_file(). Testszenario wären also ein paar Dateien (3+) in einem Ordner (test) Eures Theme-Verzeichnisses und ein relativer Pfad (beides in die functions.php):
Code
// PFAD:
define('THEME_TEST_PATH', TEMPLATEPATH . '/test');
/**
* FUNCTION:
*/
if(!function_exists('include_all')) {
function include_all( $path, $ignore = false ) {
if(is_dir($path)) {
$dir = @dir( $path ) or wp_die( '<i>' . __('Could not open required directory: ', 'lang') . '</i>' . $path ); // Open the directory
// $test = scandir($path); var_dump($test);
while( ($file = $dir->read()) !== false ) { // Get all the files from the directory
if($file != '.' && $file != '..') {
if( is_file( $path . '/' . $file ) and ( !$ignore or !in_array( $file, $ignore ) ) ) { // Check if it is a file
if( is_readable( $path . '/' . $file ) ) {
include_once( $path . '/' . $file );
// sleep(10);
} else {
wp_die( '<i>' . __('File is not readable: ', 'lang') . '</i>' . $path . '/' . $file );
}
} else {
wp_die( '<i>' . __('File is not a valid file: ', 'lang') . '</i>' . $path . '/' . $file );
}
}
}
} else {
wp_die( '<i>' . __('The provided resource is not a valid directory: ', 'lang') . '</i>' . $path );
}
$dir->close(); // Close the directory, we're done.
}
} // endif
// AUFRUF
include_all(THEME_TEST_PATH);
Alles anzeigen
VIELEN DANK IM VORAUS!