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


PHP util::rcopy方法代码示例

本文整理汇总了PHP中util::rcopy方法的典型用法代码示例。如果您正苦于以下问题:PHP util::rcopy方法的具体用法?PHP util::rcopy怎么用?PHP util::rcopy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在util的用法示例。


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

示例1: rcopy

 public static function rcopy($src, $dst)
 {
     //hack to "fix" security issue of this becoming open API via our terrible framework
     if (strpos($_SERVER['REQUEST_URI'], 'rcopy') !== false) {
         return new return_package(6, NULL, "Attempt to bypass authentication externally.");
     }
     $dir = opendir($src);
     @mkdir($dst);
     while (false !== ($file = readdir($dir))) {
         if ($file != '.' && $file != '..') {
             if (is_dir($src . '/' . $file)) {
                 util::rcopy($src . '/' . $file, $dst . '/' . $file);
             } else {
                 copy($src . '/' . $file, $dst . '/' . $file);
             }
         }
     }
     closedir($dir);
 }
开发者ID:kimblemj,项目名称:server,代码行数:19,代码来源:util.php

示例2: count

while ($i < count($slides)) {
    if ($util->isKeyMessage($slides[$i])) {
        echo "\n" . $slides[$i] . "\n";
        if ($Relink) {
            echo "\n Relinking shared folder.\n";
            // chrdir into the current key message
            //echo("\nSlide path: " . realpath($slides[$i]) . "\n");
            chdir($slides[$i]);
            if (is_dir($globals)) {
                echo "Shared Directory Exists\n";
            } else {
                echo "Shared folder does not exist\n";
            }
            echo "Folder: " . $globals . " " . realpath($globals) . "\n";
            // add new globals
            $util->rcopy($globals, './shared');
            if ($slides[$i] == $config->getSharedFolderPrefix() . "shared") {
                echo "HTML ignored\n";
                echo "THUMB ignored\n";
                echo "PLACEHOLDER ignored\n";
            } else {
                echo "Relinking paths in files.";
                // check .html, thumbnail, and placeholder are named properly
                $criticals += $util->checkName($slides[$i], $parent_dir);
                // see if lead file is of type .html
                if (file_exists($slides[$i] . ".html")) {
                    // do find and replace inside the .html file to update the globals path
                    $filename = $slides[$i] . '.html';
                    $html = file_get_contents($filename);
                    if ($Relink) {
                        $html = str_replace("../shared", "shared", $html);
开发者ID:gregvarghese,项目名称:veeva_deployment,代码行数:31,代码来源:veeva_automation.php

示例3: str_replace

    $p_tpl_desc = !empty($_POST['p_tpl_desc']) ? $_POST['p_tpl_desc'] : '';
    $p_tpl_version = !empty($_POST['p_tpl_version']) ? $_POST['p_tpl_version'] : '';
    $p_tpl_author = !empty($_POST['p_tpl_author']) ? $_POST['p_tpl_author'] : '';
    $p_tpl_tags = !empty($_POST['p_tpl_tags']) ? $_POST['p_tpl_tags'] : '';
    $p_tpl_id = util::strToLowerURL($p_tpl_id, false);
    $sTemplate = str_replace(array($sBasicTemplateTheme . '/templates', $sBasicTemplateId . '/template.php'), array($sThemeId . '/templates', $p_tpl_id . '/template.php'), $sBasicTemplate);
    $sTemplatePath = OKT_THEMES_PATH . $sTemplate;
    if (empty($p_tpl_id)) {
        $okt->error->set(__('c_a_te_error_must_tpl_id'));
    } elseif ($p_tpl_id == $sBasicTemplateId) {
        $okt->error->set(__('c_a_te_error_same_tpl_id'));
    } elseif (file_exists($sTemplatePath)) {
        $okt->error->set(sprintf(__('c_a_te_error_tpl_%s_allready_exists'), $sTemplate));
    }
    if ($okt->error->isEmpty()) {
        util::rcopy(dirname($sBasicTemplatePath), dirname($sTemplatePath));
        file_put_contents(dirname($sTemplatePath) . '/_define.php', '<?php' . "\n\n" . '$this->aCurrent = array(' . "\n" . '	\'name\' 		=> \'' . addslashes($p_tpl_name) . '\',' . "\n" . '	\'desc\' 		=> \'' . addslashes($p_tpl_desc) . '\',' . "\n" . '	\'version\' 	=> \'' . addslashes($p_tpl_version) . '\',' . "\n" . '	\'author\' 		=> \'' . addslashes($p_tpl_author) . '\',' . "\n" . '	\'tags\' 		=> \'' . addslashes($p_tpl_tags) . '\'' . "\n" . ');' . "\n");
        $okt->redirect('configuration.php?action=theme_editor&theme=' . $sThemeId . '&file=' . rawurlencode(str_replace('/' . $sThemeId . '/templates', '/templates', $sTemplate)));
    }
}
/* Affichage
----------------------------------------------------------*/
# Infos page
$okt->page->addGlobalTitle(__('c_a_theme_editor'), 'configuration.php?action=theme_editor');
if ($sThemeId) {
    $okt->page->addGlobalTitle($oThemeEditor->getThemeInfo('name'), 'configuration.php?action=theme_editor&theme=' . $sThemeId);
}
$okt->page->addGlobalTitle(__('c_a_te_new_tpl'), 'configuration.php?action=theme_editor&theme=' . $sThemeId . '&new_file=1');
$okt->page->strToSlug('#p_tpl_name', '#p_tpl_id');
# En-tête
require OKT_ADMIN_HEADER_FILE;
开发者ID:jewelhuq,项目名称:okatea,代码行数:31,代码来源:new_template.php

示例4: exportNotes

 public static function exportNotes($pack)
 {
     $pack->auth->game_id = $pack->game_id;
     $pack->auth->permission = "read_write";
     if (!editors::authenticateGameEditor($pack->auth)) {
         return new return_package(6, NULL, "Failed Authentication");
     }
     $export = notes::getNotesForGame($pack);
     $tmp_export_folder = $pack->game_id . "_notebook_export_" . date("mdY_Gis");
     $fs_tmp_export_folder = Config::v2_gamedata_folder . "/" . $tmp_export_folder;
     if (file_exists($fs_tmp_export_folder)) {
         util::rdel($fs_tmp_export_folder);
     }
     mkdir($fs_tmp_export_folder, 0777);
     $jsonfile = fopen($fs_tmp_export_folder . "/export.json", "w");
     fwrite($jsonfile, json_encode($export));
     fclose($jsonfile);
     util::rcopy(Config::v2_gamedata_folder . "/" . $pack->game_id, $fs_tmp_export_folder . "/gamedata");
     util::rzip($fs_tmp_export_folder, $fs_tmp_export_folder . ".zip");
     util::rdel($fs_tmp_export_folder);
     return new return_package(0, Config::v2_gamedata_www_path . "/" . $tmp_export_folder . ".zip");
 }
开发者ID:kimblemj,项目名称:server,代码行数:22,代码来源:notes.php

示例5: Exception

         }
         if ($oZip->isEmpty()) {
             $oZip->close();
             files::deltree($sTempDir);
             throw new Exception(__('c_a_config_display_empty_zip_file'));
         }
         if (!$hasCssFile) {
             $oZip->close();
             files::deltree($sTempDir);
             throw new Exception(__('c_a_config_display_not_valid_theme'));
         }
         $oZip->unzipAll($sTempDir);
         $oZip->close();
         debug($sTempDir);
         $sFinalPath = OKT_PUBLIC_PATH . '/ui-themes/custom';
         util::rcopy($sTempDir . $zip_root_dir . '/css/custom-theme', $sFinalPath);
         rename($sFinalPath . '/' . basename($sTargetDir) . '.css', $sFinalPath . '/jquery-ui.css');
         rename($sFinalPath . '/' . basename($sTargetDir) . '.min.css', $sFinalPath . '/jquery-ui.min.css');
         files::deltree($sTempDir);
         $_POST['p_admin_theme'] = 'custom';
     } catch (Exception $e) {
         files::deltree($sTempDir);
         $okt->error->set($e->getMessage());
     }
 }
 # enregistrement de la configuration
 $p_public_theme = !empty($_POST['p_public_theme']) ? $_POST['p_public_theme'] : 'base';
 $p_enable_admin_bar = !empty($_POST['p_enable_admin_bar']) ? true : false;
 $p_admin_sidebar_position = !empty($_POST['p_admin_sidebar_position']) ? intval($_POST['p_admin_sidebar_position']) : 0;
 $p_admin_theme = !empty($_POST['p_admin_theme']) ? $_POST['p_admin_theme'] : 'base';
 $p_admin_compress_output = !empty($_POST['p_admin_compress_output']) ? true : false;
开发者ID:jewelhuq,项目名称:okatea,代码行数:31,代码来源:display.php


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