diff --git a/owark.php b/owark.php index 6378fc6..caebee1 100644 --- a/owark.php +++ b/owark.php @@ -25,6 +25,18 @@ Author URI: http://eric.van-der-vlist.com License: GLP2 */ +/* + Log + */ +if ( ! function_exists('print_r_log')) { + function print_r_log ( $log ) { + if ( is_array( $log ) || is_object( $log ) ) { + error_log( print_r( $log, true ) ); + } else { + error_log( $log ); + } + } +} if (!class_exists("Owark")) { class Owark { @@ -93,6 +105,8 @@ if (!class_exists("Owark")) { */ function sanity_checks(){ + // print_r_log("Sanity checks"); + // Install or upgrade tables if needed $installed_ver = get_option( "owark_db_version" ); @@ -137,13 +151,15 @@ if (!class_exists("Owark")) { } // Check if we have an archive subdirectory - - if (!is_dir(dirname(__FILE__) . '/archives')) { - @mkdir(dirname(__FILE__) . '/archives'); - if (!is_dir(dirname(__FILE__) . '/archives')) { + $archives_dir = dirname(__FILE__) . '/archives'; + if (!is_dir($archives_dir)) { + @mkdir($archives_dir); + if (!is_dir($archives_dir)) { $this->notices = $this->notices . "
The Open Web Archive has not been able to create the folder /archives in its installation directory. Please create it by hand and make it writable for the web server.
The Open Web Archive needs a writable folder /archives in its installation directory. Please make it writable for the web server.