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


PHP recursive_make_writable函數代碼示例

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


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

示例1: 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:stefano6310,項目名稱:SuiteCRM,代碼行數:33,代碼來源:install_utils.php

示例2: runCheck


//.........這裏部分代碼省略.........
    $cache_files[] = '/cache/layout';
    $cache_files[] = '/cache/pdf';
    $cache_files[] = '/cache/upload';
    $cache_files[] = '/cache/xml';
    $filelist = '';
    foreach ($cache_files as $c_file) {
        $dirname = "." . $c_file;
        $ok = false;
        if (is_dir($dirname) || @sugar_mkdir($dirname, 0555)) {
            $ok = make_writable($dirname);
        }
        if (!$ok) {
            $filelist .= '<br>' . getcwd() . $c_file;
        }
    }
    if (strlen($filelist) > 0) {
        $error_found = true;
        installLog("ERROR:: Some subdirectories in cache subfolder were not read/writeable:");
        installLog($filelist);
        $error_txt .= '
		<tr>
        	<td><strong>' . $mod_strings['LBL_CHECKSYS_CACHE'] . '</strong></td>
        	<td align="right" class="error" class="error"><b><span class="stop">' . $mod_strings['ERR_CHECKSYS_FILES_NOT_WRITABLE'] . '</span></b></td>
		</tr>
		<tr>
        	<td colspan="2"><b>' . $mod_strings['LBL_CHECKSYS_FIX_FILES'] . '</b>' . $filelist . '</td>
		</tr>';
    } else {
        installLog("/cache directory and subdirectory check passed");
    }
    // check modules dir
    $_SESSION['unwriteable_module_files'] = array();
    //if(!$writeableFiles['ret_val']) {
    $passed_write = recursive_make_writable('./modules');
    if (isset($_SESSION['unwriteable_module_files']['failed']) && $_SESSION['unwriteable_module_files']['failed']) {
        $passed_write = false;
    }
    if (!$passed_write) {
        $moduleStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_NOT_WRITABLE']}</span></b>";
        installLog("ERROR:: Module directories and the files under them are not writeable.");
        $error_found = true;
        $error_txt .= '
      <tr>
        <td><strong>' . $mod_strings['LBL_CHECKSYS_MODULE'] . '</strong></td>
        <td align="right" class="error">' . $moduleStatus . '</td>
      </tr>';
        //list which module directories are not writeable, if there are less than 10
        $error_txt .= '
          <tr>
            <td colspan="2">
            <b>' . $mod_strings['LBL_CHECKSYS_FIX_MODULE_FILES'] . '</b>';
        foreach ($_SESSION['unwriteable_module_files'] as $key => $file) {
            if ($key != '.' && $key != 'failed') {
                $error_txt .= '<br>' . $file;
            }
        }
        $error_txt .= '
            </td>
          </tr>';
    } else {
        installLog("/module  directory and subdirectory check passed");
    }
    // PHP.ini
    $phpIniLocation = get_cfg_var("cfg_file_path");
    installLog("php.ini location found. {$phpIniLocation}");
    // disable form if error found
開發者ID:sysraj86,項目名稱:carnivalcrm,代碼行數:67,代碼來源:installSystemCheck.php

示例3: make_writable

 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
 $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:switcode,項目名稱:SuiteCRM,代碼行數:31,代碼來源:install.php

示例4: make_writable

 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('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'));
 // 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
開發者ID:netconstructor,項目名稱:sugarcrm_dev,代碼行數:31,代碼來源:install.php

示例5: 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

示例6: runCheck


//.........這裏部分代碼省略.........
    $cache_files[] = 'layout';
    $cache_files[] = 'pdf';
    $cache_files[] = 'xml';
    $cache_files[] = 'include/javascript';
    $filelist = '';
    foreach ($cache_files as $c_file) {
        $dirname = sugar_cached($c_file);
        $ok = false;
        if (is_dir($dirname) || @sugar_mkdir($dirname, 0555)) {
            $ok = make_writable($dirname);
        }
        if (!$ok) {
            $filelist .= '<br>' . getcwd() . "/{$dirname}";
        }
    }
    if (strlen($filelist) > 0) {
        $error_found = true;
        installLog("ERROR:: Some subdirectories in cache subfolder were not read/writeable:");
        installLog($filelist);
        $error_txt .= '
		<tr>
        	<td><strong>' . $mod_strings['LBL_CHECKSYS_CACHE'] . '</strong></td>
        	<td align="right" class="error" class="error"><b><span class="stop">' . $mod_strings['ERR_CHECKSYS_FILES_NOT_WRITABLE'] . '</span></b></td>
		</tr>
		<tr>
        	<td colspan="2"><b>' . $mod_strings['LBL_CHECKSYS_FIX_FILES'] . '</b>' . $filelist . '</td>
		</tr>';
    } else {
        installLog("cache directory and subdirectory check passed");
    }
    // check modules dir
    $_SESSION['unwriteable_module_files'] = array();
    //if(!$writeableFiles['ret_val']) {
    $passed_write = recursive_make_writable('./modules');
    if (isset($_SESSION['unwriteable_module_files']['failed']) && $_SESSION['unwriteable_module_files']['failed']) {
        $passed_write = false;
    }
    if (!$passed_write) {
        $moduleStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_NOT_WRITABLE']}</span></b>";
        installLog("ERROR:: Module directories and the files under them are not writeable.");
        $error_found = true;
        $error_txt .= '
      <tr>
        <td><strong>' . $mod_strings['LBL_CHECKSYS_MODULE'] . '</strong></td>
        <td align="right" class="error">' . $moduleStatus . '</td>
      </tr>';
        //list which module directories are not writeable, if there are less than 10
        $error_txt .= '
          <tr>
            <td colspan="2">
            <b>' . $mod_strings['LBL_CHECKSYS_FIX_MODULE_FILES'] . '</b>';
        foreach ($_SESSION['unwriteable_module_files'] as $key => $file) {
            if ($key != '.' && $key != 'failed') {
                $error_txt .= '<br>' . $file;
            }
        }
        $error_txt .= '
            </td>
          </tr>';
    } else {
        installLog("/module  directory and subdirectory check passed");
    }
    // check upload dir
    if (!make_writable('./upload')) {
        $uploadStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_NOT_WRITABLE']}</span></b>";
        installLog("ERROR: Upload directory is not writable.");
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:67,代碼來源:installSystemCheck.php

示例7: make_writable

 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'));
 // public dir
 recursive_make_writable('./public');
 // 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:sacredwebsite,項目名稱:SuiteCRM,代碼行數:31,代碼來源:install.php

示例8: runCheck


//.........這裏部分代碼省略.........
    $cache_files[] = '';
    $cache_files[] = 'images';
    $cache_files[] = 'layout';
    $cache_files[] = 'pdf';
    $cache_files[] = 'xml';
    $cache_files[] = 'include/javascript';
    $filelist = '';
    foreach ($cache_files as $c_file) {
        $dirname = sugar_cached($c_file);
        $ok = false;
        if (is_dir($dirname) || @sugar_mkdir($dirname, 0755, true)) {
            $ok = make_writable($dirname);
        }
        if (!$ok) {
            $filelist .= '<br>' . getcwd() . "/{$dirname}";
        }
    }
    if (strlen($filelist) > 0) {
        $error_found = true;
        installLog("ERROR:: Some subdirectories in cache subfolder were not read/writeable:");
        installLog($filelist);
        $error_txt .= '
        	<p><strong>' . $mod_strings['LBL_CHECKSYS_CACHE'] . '</strong></p>
        	<p align="right" class="error" class="error"><b><span class="stop">' . $mod_strings['ERR_CHECKSYS_FILES_NOT_WRITABLE'] . '</span></b>

        	<p><b>' . $mod_strings['LBL_CHECKSYS_FIX_FILES'] . '</b>' . $filelist . '</p>
		';
    } else {
        installLog("cache directory and subdirectory check passed");
    }
    // check modules dir
    $_SESSION['unwriteable_module_files'] = array();
    //if(!$writeableFiles['ret_val']) {
    $passed_write = recursive_make_writable('./modules');
    if (isset($_SESSION['unwriteable_module_files']['failed']) && $_SESSION['unwriteable_module_files']['failed']) {
        $passed_write = false;
    }
    if (!$passed_write) {
        $moduleStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_NOT_WRITABLE']}</span></b>";
        installLog("ERROR:: Module directories and the files under them are not writeable.");
        $error_found = true;
        $error_txt .= '
        <p><strong>' . $mod_strings['LBL_CHECKSYS_MODULE'] . '</strong></p>
        <p align="right" class="error">' . $moduleStatus . '</p>
    ';
        //list which module directories are not writeable, if there are less than 10
        $error_txt .= '
            <b>' . $mod_strings['LBL_CHECKSYS_FIX_MODULE_FILES'] . '</b>';
        foreach ($_SESSION['unwriteable_module_files'] as $key => $file) {
            if ($key != '.' && $key != 'failed') {
                $error_txt .= '<br>' . $file;
            }
        }
        $error_txt .= '
        ';
    } else {
        installLog("/module  directory and subdirectory check passed");
    }
    // check upload dir
    if (!make_writable('./upload')) {
        $uploadStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_NOT_WRITABLE']}</span></b>";
        installLog("ERROR: Upload directory is not writable.");
        $error_found = true;
        $error_txt .= '
        <p><strong>' . $mod_strings['LBL_CHECKSYS_UPLOAD'] . '</strong></p>
        <p align="right" class="error">' . $uploadStatus . '</p>
開發者ID:MexinaD,項目名稱:SuiteCRM,代碼行數:67,代碼來源:installSystemCheck.php


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