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


PHP rex::getTempPrefix方法代碼示例

本文整理匯總了PHP中rex::getTempPrefix方法的典型用法代碼示例。如果您正苦於以下問題:PHP rex::getTempPrefix方法的具體用法?PHP rex::getTempPrefix怎麽用?PHP rex::getTempPrefix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rex的用法示例。


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

示例1: prepareQuery

 private static function prepareQuery($qry)
 {
     // rex::getUser() gibts im Setup nicht
     $user = rex::getUser() ? rex::getUser()->getValue('login') : '';
     $qry = str_replace('%USER%', $user, $qry);
     $qry = str_replace('%TIME%', time(), $qry);
     $qry = str_replace('%TABLE_PREFIX%', rex::getTablePrefix(), $qry);
     $qry = str_replace('%TEMP_PREFIX%', rex::getTempPrefix(), $qry);
     return $qry;
 }
開發者ID:staabm,項目名稱:redaxo,代碼行數:10,代碼來源:util.php

示例2: addFolderToTar

 /**
  * Fügt einem Tar-Archiv ein Ordner von Dateien hinzu.
  */
 private static function addFolderToTar(rex_backup_tar $tar, $path, $dir)
 {
     $handle = opendir($path . $dir);
     $isMediafolder = realpath($path . $dir) . '/' == rex_path::media();
     while (false !== ($file = readdir($handle))) {
         // Alles exportieren, außer ...
         // - addons verzeichnis im mediafolder (wird bei addoninstallation wiedererstellt)
         // - svn infos
         // - tmp prefix Dateien
         if ($file == '.' || $file == '..' || $file == '.svn') {
             continue;
         }
         if (substr($file, 0, strlen(rex::getTempPrefix())) == rex::getTempPrefix()) {
             continue;
         }
         if ($isMediafolder && $file == 'addons') {
             continue;
         }
         if (is_dir($path . $dir . '/' . $file)) {
             self::addFolderToTar($tar, $path . $dir . '/', $file);
         } else {
             $tar->addFile($path . $dir . '/' . $file);
         }
     }
     closedir($handle);
 }
開發者ID:VIEWSION,項目名稱:redaxo,代碼行數:29,代碼來源:backup.php

示例3: testGetTempPrefix

 public function testGetTempPrefix()
 {
     $this->assertEquals(rex::getTempPrefix(), 'tmp_', 'temp prefix defaults to tmp_');
 }
開發者ID:staabm,項目名稱:redaxo,代碼行數:4,代碼來源:rex_test.php

示例4: rex_fragment

$n = [];
$n['label'] = rex_i18n::msg('backup_export_select');
$n['field'] = $radios;
$formElements[] = $n;
$fragment = new rex_fragment();
$fragment->setVar('elements', $formElements, false);
$content .= $fragment->parse('core/form/form.php');
$tableSelect = new rex_select();
$tableSelect->setMultiple();
$tableSelect->setId('rex-form-exporttables');
$tableSelect->setName('EXPTABLES[]');
$tableSelect->setAttribute('class', 'form-control');
$tables = rex_sql::showTables();
foreach ($tables as $table) {
    $tableSelect->addOption($table, $table);
    if ($table != rex::getTable('user') && 0 === strpos($table, rex::getTablePrefix()) && 0 !== strpos($table, rex::getTablePrefix() . rex::getTempPrefix())) {
        $tableSelect->setSelected($table);
    }
}
$formElements = [];
$n = [];
$n['header'] = '<div id="rex-js-exporttype-sql-div">';
$n['label'] = '<label for="rex-form-exporttables">' . rex_i18n::msg('backup_export_select_tables') . '</label>';
$n['field'] = $tableSelect->get();
$n['footer'] = '</div>';
$formElements[] = $n;
// Vorhandene Exporte auslesen
$sel_dirs = new rex_select();
$sel_dirs->setId('rex-form-exportdir');
$sel_dirs->setName('EXPDIR[]');
$sel_dirs->setMultiple();
開發者ID:DECAF,項目名稱:redaxo,代碼行數:31,代碼來源:export.php

示例5: foreach

<?php

// *************************************** SYNC FUNCTIONS
// ----- SYNC DB WITH FILES DIR
if ($PERMALL) {
    // ---- Dateien aus dem Ordner lesen
    $folder_files = [];
    $path = rex_path::media();
    $iterator = rex_finder::factory($path)->filesOnly()->ignoreFiles(['.*', rex::getTempPrefix() . '*'])->sort();
    foreach ($iterator as $file) {
        $folder_files[] = $file->getFilename();
    }
    // ---- Dateien aus der DB lesen
    $db = rex_sql::factory();
    $db->setQuery('SELECT * FROM ' . rex::getTablePrefix() . 'media');
    $db_files = [];
    $db_filenames = [];
    foreach ($db->getArray() as $db_file) {
        $db_filenames[] = $db_file['filename'];
        $db_files[] = $db_file;
    }
    $diff_files = array_diff($folder_files, $db_filenames);
    $diff_count = count($diff_files);
    // Extra - filesize/width/height DB-Filesystem Sync
    foreach ($db_files as $db_file) {
        $file_filesize = filesize(rex_path::media($db_file['filename']));
        if ($db_file['filesize'] != $file_filesize) {
            $file_sql = rex_sql::factory();
            $file_sql->debugsql = 1;
            $file_sql->setTable(rex::getTable('media'));
            $file_sql->setWhere(['filename' => $db_file['filename']]);
開發者ID:staabm,項目名稱:redaxo,代碼行數:31,代碼來源:sync.php


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