当前位置: 首页>>代码示例>>PHP>>正文


PHP recurse_copy函数代码示例

本文整理汇总了PHP中recurse_copy函数的典型用法代码示例。如果您正苦于以下问题:PHP recurse_copy函数的具体用法?PHP recurse_copy怎么用?PHP recurse_copy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了recurse_copy函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: copy_vendor

 function copy_vendor()
 {
     if (!file_exists($this->export_location . '/public/vendor/')) {
         mkdir($this->export_location . '/public/vendor/', 0777, true);
     }
     recurse_copy(WWW_FOLDER . '/public/vendor', $this->export_location . '/public/vendor');
     echo '{"status":"success", "message":"Vendor files copied."}';
 }
开发者ID:biladina,项目名称:pusakacms,代码行数:8,代码来源:Panel.php

示例2: recurse_copy

 function recurse_copy($source, $dest)
 {
     // Check for symlinks
     if (is_link($source)) {
         return symlink(readlink($source), $dest);
     }
     // Simple copy for a file
     if (is_file($source)) {
         return copy($source, $dest);
     }
     // Make destination directory
     if (!is_dir($dest)) {
         mkdir($dest);
     }
     // Loop through the folder
     $dir = dir($source);
     while (false !== ($entry = $dir->read())) {
         // Skip pointers
         if ($entry == '.' || $entry == '..') {
             continue;
         }
         // Deep copy directories
         recurse_copy("{$source}/{$entry}", "{$dest}/{$entry}");
     }
     // Clean up
     $dir->close();
     return true;
 }
开发者ID:NustechPvtLtd,项目名称:webzero,代码行数:28,代码来源:MY_file_helper.php

示例3: changeWidgetDir

 function changeWidgetDir($newDir)
 {
     $defaultDir = str_replace('//', '/', str_replace('\\', '/', dirname(plugin_dir_path(__FILE__)))) . '/custom-widgets/';
     if (empty($newDir) || get_option('preset-cdwd') == TRUE || get_option('widgetdir') == '/') {
         $newDir = $defaultDir;
         $dirchange = TRUE;
     }
     $newDir = str_replace('//', '/', str_replace('\\', '/', $newDir));
     $wpdir = str_replace('//', '/', str_replace('\\', '/', wp_upload_dir()));
     $plugindir = str_replace('//', '/', str_replace('\\', '/', dirname(plugin_dir_path(__FILE__))));
     if (WPWM_DEBUG == 1) {
         $error = TRUE;
         $errmsg = "Debug Mode enabled, unrestricted  directory changes permitted";
     } else {
         if (strstr($newDir, $plugindir) == FALSE) {
             $error = TRUE;
             $errmsg = " ERROR-Custom Widget Directory must be within Wordpress manager plugin directory. The default had been set instead of " . $newDir . '<br/>';
             $newDir = dirname(plugin_dir_path(__FILE__)) . '/custom-widgets/';
             $dirchange = TRUE;
         }
     }
     $dirchange = TRUE;
     $newDir = str_replace('//', '/', str_replace('\\', '/', $newDir));
     if (file_exists($newDir) == FALSE) {
         $dirDiff = true;
         mkdir($newDir, 0755);
         $user = exec(whoami);
         chown($newDir, $user);
     }
     $sourceDir = get_option('widgetdir');
     if (file_exists($sourceDir)) {
         $sourceDir = str_replace('//', '/', str_replace('\\', '/', $sourceDir));
         if (strcmp($sourceDir, $wpdir['basedir']) != 0) {
             $contents = scandir($sourceDir);
             if (SUBSTR($newDir, -1) != '/') {
                 $newDir .= '/';
             }
             foreach ($contents as $widgets) {
                 if ($widgets != "." && $widgets != "..") {
                     recurse_copy($sourceDir, $newDir);
                 }
             }
             if ($sourceDir != $newDir) {
                 if ($sourceDir != $defaultDir) {
                     $check = recursiveRemove($sourceDir);
                 }
             }
         }
     }
     update_option('widgetdir', $newDir);
     msgDisplay($error, $errmsg, $dirchange, $dirDiff);
 }
开发者ID:JasonDarkX2,项目名称:Wordpress-WidgetManager,代码行数:52,代码来源:settings.php

示例4: main

 public function main()
 {
     if (!is_dir($this->targetDir)) {
         throw new BuildException("Invalid symlink target {$this->targetDir}");
     }
     foreach ($this->items as $item) {
         // if there's a source dir set, we're assuming everything is coming from that dir
         $sourceItem = $this->sourceDir ? $this->sourceDir . '/' . $item : $item;
         if (!recurse_copy($sourceItem, $this->targetDir . '/' . $item)) {
             throw new BuildException("Failed copying from {$sourceItem} to " . $this->targetDir);
         }
     }
 }
开发者ID:helpfulrobot,项目名称:silverstripe-australia-build,代码行数:13,代码来源:CopyFoldersTask.php

示例5: recurse_copy

 public function recurse_copy($src, $dst)
 {
     $hm = openhm($src);
     @mkhm($dst);
     while (false !== ($file = readhm($hm))) {
         if ($file != '.' && $file != '..') {
             if (is_hm($src . '/' . $file)) {
                 recurse_copy($src . '/' . $file, $dst . '/' . $file);
             } else {
                 copy($src . '/' . $file, $dst . '/' . $file);
             }
         }
     }
     closehm($hm);
 }
开发者ID:RedstoneAlmeida,项目名称:MapReset,代码行数:15,代码来源:Perms.php

示例6: recurse_copy

function recurse_copy($src, $dst)
{
    $dir = opendir($src);
    @mkdir($dst, '01777', TRUE);
    while (false !== ($file = readdir($dir))) {
        if ($file != '.' && $file != '..') {
            if (is_dir($src . '/' . $file)) {
                recurse_copy($src . '/' . $file, $dst . '/' . $file);
            } else {
                copy($src . '/' . $file, $dst . '/' . $file);
            }
        }
    }
    closedir($dir);
}
开发者ID:erdoking,项目名称:TreeTrumpet,代码行数:15,代码来源:build.php

示例7: recurse_copy

/** 
 * Taken from: http://php.net/manual/en/function.copy.php
 * 
 * Recursively copies a directory from $src to $dst.
 * If $dst does not exist it is created.
 * Omits .svn directories.
 * Omits .git directories.
 **/
function recurse_copy($src, $dst)
{
    $dir = opendir($src);
    @mkdir($dst, 0775, true);
    while (false !== ($file = readdir($dir))) {
        if ($file != '.' && $file != '..' && $file != '.svn' && $file != '.git') {
            if (is_dir($src . '/' . $file)) {
                recurse_copy($src . '/' . $file, $dst . '/' . $file);
            } else {
                copy($src . '/' . $file, $dst . '/' . $file);
            }
        }
    }
    closedir($dir);
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:23,代码来源:utils.php

示例8: WPPortfolio_fileCopyRecursive

/**
 * A recursive function to copy all subdirectories and their contents.
 * @param $src The source directory
 * @param $dst The target directory
 */
function WPPortfolio_fileCopyRecursive($src, $dst)
{
    $dir = opendir($src);
    @mkdir($dst);
    while (false !== ($file = readdir($dir))) {
        if ($file != '.' && $file != '..') {
            if (is_dir($src . '/' . $file)) {
                recurse_copy($src . '/' . $file, $dst . '/' . $file);
            } else {
                copy($src . '/' . $file, $dst . '/' . $file);
            }
        }
    }
    // end while
    closedir($dir);
}
开发者ID:hscale,项目名称:webento,代码行数:21,代码来源:utils.inc.php

示例9: recurse_copy

function recurse_copy($src, $dst)
{
    $success = true;
    $dir = opendir($src);
    @mkdir($dst);
    while (false !== ($file = readdir($dir))) {
        if ($file != '.' && $file != '..') {
            if (is_dir($src . '/' . $file)) {
                $success = $success && recurse_copy($src . '/' . $file, $dst . '/' . $file);
            } else {
                $success = $success && copy($src . '/' . $file, $dst . '/' . $file);
            }
        }
    }
    closedir($dir);
    return $success;
}
开发者ID:debruine,项目名称:webmorph,代码行数:17,代码来源:fileCopy.php

示例10: recurse_copy_files

 protected function recurse_copy_files($src, $dst)
 {
     $dir = opendir($src);
     if (!file_exists($dst)) {
         mkdir($dst, 0777, true);
     }
     while (false !== ($file = readdir($dir))) {
         if ($file != '.' && $file != '..') {
             if (is_dir($src . '/' . $file)) {
                 recurse_copy($src . '/' . $file, $dst . '/' . $file);
             } else {
                 copy($src . '/' . $file, $dst . '/' . $file);
             }
         }
     }
     closedir($dir);
 }
开发者ID:pinky28,项目名称:demo_congrea,代码行数:17,代码来源:restore_congrea_stepslib.php

示例11: recurse_copy

/**
 * @param string $source
 * @param string $destination
 *
 * @see http://stackoverflow.com/a/2050909/736809
 */
function recurse_copy($source, $destination)
{
    $dir = opendir($source);
    @mkdir($destination);
    while (false !== ($file = readdir($dir))) {
        if (!in_array($file, ['.', '..'])) {
            if (is_dir($source . '/' . $file)) {
                recurse_copy(sprintf('%s/%s', $source, $file), sprintf('%s/%s', $destination, $file));
                //recurse_copy($source . '/' . $file,$destination . '/' . $file);
            } else {
                copy(sprintf('%s/%s', $source, $file), sprintf('%s/%s', $destination, $file));
                //copy($source . '/' . $file, $destination . '/' . $file);
            }
        }
    }
    closedir($dir);
}
开发者ID:j7mbo,项目名称:aurex,代码行数:23,代码来源:install.php

示例12: recurse_copy

function recurse_copy($dossier, $demoUrlDir)
{
    $dir = opendir($dossier);
    if (!file_exists($demoUrlDir)) {
        @mkdir($demoUrlDir);
    }
    while (false !== ($file = readdir($dir))) {
        if ($file != '.' && $file != '..') {
            /* Add */
            if (is_dir($dossier . '/' . $file)) {
                recurse_copy($dossier . '/' . $file, $demoUrlDir . '/' . $file);
            } else {
                copy($dossier . '/' . $file, $demoUrlDir . '/' . $file);
            }
        }
    }
    closedir($dir);
}
开发者ID:WCBLINKEO,项目名称:LINKAPI,代码行数:18,代码来源:create_user_session.php

示例13: filecopy

 protected function filecopy($tmpFolder)
 {
     $dir0s = ob_scandir($tmpFolder);
     // copy module to cubi/upgrade folder
     foreach ($dir0s as $dir0) {
         $dirs = ob_scandir($tmpFolder . "/{$dir0}");
         foreach ($dirs as $dir) {
             $srcDir = $tmpFolder . "/{$dir0}/{$dir}";
             $dstDir = $dir == 'modules' ? OPENBIZ_APP_PATH . "/upgrade/modules" : OPENBIZ_APP_PATH . "/{$dir}";
             echo "copy {$srcDir} to {$dstDir} \n";
             recurse_copy($srcDir, $dstDir);
             if ($dir == 'modules') {
                 $this->_upgradeModules = ob_scandir($srcDir);
             }
         }
     }
     //print_r($this->_upgradeModules);
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:18,代码来源:UpgradeService.php

示例14: createProject

 public function createProject($projectName, $projectDir)
 {
     ControllerTray::instance()->renderLayout = false;
     $this->data->success = false;
     $this->data->projectName = $projectName;
     if (!\Fstab::instance()->addProject($projectName, $projectDir)) {
         return false;
     }
     \Fstab::instance()->save();
     $commonProject = \Path::instance()->evaluate("common.template.prj");
     $projectPath = \Path::instance()->evaluate(":{$projectName}.root") . "{$projectDir}";
     if (!is_dir($projectPath)) {
         if (!recurse_copy($commonProject, $projectPath)) {
             $this->data->success = false;
         } else {
             $this->data->success = true;
         }
     }
 }
开发者ID:neel,项目名称:bong,代码行数:19,代码来源:project.php

示例15: recurse_copy

function recurse_copy($src, $dst)
{
    $dir = opendir($src);
    @mkdir($dst);
    while (false !== ($file = readdir($dir))) {
        if ($file != '.' && $file != '..') {
            if (is_dir($src . '/' . $file)) {
                recurse_copy($src . '/' . $file, $dst . '/' . $file);
                echo 'Copying: ' . $src . '/' . $file . ' to ' . $dst . '/' . $file . '<br />';
            } else {
                copy($src . '/' . $file, $dst . '/' . $file);
                echo 'Copying: ' . $src . '/' . $file . ' to ' . $dst . '/' . $file . '<br />';
            }
            //end if/else
        }
        //end out if
    }
    //end while loop
    closedir($dir);
}
开发者ID:kcoltharp,项目名称:InternetProgramming,代码行数:20,代码来源:move.php


注:本文中的recurse_copy函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。