• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getImportDir函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: compareFiles

function compareFiles($file_a, $file_b)
{
    $dir = getImportDir();
    $time_a = filemtime($dir . '/' . $file_a);
    $time_b = filemtime($dir . '/' . $file_b);
    if ($time_a == $time_b) {
        return 0;
    }
    return $time_a > $time_b ? -1 : 1;
}
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:10,代码来源:function_import_folder.inc.php


示例2: execute

 public function execute()
 {
     include_once rex_path::addon('import_export', 'functions/function_import_export.php');
     include_once rex_path::addon('import_export', 'functions/function_import_folder.php');
     $filename = $this->getParam('filename', self::DEFAULT_FILENAME);
     $filename = str_replace('%REX_SERVER', parse_url(rex::getServer(), PHP_URL_HOST), $filename);
     $filename = str_replace('%REX_VERSION', rex::getVersion(), $filename);
     $filename = strftime($filename);
     $file = $filename;
     $dir = getImportDir() . '/';
     $ext = '.sql';
     if (file_exists($dir . $file . $ext)) {
         $i = 1;
         while (file_exists($dir . $file . '_' . $i . $ext)) {
             ++$i;
         }
         $file = $file . '_' . $i;
     }
     if (rex_a1_export_db($dir . $file . $ext)) {
         $message = $file . $ext . ' created';
         if ($this->sendmail) {
             if (!rex_addon::get('phpmailer')->isAvailable()) {
                 $this->setMessage($message . ', mail not sent (addon "phpmailer" isn\'t activated)');
                 return false;
             }
             $mail = new rex_mailer();
             $mail->AddAddress($this->mailaddress);
             $mail->Subject = rex_i18n::msg('im_export_mail_subject');
             $mail->Body = rex_i18n::msg('im_export_mail_body', rex::getServerName());
             $mail->AddAttachment($dir . $file . $ext, $filename . $ext);
             if ($mail->Send()) {
                 $this->setMessage($message . ', mail sent');
                 return true;
             }
             $this->setMessage($message . ', mail not sent');
             return false;
         }
         $this->setMessage($message);
         return true;
     }
     $this->setMessage($file . $ext . ' not created');
     return false;
 }
开发者ID:skerbis,项目名称:redaxo,代码行数:43,代码来源:cronjob.php


示例3: execute

 function execute()
 {
     global $REX;
     include_once $REX['INCLUDE_PATH'] . '/addons/import_export/functions/function_import_export.inc.php';
     include_once $REX['INCLUDE_PATH'] . '/addons/import_export/functions/function_import_folder.inc.php';
     $file = 'rex_' . $REX['VERSION'] . '_' . date("Ymd");
     $dir = getImportDir() . '/';
     $ext = '.sql';
     if (file_exists($dir . $file . $ext)) {
         $i = 1;
         while (file_exists($dir . $file . '_' . $i . $ext)) {
             $i++;
         }
         $file = $file . '_' . $i;
     }
     if (rex_a1_export_db($dir . $file . $ext)) {
         $this->setMessage($file . $ext . ' created');
         return true;
     }
     return false;
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:21,代码来源:class.cronjob.inc.php


示例4: execute

 function execute()
 {
     global $REX;
     include_once $REX['INCLUDE_PATH'] . '/addons/import_export/functions/function_import_export.inc.php';
     include_once $REX['INCLUDE_PATH'] . '/addons/import_export/functions/function_import_folder.inc.php';
     $server = preg_replace('@^https?://|/.*|[^\\w.-]@', '', $REX['SERVER']);
     $file = strtolower($server) . '_rex' . $REX['VERSION'] . $REX['SUBVERSION'] . $REX['MINORVERSION'] . '_' . date('Ymd_Hi');
     $dir = getImportDir() . '/';
     $ext = '.sql';
     if (file_exists($dir . $file . $ext)) {
         $i = 1;
         while (file_exists($dir . $file . '_' . $i . $ext)) {
             $i++;
         }
         $file = $file . '_' . $i;
     }
     if (rex_a1_export_db($dir . $file . $ext)) {
         $this->setMessage($file . $ext . ' created');
         return true;
     }
     return false;
 }
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:22,代码来源:class.cronjob.inc.php


示例5: loadExistingImport

 public static function loadExistingImport($import_name)
 {
     // ----- vorhandenen Export importieren
     $err_msg = '';
     if ($import_name == '') {
         $err_msg .= '<p>' . rex_i18n::msg('setup_508') . '</p>';
     } else {
         $import_sql = getImportDir() . '/' . $import_name . '.sql';
         $import_archiv = getImportDir() . '/' . $import_name . '.tar.gz';
         // Nur hier zuerst die Addons installieren
         // Da sonst Daten aus dem eingespielten Export
         // Überschrieben würden
         // Da für das Installieren der Addons die rex_config benötigt wird,
         // mit overrideExisting() eine saubere, komplette Basis schaffen
         if ($err_msg == '') {
             $err_msg .= self::overrideExisting();
         }
         if ($err_msg == '') {
             $err_msg .= self::import($import_sql, $import_archiv);
         }
     }
     return $err_msg;
 }
开发者ID:skerbis,项目名称:redaxo,代码行数:23,代码来源:import.php


示例6: getImportDir

// all files in files with .sql als endung
$dir = getImportDir();
$folder = readImportFolder(".sql");
foreach ($folder as $file) {
    $filepath = $dir . '/' . $file;
    $filec = date("d.m.Y H:i", filemtime($filepath));
    echo "<tr>\r\n                <td class=lgrey><b>{$file}</b></td>\r\n                <td class=lgrey>{$filec}</td>\r\n                <td class=lgrey><a href=index.php?page={$page}&amp;function=dbimport&amp;impname={$file} title='" . $I18N_IM_EXPORT->msg('import_file') . "' onclick=\"return confirm('" . $I18N_IM_EXPORT->msg('proceed_db_import') . "')\">" . $I18N_IM_EXPORT->msg("import") . "</a></td>\r\n                <td class=lgrey><a href=index.php?page={$page}&amp;function=delete&amp;impname={$file} title='" . $I18N_IM_EXPORT->msg('delete_file') . "' onclick=\"return confirm('" . $I18N->msg('delete') . " ?')\">" . $I18N_IM_EXPORT->msg("delete") . "</a></td></tr>";
}
echo "</table>";
// FILE IMPORT
echo "<br><table width=100% border=0 cellspacing=1 cellpadding=4 bgcolor=#ffffff>\r\n  <tr><td align=left colspan=2 class=lgrey>" . $I18N_IM_EXPORT->msg("files") . "</td>\r\n  <form action=index.php method=post enctype='multipart/form-data'>\r\n  <input type=hidden name=page value={$page}>\r\n  <input type=hidden name=function value=fileimport>\r\n  <tr>\r\n    <td class=lgrey><input type=file name=FORM[importfile]></td>\r\n    <td class=lgrey width=130><input type=submit value='" . $I18N_IM_EXPORT->msg("db_import") . "'></td>\r\n  </tr>\r\n  </form>\r\n  </table>";
echo "<br><table width=100% border=0 cellspacing=1 cellpadding=4 bgcolor=#ffffff>" . "\n";
echo "<tr>\r\n      <td align=left class=lgrey>" . $I18N_IM_EXPORT->msg("filename") . "</td>\r\n      <td width=60 class=lgrey>" . $I18N_IM_EXPORT->msg("createdate") . "</td>\r\n      <td width=60 class=lgrey>&nbsp;</td>\r\n      <td width=60 class=lgrey>&nbsp;</td>" . "\n";
// FILE IMPORT LIST
// all files in files with .tar.gz als endung
$dir = getImportDir();
$folder = readImportFolder(".tar.gz");
foreach ($folder as $file) {
    $filepath = $dir . '/' . $file;
    $filec = date("d.m.Y H:i", filemtime($filepath));
    echo "<tr>\r\n                <td class=lgrey><b>{$file}</b></td>\r\n                <td class=lgrey>{$filec}</td>\r\n                <td class=lgrey><a href=index.php?page={$page}&function=fileimport&impname={$file} title='" . $I18N_IM_EXPORT->msg('import_file') . "' onclick=\"return confirm('" . $I18N_IM_EXPORT->msg('proceed_file_import') . "')\">" . $I18N_IM_EXPORT->msg("import") . "</a></td>\r\n                <td class=lgrey><a href=index.php?page={$page}&function=delete&impname={$file} title='" . $I18N_IM_EXPORT->msg('delete_file') . "' onclick=\"return confirm('" . $I18N->msg('delete') . " ?')\">" . $I18N_IM_EXPORT->msg("delete") . "</a></td></tr>";
}
echo "</table><br />" . "\n";
// ----------------------------------------------------------------- /IMPORT
?>
</td><td valign="top" class="dgrey"><?php 
// ----------------------------------------------------------------- EXPORT
echo "<br />" . $I18N_IM_EXPORT->msg("intro_export") . "<br /><br />" . "\n";
echo "<table width=100% border=0 cellspacing=1 cellpadding=4 bgcolor=#ffffff>\r\n  \r\n  <form action=index.php method=post enctype='multipart/form-data'>\r\n  <input type=hidden name=page value={$page}>\r\n  <input type=hidden name=function value=export>  \r\n  " . "\n";
$checkedsql = "";
$checkedfiles = "";
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:index.inc.php


示例7: rex_select

     case 1:
     case 2:
     case 3:
     case 4:
         $dbchecked[$dbanlegen] = ' checked="checked"';
         break;
     default:
         $dbchecked[0] = ' checked="checked"';
 }
 // Vorhandene Exporte auslesen
 $sel_export = new rex_select();
 $sel_export->setName('import_name');
 $sel_export->setId('import_name');
 $sel_export->setStyle('class="rex-form-select"');
 $sel_export->setAttribute('onclick', 'checkInput(\'dbanlegen_3\')');
 $export_dir = getImportDir();
 $exports_found = false;
 if (is_dir($export_dir)) {
     if ($handle = opendir($export_dir)) {
         $export_archives = array();
         $export_sqls = array();
         while (($file = readdir($handle)) !== false) {
             if ($file == '.' || $file == '..') {
                 continue;
             }
             $isSql = substr($file, strlen($file) - 4) == '.sql';
             $isArchive = substr($file, strlen($file) - 7) == '.tar.gz';
             if ($isSql) {
                 // endung .sql abschneiden
                 $export_sqls[] = substr($file, 0, -4);
                 $exports_found = true;
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:setup.inc.php


示例8: parse_url

    $server = parse_url(rex::getServer(), PHP_URL_HOST);
    $exportfilename = strtolower($server) . '_rex' . rex::getVersion() . '_' . date('Ymd_Hi');
}
if (rex_post('export', 'bool')) {
    // ------------------------------ FUNC EXPORT
    $exportfilename = strtolower($exportfilename);
    $filename = preg_replace('@[^\\.a-z0-9_\\-]@', '', $exportfilename);
    if ($filename != $exportfilename) {
        $success = rex_i18n::msg('im_export_filename_updated');
        $exportfilename = $filename;
    } else {
        $content = '';
        $hasContent = false;
        $header = '';
        $ext = $exporttype == 'sql' ? '.sql' : '.tar.gz';
        $export_path = getImportDir() . '/';
        if (file_exists($export_path . $filename . $ext)) {
            $i = 1;
            while (file_exists($export_path . $filename . '_' . $i . $ext)) {
                ++$i;
            }
            $filename = $filename . '_' . $i;
        }
        if ($exporttype == 'sql') {
            // ------------------------------ FUNC EXPORT SQL
            $header = 'plain/text';
            $hasContent = rex_a1_export_db($export_path . $filename . $ext, $EXPTABLES);
            // ------------------------------ /FUNC EXPORT SQL
        } elseif ($exporttype == 'files') {
            // ------------------------------ FUNC EXPORT FILES
            $header = 'tar/gzip';
开发者ID:eaCe,项目名称:redaxo,代码行数:31,代码来源:export.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getImportExcelData函数代码示例发布时间:2022-05-15
下一篇:
PHP getImportCVSFields函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap