コード例 #1
0
ファイル: install.php プロジェクト: TheFox/phpdl
						<td><?php 
        print file_exists('../tpl') ? '<b><font color="#009900">OK</font></b>' : '<b><font color="#cc0000">Failed</font></b>';
        ?>
</td>
					</tr>
					<tr>
						<td><pre>cache/tpl_c</pre></td>
						<td><?php 
        print dirWriteable('../cache/tpl_c') ? '<b><font color="#009900">OK</font></b>' : '<b><font color="#cc0000">Failed</font></b>';
        ?>
</td>
					</tr>
					<tr>
						<td><pre>cache/html</pre></td>
						<td><?php 
        print dirWriteable('../cache/html') ? '<b><font color="#009900">OK</font></b>' : '<b><font color="#cc0000">Failed</font></b>';
        ?>
</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr><td colspan="2">&nbsp;</td></tr>
		<tr>
			<td colspan="2">6. Programs</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td>
				<table border="0" cellpadding="3" cellspacing="3">
					<tr>
コード例 #2
0
ファイル: installFunction.php プロジェクト: AxelPanda/ibos
/**
 * 目录、文件权限检查
 * @param type $dirfileItems
 */
function dirfileCheck($dirfileItems)
{
    global $lang;
    $dirfileCheckRes = 1;
    foreach ($dirfileItems as $key => $item) {
        $dirfileItems[$key]['msg'] = $lang['Writeable'];
        $item_path = $item['path'];
        if ($item['type'] == 'dir') {
            if (!dirWriteable(PATH_ROOT . $item_path)) {
                if (is_dir(PATH_ROOT . $item_path)) {
                    $dirfileItems[$key]['msg'] = $lang['Unwriteable'];
                    $dirfileItems[$key]['status'] = 0;
                    $dirfileItems[$key]['current'] = '+r';
                    $dirfileCheckRes = 0;
                } else {
                    $dirfileItems[$key]['msg'] = $lang['Nodir'];
                    $dirfileItems[$key]['status'] = -1;
                    $dirfileItems[$key]['current'] = 'nodir';
                    $dirfileCheckRes = 0;
                }
            } else {
                $dirfileItems[$key]['status'] = 1;
                $dirfileItems[$key]['current'] = '+r+w';
            }
        } else {
            if (file_exists(PATH_ROOT . $item_path)) {
                if (is_writable(PATH_ROOT . $item_path)) {
                    $dirfileItems[$key]['status'] = 1;
                    $dirfileItems[$key]['current'] = '+r+w';
                } else {
                    $dirfileItems[$key]['msg'] = $lang['Unwriteable'];
                    $dirfileItems[$key]['status'] = 0;
                    $dirfileItems[$key]['current'] = '+r';
                    $dirfileCheckRes = 0;
                }
            } else {
                if (dirWriteable(dirname(PATH_ROOT . $item_path))) {
                    $dirfileItems[$key]['status'] = 1;
                    $dirfileItems[$key]['current'] = '+r+w';
                } else {
                    $dirfileItems[$key]['msg'] = $lang['Unwriteable'];
                    $dirfileItems[$key]['status'] = -1;
                    $dirfileItems[$key]['current'] = 'nofile';
                    $dirfileCheckRes = 0;
                }
            }
        }
    }
    return array('dirfileItems' => $dirfileItems, 'dirfileCheckRes' => $dirfileCheckRes);
}