當前位置: 首頁>>代碼示例>>PHP>>正文


PHP make_writable函數代碼示例

本文整理匯總了PHP中make_writable函數的典型用法代碼示例。如果您正苦於以下問題:PHP make_writable函數的具體用法?PHP make_writable怎麽用?PHP make_writable使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了make_writable函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: create_writable_dir

function create_writable_dir($dirname)
{
    if (is_dir($dirname) || @sugar_mkdir($dirname, 0755)) {
        $ok = make_writable($dirname);
    }
    if (empty($ok)) {
        installLog("ERROR: Cannot create writable dir {$dirname}");
    }
}
開發者ID:stefano6310,項目名稱:SuiteCRM,代碼行數:9,代碼來源:install_utils.php

示例2: saveOverride

 function saveOverride($override)
 {
     require_once 'install/install_utils.php';
     if (!file_exists('config_override.php')) {
         touch('config_override.php');
     }
     if (!make_writable('config_override.php') || !is_writable('config_override.php')) {
         $GLOBALS['log']->fatal("Unable to write to the config_override.php file. Check the file permissions");
         return;
     }
     $fp = sugar_fopen('config_override.php', 'w');
     fwrite($fp, $override);
     fclose($fp);
 }
開發者ID:sunmo,項目名稱:snowlotus,代碼行數:14,代碼來源:Configurator.php

示例3: recursive_make_writable

function recursive_make_writable($start_file)
{
    $ret_val = make_writable($start_file);
    if ($ret_val && is_dir($start_file)) {
        // PHP 4 alternative to scandir()
        $files = array();
        $dh = opendir($start_file);
        $filename = readdir($dh);
        while (!empty($filename)) {
            if ($filename != '.' && $filename != '..' && $filename != '.svn') {
                $files[] = $filename;
            }
            $filename = readdir($dh);
        }
        foreach ($files as $file) {
            $ret_val = recursive_make_writable($start_file . '/' . $file);
            if (!$ret_val) {
                $_SESSION['unwriteable_module_files'][dirname($file)] = dirname($file);
                $fnl_ret_val = false;
                //break;
            }
        }
    }
    if (!$ret_val) {
        $unwriteable_directory = is_dir($start_file) ? $start_file : dirname($start_file);
        if ($unwriteable_directory[0] == '.') {
            $unwriteable_directory = substr($unwriteable_directory, 1);
        }
        $_SESSION['unwriteable_module_files'][$unwriteable_directory] = $unwriteable_directory;
        $_SESSION['unwriteable_module_files']['failed'] = true;
    }
    return $ret_val;
}
開發者ID:klr2003,項目名稱:sourceread,代碼行數:33,代碼來源:install_utils.php

示例4: runCheck


//.........這裏部分代碼省略.........
    if (!function_exists('xml_parser_create')) {
        $xmlStatus = "<b><span class=stop>{$mod_strings['LBL_CHECKSYS_XML_NOT_AVAILABLE']}</span></b>";
        installLog("ERROR:: {$mod_strings['LBL_CHECKSYS_XML_NOT_AVAILABLE']}");
        $error_found = true;
        $error_txt .= '
      <tr>
        <td><strong>' . $mod_strings['LBL_CHECKSYS_XML'] . '</strong></td>
        <td class="error">' . $xmlStatus . '</td>
      </tr>';
    } else {
        installLog("XML Parsing Support Found");
    }
    // mbstrings
    if (!function_exists('mb_strlen')) {
        $mbstringStatus = "<b><span class=stop>{$mod_strings['ERR_CHECKSYS_MBSTRING']}</font></b>";
        installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_MBSTRING']}");
        $error_found = true;
        $error_txt .= '
      <tr>
        <td><strong>' . $mod_strings['LBL_CHECKSYS_MBSTRING'] . '</strong></td>
        <td class="error">' . $mbstringStatus . '</td>
      </tr>';
    } else {
        installLog("MBString Support Found");
    }
    // zip
    if (!class_exists('ZipArchive')) {
        $zipStatus = "<b><span class=stop>{$mod_strings['ERR_CHECKSYS_ZIP']}</font></b>";
        installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_ZIP']}");
    } else {
        installLog("ZIP Support Found");
    }
    // config.php
    if (file_exists('./config.php') && (!make_writable('./config.php') || !is_writable('./config.php'))) {
        installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_CONFIG_NOT_WRITABLE']}");
        $configStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_CONFIG_NOT_WRITABLE']}</span></b>";
        $error_found = true;
        $error_txt .= '
      <tr>
        <td><strong>' . $mod_strings['LBL_CHECKSYS_CONFIG'] . '</strong></td>
        <td class="error">' . $configStatus . '</td>
      </tr>';
    }
    // custom dir
    if (!make_writable('./custom')) {
        $customStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_CUSTOM_NOT_WRITABLE']}</font></b>";
        installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_CUSTOM_NOT_WRITABLE']}");
        $error_found = true;
        $error_txt .= '
      <tr>
        <td><strong>' . $mod_strings['LBL_CHECKSYS_CUSTOM'] . '</strong></td>
        <td class="error">' . $customStatus . '</td>
      </tr>';
    } else {
        installLog("/custom directory and subdirectory check passed");
    }
    // data dir
    if (!make_writable('./data') || !make_writable('./data/upload')) {
        $dataStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_FILES_NOT_WRITABLE']}</span></b>";
        installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_FILES_NOT_WRITABLE']}");
        $error_found = true;
        $error_txt .= '
      <tr>
        <td><strong>' . $mod_strings['LBL_CHECKSYS_DATA'] . '</strong></td>
        <td class="error">' . $dataStatus . '</td>
      </tr><tr>
開發者ID:sysraj86,項目名稱:carnivalcrm,代碼行數:67,代碼來源:installSystemCheck.php

示例5: validate_siteConfig

 }
 $validation_errors = validate_siteConfig('b');
 if (count($validation_errors) > 0) {
     $the_file = 'siteConfig_b.php';
     $si_errors = true;
 }
 if (!$si_errors) {
     $the_file = 'performSetup.php';
 }
 require_once 'jssource/minify.php';
 //since this is a SilentInstall we still need to make sure that
 //the appropriate files are writable
 // config.php
 make_writable('./config.php');
 // custom dir
 make_writable('./custom');
 // modules dir
 recursive_make_writable('./modules');
 // cache dir
 create_writable_dir(sugar_cached('custom_fields'));
 create_writable_dir(sugar_cached('dyn_lay'));
 create_writable_dir(sugar_cached('images'));
 create_writable_dir(sugar_cached('modules'));
 create_writable_dir(sugar_cached('layout'));
 create_writable_dir(sugar_cached('pdf'));
 create_writable_dir(sugar_cached('upload/import'));
 create_writable_dir(sugar_cached('xml'));
 create_writable_dir(sugar_cached('include/javascript'));
 recursive_make_writable(sugar_cached('modules'));
 // check whether we're getting this request from a command line tool
 // we want to output brief messages if we're outputting to a command line tool
開發者ID:switcode,項目名稱:SuiteCRM,代碼行數:31,代碼來源:install.php

示例6: make_writable

 // custom dir
 make_writable('./custom');
 // modules dir
 recursive_make_writable('./modules');
 // data dir
 make_writable('./data');
 make_writable('./data/upload');
 // cache dir
 make_writable('./cache/custom_fields');
 make_writable('./cache/dyn_lay');
 make_writable('./cache/images');
 make_writable('./cache/import');
 make_writable('./cache/layout');
 make_writable('./cache/pdf');
 make_writable('./cache/upload');
 make_writable('./cache/xml');
 // check whether we're getting this request from a command line tool
 // we want to output brief messages if we're outputting to a command line tool
 $cli_mode = false;
 if (isset($_REQUEST['cli']) && $_REQUEST['cli'] == 'true') {
     $_SESSION['cli'] = true;
     // if we have errors, just shoot them back now
     if (count($validation_errors) > 0) {
         foreach ($validation_errors as $error) {
             print $mod_strings['ERR_ERROR_GENERAL'] . "\n";
             print "    " . $error . "\n";
             print "Exit 1\n";
             exit(1);
         }
     }
 }
開發者ID:aldridged,項目名稱:gtg-sugar,代碼行數:31,代碼來源:install.php

示例7: recursive_make_writable

function recursive_make_writable($start_file)
{
    $ret_val = make_writable($start_file);
    if ($ret_val && is_dir($start_file)) {
        // PHP 4 alternative to scandir()
        $files = array();
        $dh = opendir($start_file);
        $filename = readdir($dh);
        while (!empty($filename)) {
            if ($filename != '.' && $filename != '..') {
                $files[] = $filename;
            }
            $filename = readdir($dh);
        }
        foreach ($files as $file) {
            $ret_val = recursive_make_writable($start_file . '/' . $file);
            if (!$ret_val) {
                break;
            }
        }
    }
    return $ret_val;
}
開發者ID:BackupTheBerlios,項目名稱:livealphaprint,代碼行數:23,代碼來源:install_utils.php

示例8: isset

// modules dir
if (recursive_make_writable('./modules')) {
    $moduleStatus = "<b><span class=go>{$mod_strings['LBL_CHECKSYS_OK']}</span></b>";
} else {
    $moduleStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_NOT_WRITABLE']}</span></b>";
    $error_found = true;
}
// data dir
if (make_writable('./data') && make_writable('./data/upload')) {
    $dataStatus = "<b><span class=go>{$mod_strings['LBL_CHECKSYS_OK']}</span></b>";
} else {
    $dataStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_NOT_WRITABLE']}</span></b>";
    $error_found = true;
}
// cache dir
if (make_writable('./cache/custom_fields') && make_writable('./cache/dyn_lay') && make_writable('./cache/images') && make_writable('./cache/import') && make_writable('./cache/layout') && make_writable('./cache/pdf') && make_writable('./cache/upload') && make_writable('./cache/xml')) {
    $cacheStatus = "<b><span class=go>{$mod_strings['LBL_CHECKSYS_OK']}</span></b>";
} else {
    $cacheStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_NOT_WRITABLE']}</span></b>";
    $error_found = true;
}
// session save dir
$temp_dir = isset($_ENV['TEMP']) ? $_ENV['TEMP'] : "";
$session_save_path = session_save_path() === "" ? $temp_dir : session_save_path();
if (strpos($session_save_path, ";") !== FALSE) {
    $session_save_path = substr($session_save_path, strpos($session_save_path, ";") + 1);
}
if (is_dir($session_save_path)) {
    if (is_writable($session_save_path)) {
        $sessionStatus = "<b><span class=go>{$mod_strings['LBL_CHECKSYS_OK']}</span></b>";
    } else {
開發者ID:BackupTheBerlios,項目名稱:livealphaprint,代碼行數:31,代碼來源:checkSystem.php

示例9: runCheck


//.........這裏部分代碼省略.........
    if (!function_exists('xml_parser_create')) {
        $xmlStatus = "<b><span class=stop>{$mod_strings['LBL_CHECKSYS_XML_NOT_AVAILABLE']}</span></b>";
        installLog("ERROR:: {$mod_strings['LBL_CHECKSYS_XML_NOT_AVAILABLE']}");
        $error_found = true;
        $error_txt .= '
      <tr>
        <td><strong>' . $mod_strings['LBL_CHECKSYS_XML'] . '</strong></td>
        <td class="error">' . $xmlStatus . '</td>
      </tr>';
    } else {
        installLog("XML Parsing Support Found");
    }
    // mbstrings
    if (!function_exists('mb_strlen')) {
        $mbstringStatus = "<b><span class=stop>{$mod_strings['ERR_CHECKSYS_MBSTRING']}</font></b>";
        installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_MBSTRING']}");
        $error_found = true;
        $error_txt .= '
      <tr>
        <td><strong>' . $mod_strings['LBL_CHECKSYS_MBSTRING'] . '</strong></td>
        <td class="error">' . $mbstringStatus . '</td>
      </tr>';
    } else {
        installLog("MBString Support Found");
    }
    // zip
    if (!class_exists('ZipArchive')) {
        $zipStatus = "<b><span class=stop>{$mod_strings['ERR_CHECKSYS_ZIP']}</font></b>";
        installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_ZIP']}");
    } else {
        installLog("ZIP Support Found");
    }
    // config.php
    if (file_exists('./config.php') && (!make_writable('./config.php') || !is_writable('./config.php'))) {
        installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_CONFIG_NOT_WRITABLE']}");
        $configStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_CONFIG_NOT_WRITABLE']}</span></b>";
        $error_found = true;
        $error_txt .= '
      <tr>
        <td><strong>' . $mod_strings['LBL_CHECKSYS_CONFIG'] . '</strong></td>
        <td class="error">' . $configStatus . '</td>
      </tr>';
    }
    // config_override.php
    if (file_exists('./config_override.php') && (!make_writable('./config_override.php') || !is_writable('./config_override.php'))) {
        installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_CONFIG_OVERRIDE_NOT_WRITABLE']}");
        $configStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_CONFIG_OVERRIDE_NOT_WRITABLE']}</span></b>";
        $error_found = true;
        $error_txt .= '
      <tr>
        <td><strong>' . $mod_strings['LBL_CHECKSYS_OVERRIDE_CONFIG'] . '</strong></td>
        <td class="error">' . $configStatus . '</td>
      </tr>';
    }
    // custom dir
    if (!make_writable('./custom')) {
        $customStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_CUSTOM_NOT_WRITABLE']}</font></b>";
        installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_CUSTOM_NOT_WRITABLE']}");
        $error_found = true;
        $error_txt .= '
      <tr>
        <td><strong>' . $mod_strings['LBL_CHECKSYS_CUSTOM'] . '</strong></td>
        <td class="error">' . $customStatus . '</td>
      </tr>';
    } else {
        installLog("/custom directory and subdirectory check passed");
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:67,代碼來源:installSystemCheck.php

示例10: runCheck


//.........這裏部分代碼省略.........
    }
    // XML Parsing
    if (!function_exists('xml_parser_create')) {
        $xmlStatus = "<b><span class=stop>{$mod_strings['LBL_CHECKSYS_XML_NOT_AVAILABLE']}</span></b>";
        installLog("ERROR:: {$mod_strings['LBL_CHECKSYS_XML_NOT_AVAILABLE']}");
        $error_found = true;
        $error_txt .= '
        <p><strong>' . $mod_strings['LBL_CHECKSYS_XML'] . '</strong></p>
        <p class="error">' . $xmlStatus . '</p>
    ';
    } else {
        installLog("XML Parsing Support Found");
    }
    // mbstrings
    if (!function_exists('mb_strlen')) {
        $mbstringStatus = "<b><span class=stop>{$mod_strings['ERR_CHECKSYS_MBSTRING']}</font></b>";
        installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_MBSTRING']}");
        $error_found = true;
        $error_txt .= '
        <p><strong>' . $mod_strings['LBL_CHECKSYS_MBSTRING'] . '</strong></p>
        <p class="error">' . $mbstringStatus . '</p>
    ';
    } else {
        installLog("MBString Support Found");
    }
    // zip
    if (!class_exists('ZipArchive')) {
        $zipStatus = "<b><span class=stop>{$mod_strings['ERR_CHECKSYS_ZIP']}</font></b>";
        installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_ZIP']}");
    } else {
        installLog("ZIP Support Found");
    }
    // config.php
    if (file_exists('./config.php') && (!make_writable('./config.php') || !is_writable('./config.php'))) {
        installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_CONFIG_NOT_WRITABLE']}");
        $configStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_CONFIG_NOT_WRITABLE']}</span></b>";
        $error_found = true;
        $error_txt .= '
        <p><strong>' . $mod_strings['LBL_CHECKSYS_CONFIG'] . '</strong></p>
        <p class="error">' . $configStatus . '</p>
    ';
    }
    // config_override.php
    if (file_exists('./config_override.php') && (!make_writable('./config_override.php') || !is_writable('./config_override.php'))) {
        installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_CONFIG_OVERRIDE_NOT_WRITABLE']}");
        $configStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_CONFIG_OVERRIDE_NOT_WRITABLE']}</span></b>";
        $error_found = true;
        $error_txt .= '
        <p><strong>' . $mod_strings['LBL_CHECKSYS_OVERRIDE_CONFIG'] . '</strong></p>
        <p class="error">' . $configStatus . '</p>
    ';
    }
    // custom dir
    if (!make_writable('./custom')) {
        $customStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_CUSTOM_NOT_WRITABLE']}</font></b>";
        installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_CUSTOM_NOT_WRITABLE']}");
        $error_found = true;
        $error_txt .= '
        <p><strong>' . $mod_strings['LBL_CHECKSYS_CUSTOM'] . '</strong></p>
        <p class="error">' . $customStatus . '</p>
    ';
    } else {
        installLog("/custom directory and subdirectory check passed");
    }
    // cache dir
    $cache_files[] = '';
開發者ID:MexinaD,項目名稱:SuiteCRM,代碼行數:67,代碼來源:installSystemCheck.php


注:本文中的make_writable函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。