本文整理汇总了PHP中Safe::mkdir_index_content方法的典型用法代码示例。如果您正苦于以下问题:PHP Safe::mkdir_index_content方法的具体用法?PHP Safe::mkdir_index_content怎么用?PHP Safe::mkdir_index_content使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Safe
的用法示例。
在下文中一共展示了Safe::mkdir_index_content方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_file
function check_file($node)
{
global $context;
global $footprints;
$key = substr($node, strlen($context['path_to_root']));
// no extension to check
if (strpos($key, '.') === FALSE) {
} elseif (!strncmp($node, 'scripts/staging', 16)) {
} elseif (!strcmp($key, 'footprints.php')) {
} elseif (!strncmp(substr($key, -9), 'index.php', 9) && ($content = Safe::file_get_contents($node)) && !strcmp($content, Safe::mkdir_index_content())) {
} elseif (!strncmp($key, 'temporary/cache_i18n_locale_', 28)) {
} elseif (!strncmp(substr($key, -4), '.php', 4)) {
// one of the parameter files created by yacs
if (preg_match('/parameters\\/(agents|control|feeds|files|hooks|letters|root|scripts|services|skins|users|virtual_.+)\\.include\\.php$/i', $key)) {
} elseif (isset($footprints[$key])) {
$expected = $footprints[$key];
$actual = Scripts::hash($node);
if ($expected[0] != $actual[0] || $expected[1] != $actual[1]) {
$context['text'] .= sprintf(i18n::s('ERROR: File %s is missing or corrupted.'), $key) . BR . "\n";
}
} else {
$context['text'] .= sprintf(i18n::s('File %s is not part of Yacs.'), $key) . BR . "\n";
}
// not a safe file
} elseif (!preg_match('/\\.(bak|bat|css|done|dtd|fdb|flv|gif|ico|jpeg|jpg|js|jsmin|htc|htm|html|mo|off|on|pdf|png|po|pot|reg|sh|sql|swf|tgz|txt|xml|zip)$/i', $key)) {
$context['text'] .= sprintf(i18n::s('File %s is not part of Yacs.'), $key) . BR . "\n";
}
}
示例2: mkdir
/**
* create a directory
*
* @param string path name
* @param int mode
* @return TRUE on success, FALSE on failure
*/
public static function mkdir($path_name, $mode = 0)
{
global $context;
// use default mask
if (!$mode) {
$mode = $context['directory_mask'];
}
// maybe path already exists
if (is_dir($path_name)) {
return TRUE;
}
// if a file has the same name
if (file_exists($path_name)) {
return FALSE;
}
// ensure call is allowed
if (is_callable('mkdir') && mkdir($path_name, $mode)) {
// create an index file to avoid browsing --direct call of file_put_contents because of absolute path
if (is_callable('file_put_contents')) {
file_put_contents($path_name . '/index.php', Safe::mkdir_index_content());
}
// mkdir has been successful
return TRUE;
}
// tough luck
return FALSE;
}