本文整理汇总了PHP中DUP_Util::IsDirectoryEmpty方法的典型用法代码示例。如果您正苦于以下问题:PHP DUP_Util::IsDirectoryEmpty方法的具体用法?PHP DUP_Util::IsDirectoryEmpty怎么用?PHP DUP_Util::IsDirectoryEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DUP_Util
的用法示例。
在下文中一共展示了DUP_Util::IsDirectoryEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetChecks
/**
* Gets the system checks which are not required
* @return array An array of system checks
*/
public static function GetChecks()
{
$checks = array();
//WEB SERVER
$web_test1 = false;
foreach ($GLOBALS['DUPLICATOR_SERVER_LIST'] as $value) {
if (stristr($_SERVER['SERVER_SOFTWARE'], $value)) {
$web_test1 = true;
break;
}
}
$checks['SRV']['WEB']['model'] = $web_test1;
$checks['SRV']['WEB']['ALL'] = $web_test1 ? 'Good' : 'Warn';
//PHP SETTINGS
$php_test1 = ini_get("open_basedir");
$php_test1 = empty($php_test1) ? true : false;
$php_test2 = ini_get("max_execution_time");
$php_test2 = $php_test2 > DUPLICATOR_SCAN_TIMEOUT || (strcmp($php_test2, 'Off') == 0 || $php_test2 == 0) ? true : false;
$php_test3 = function_exists('mysqli_connect');
$checks['SRV']['PHP']['openbase'] = $php_test1;
$checks['SRV']['PHP']['maxtime'] = $php_test2;
$checks['SRV']['PHP']['mysqli'] = $php_test3;
$checks['SRV']['PHP']['ALL'] = $php_test1 && $php_test2 && $php_test3 ? 'Good' : 'Warn';
//WORDPRESS SETTINGS
global $wp_version;
$wp_test1 = version_compare($wp_version, DUPLICATOR_SCAN_MIN_WP) >= 0 ? true : false;
//Core Files
$files = array();
$files['wp-config.php'] = file_exists(DUP_Util::SafePath(DUPLICATOR_WPROOTPATH . '/wp-config.php'));
$wp_test2 = $files['wp-config.php'];
//Cache
$Package = DUP_Package::GetActive();
$cache_path = DUP_Util::SafePath(WP_CONTENT_DIR) . '/cache';
$dirEmpty = DUP_Util::IsDirectoryEmpty($cache_path);
$dirSize = DUP_Util::GetDirectorySize($cache_path);
$cach_filtered = in_array($cache_path, explode(';', $Package->Archive->FilterDirs));
$wp_test3 = $cach_filtered || $dirEmpty || $dirSize < DUPLICATOR_SCAN_CACHESIZE ? true : false;
$checks['SRV']['WP']['version'] = $wp_test1;
$checks['SRV']['WP']['core'] = $wp_test2;
$checks['SRV']['WP']['cache'] = $wp_test3;
$checks['SRV']['WP']['ALL'] = $wp_test1 && $wp_test2 && $wp_test3 ? 'Good' : 'Warn';
return $checks;
}
示例2: GetChecks
/**
* Gets the system checks which are not required
* @return array An array of system checks
*/
public static function GetChecks()
{
$checks = array();
//CHK-SRV-100: PHP SETTINGS
$php_test1 = ini_get("open_basedir");
$php_test1 = empty($php_test1) ? true : false;
$php_test2 = ini_get("max_execution_time");
$php_test2 = $php_test2 > DUPLICATOR_SCAN_TIMEOUT || strcmp($php_test2, 'Off') == 0 || $php_test2 == 0 ? 'Good' : 'Warn';
$checks['CHK-SRV-100'] = $php_test1 && $php_test2 ? 'Good' : 'Warn';
//CHK-SRV-101: WORDPRESS SETTINGS
//Version
global $wp_version;
$version_test = version_compare($wp_version, DUPLICATOR_SCAN_MIN_WP) >= 0 ? true : false;
//Cache
$Package = DUP_Package::GetActive();
$cache_path = DUP_Util::SafePath(WP_CONTENT_DIR) . '/cache';
$dirEmpty = DUP_Util::IsDirectoryEmpty($cache_path);
$dirSize = DUP_Util::GetDirectorySize($cache_path);
$cach_filtered = in_array($cache_path, explode(';', $Package->Archive->FilterDirs));
$cache_test = $cach_filtered || $dirEmpty || $dirSize < DUPLICATOR_SCAN_CACHESIZE ? true : false;
//Core Files
$files = array();
$files['wp-config.php'] = file_exists(DUP_Util::SafePath(DUPLICATOR_WPROOTPATH . '/wp-config.php'));
$files_test = $files['wp-config.php'];
$checks['CHK-SRV-101'] = $files_test && $cache_test && $version_test ? 'Good' : 'Warn';
//CHK-SRV-102: WEB SERVER
$servers = $GLOBALS['DUPLICATOR_SERVER_LIST'];
$test = false;
foreach ($servers as $value) {
if (stristr($_SERVER['SERVER_SOFTWARE'], $value)) {
$test = true;
break;
}
}
$checks['CHK-SRV-102'] = $test ? 'Good' : 'Warn';
//RESULTS
$result = in_array('Warn', $checks);
$checks['Success'] = !$result;
return $checks;
}
示例3: GetServerChecks
public function GetServerChecks()
{
$dup_checks = array();
//CHK-SRV-100
$test = ini_get("open_basedir");
$dup_checks['CHK-SRV-100'] = empty($test) ? 'Good' : 'Warn';
//CHK-SRV-101
$cache_path = DUP_Util::SafePath(WP_CONTENT_DIR) . '/cache';
$dirEmpty = DUP_Util::IsDirectoryEmpty($cache_path);
$dirSize = DUP_Util::GetDirectorySize($cache_path);
//50K
$dup_checks['CHK-SRV-101'] = $dirEmpty || $dirSize < 50000 ? 'Good' : 'Warn';
//CHK-SRV-102
$test = ini_get("max_execution_time");
$dup_checks['CHK-SRV-102'] = $test > DUPLICATOR_SCAN_TIMEOUT || strcmp($test, 'Off') == 0 || $test == 0 ? 'Good' : 'Warn';
//RESULTS
$result = in_array('Warn', $dup_checks);
$dup_checks['Success'] = !$result;
return $dup_checks;
}