Exemple #1
0
/**
 * Cehck if dir is write-able
 *
 * @param string $dir
 * @return boolean
 */
function w3_is_writable_dir($dir)
{
    $file = $dir . '/' . uniqid(mt_rand()) . '.tmp';
    return w3_is_writable($file);
}
        <?php 
foreach ($paths as $path) {
    if ($path) {
        ?>

        <li>
            <?php 
        echo htmlspecialchars($path);
        ?>
:
            <?php 
        if (file_exists($path)) {
            ?>

                <?php 
            if (w3_is_writable($path)) {
                ?>

                <code>OK</code>
                <?php 
            } else {
                ?>

                <code>Not write-able</code>
                <?php 
            }
            ?>

            <?php 
        } else {
            ?>