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

PHP rex_file类代码示例

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

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



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

示例1: updateVersion

 private function updateVersion()
 {
     $file = rex_path::core('boot.php');
     $content = rex_file::get($file);
     $content = preg_replace('/(?<=^rex::setProperty\\(\'version\', \').*?(?=\')/m', $this->version, $content);
     rex_file::put($file, $content);
 }
开发者ID:staabm,项目名称:redaxo,代码行数:7,代码来源:release.php


示例2: focus_setup_metainfo

function focus_setup_metainfo()
{
    global $REX;
    if (!isset($REX['USER'])) {
        return;
    }
    $install_metas = array('med_focuspoint_data' => array('Focuspoint Data', 'med_focuspoint_data', 200, '', 1, '', '', '', ''), 'med_focuspoint_css' => array('Focuspoint CSS', 'med_focuspoint_css', 201, '', 1, '', '', '', ''));
    $db = new rex_sql();
    foreach ($db->getDbArray('SHOW COLUMNS FROM `rex_file` LIKE \'med_focuspoint_%\';') as $column) {
        unset($install_metas[$column['Field']]);
    }
    foreach ($install_metas as $k => $v) {
        $db->setQuery('SELECT `name` FROM `rex_62_params` WHERE `name`=\'' . $k . '\';');
        if ($db->getRows() > 0) {
            // FIELD KNOWN TO METAINFO BUT MISSING IN ARTICLE..
            $db->setQuery('ALTER TABLE `rex_file` ADD `' . $k . '` TEXT NOT NULL;');
            if ($REX['REDAXO']) {
                echo rex_info('Metainfo Feld ' . $k . ' wurde repariert.');
            }
        } else {
            if (!function_exists('a62_add_field')) {
                require_once $REX['INCLUDE_PATH'] . '/addons/metainfo/functions/function_metainfo.inc.php';
            }
            a62_add_field($v[0], $v[1], $v[2], $v[3], $v[4], $v[5], $v[6], $v[7], $v[8]);
            if ($REX['REDAXO']) {
                echo rex_info('Metainfo Feld ' . $k . ' wurde angelegt.');
            }
        }
    }
    rex_file::copy(rex_path::addon("focuspoint", "classes/class.rex_effect_focuspoint_resize.inc.php"), rex_path::addon("image_manager", "classes/effects/class.rex_effect_focuspoint_resize.inc.php"));
}
开发者ID:olien,项目名称:rex_focuspoint,代码行数:31,代码来源:install.inc.php


示例3: factory

 /**
  * Prepares a new stream.
  *
  * @param string $path    Virtual path which should describe the content (e.g. "template/1"), only relevant for error messages
  * @param string $content Content which will be included
  *
  * @throws InvalidArgumentException
  *
  * @return string Full path with protocol (e.g. "rex:///template/1")
  */
 public static function factory($path, $content)
 {
     if (!is_string($path) || empty($path)) {
         throw new InvalidArgumentException('Expecting $path to be a string and not empty!');
     }
     if (!is_string($content)) {
         throw new InvalidArgumentException('Expecting $content to be a string!');
     }
     if (null === self::$useRealFiles) {
         self::$useRealFiles = extension_loaded('suhosin') && !preg_match('/(?:^|,)rex(?::|,|$)/', ini_get('suhosin.executor.include.whitelist'));
     }
     if (self::$useRealFiles) {
         $hash = substr(sha1($content), 0, 7);
         $path = rex_path::coreCache('stream/' . $path . '/' . $hash);
         if (!file_exists($path)) {
             rex_file::put($path, $content);
         }
         return $path;
     }
     if (!self::$registered) {
         stream_wrapper_register('rex', __CLASS__);
         self::$registered = true;
     }
     // 3 slashes needed to sidestep some server url include protections
     // example: https://www.strato.de/faq/article/622/Warum-erhalte-ich-über-PHP-die-Fehlermeldung-%22Warning:-main()-…:-include(….).html
     $path = 'rex:///' . $path;
     self::$nextContent[$path] = $content;
     return $path;
 }
开发者ID:redaxo,项目名称:redaxo,代码行数:39,代码来源:stream.php


示例4: execute

 public function execute()
 {
     global $I18N;
     $addonkey = rex_request('addonkey', 'string');
     $upload = rex_request('upload', array(array('upload_file', 'bool'), array('oldversion', 'string'), array('redaxo', 'array[string]'), array('description', 'string'), array('status', 'int'), array('replace_assets', 'bool'), array('ignore_tests', 'bool')));
     $file = array();
     $archive = null;
     $file['version'] = $upload['upload_file'] ? OOAddon::getVersion($addonkey) : $upload['oldversion'];
     $file['redaxo_versions'] = $upload['redaxo'];
     $file['description'] = stripslashes($upload['description']);
     $file['status'] = $upload['status'];
     if ($upload['upload_file']) {
         $archive = rex_path::addonCache('install', md5($addonkey . time()) . '.zip');
         $exclude = array();
         if ($upload['replace_assets']) {
             $exclude[] = 'files';
         }
         if ($upload['ignore_tests']) {
             $exclude[] = 'tests';
         }
         rex_install_archive::copyDirToArchive(rex_path::addon($addonkey), $archive, null, $exclude);
         if ($upload['replace_assets']) {
             rex_install_archive::copyDirToArchive(rex_path::addonAssets($addonkey), $archive, $addonkey . '/files');
         }
         $file['checksum'] = md5_file($archive);
     }
     rex_install_webservice::post(rex_install_packages::getPath('?package=' . $addonkey . '&file_id=' . rex_request('file', 'int', 0)), array('file' => $file), $archive);
     if ($archive) {
         rex_file::delete($archive);
     }
     unset($_REQUEST['addonkey']);
     unset($_REQUEST['file']);
     rex_install_packages::deleteCache();
     return $I18N->msg('install_info_addon_uploaded', $addonkey);
 }
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:35,代码来源:api_package_upload.php


示例5: replaceVars

 static function replaceVars($template, $er = array())
 {
     $r = rex_extension::registerPoint(new rex_extension_point('YFORM_EMAIL_BEFORE_REPLACEVARS', ['template' => $template, 'search_replace' => $er, 'status' => false]));
     $template = $r['template'];
     $er = $r['search_replace'];
     $status = $r['status'];
     if ($status) {
         return true;
     }
     $er['REX_SERVER'] = rex::getServer();
     $er['REX_ERROR_EMAIL'] = rex::getErrorEmail();
     $er['REX_SERVERNAME'] = rex::getServerName();
     $er['REX_NOTFOUND_ARTICLE_ID'] = rex_article::getNotfoundArticleId();
     $er['REX_ARTICLE_ID'] = rex_article::getCurrentId();
     $template['body'] = rex_var::parse($template['body'], '', 'yform_email_template', $er);
     $template['body_html'] = rex_var::parse($template['body_html'], '', 'yform_email_template', $er);
     // rex_vars bug: sonst wird der Zeilenumbruch entfernt - wenn DATA_VAR am Ende einer Zeile
     if (rex_string::versionCompare(rex::getVersion(), '5.0.1', '<')) {
         $template['body'] = str_replace("?>\r", "?>\r\n\r", $template['body']);
         $template['body'] = str_replace("?>\n", "?>\n\r\n", $template['body']);
         $template['body_html'] = str_replace("?>\r", "?>\r\n\r", $template['body_html']);
         $template['body_html'] = str_replace("?>\n", "?>\n\r\n", $template['body_html']);
     }
     $template['body'] = rex_file::getOutput(rex_stream::factory('yform/email/template/' . $template['name'] . '/body', $template['body']));
     $template['body_html'] = rex_file::getOutput(rex_stream::factory('yform/email/template/' . $template['name'] . '/body_html', $template['body_html']));
     return $template;
 }
开发者ID:VIEWSION,项目名称:redaxo_yform,代码行数:27,代码来源:yform_email_template.php


示例6: deleteCache

 public function deleteCache()
 {
     if ($this->id < 1) {
         return false;
     }
     $file = $this->getFilePath($this->getId());
     rex_file::delete($file);
     return true;
 }
开发者ID:skerbis,项目名称:redaxo,代码行数:9,代码来源:api_template.php


示例7: compile

 /**
  * Compile a fragment.
  *
  * @param string $value
  */
 public function compile($file)
 {
     if ($this->isExpired($file)) {
         $content = rex_file::get($file);
         if (rex_file::put($this->getCompiledFile($file), $this->compileString($content)) === false) {
             throw new rex_exception('Unable to generate fragment ' . $file . '!');
         }
     }
     return $this->getCompiledFile($file);
 }
开发者ID:skerbis,项目名称:redaxo,代码行数:15,代码来源:compiler.php


示例8: testDelete

 public function testDelete()
 {
     $path = $this->getPath('delete.log');
     $path2 = $path . '.2';
     rex_file::put($path, '');
     rex_file::put($path2, '');
     rex_log_file::delete($path);
     $this->assertFileNotExists($path);
     $this->assertFileNotExists($path2);
 }
开发者ID:staabm,项目名称:redaxo,代码行数:10,代码来源:log_file_test.php


示例9: setUp

 public function setUp()
 {
     parent::setUp();
     rex_file::put($this->getPath('file1.txt'), '');
     rex_file::put($this->getPath('file2.yml'), '');
     rex_file::put($this->getPath('dir1/file3.txt'), '');
     rex_file::put($this->getPath('dir2/file4.yml'), '');
     rex_file::put($this->getPath('dir2/dir/file5.yml'), '');
     rex_dir::create($this->getPath('dir1/dir'));
     rex_dir::create($this->getPath('dir2/dir1'));
     rex_dir::create($this->getPath('dir'));
     rex_file::put($this->getPath('.DS_Store'), '');
     rex_file::put($this->getPath('dir1/Thumbs.db'), '');
 }
开发者ID:staabm,项目名称:redaxo,代码行数:14,代码来源:finder_test.php


示例10: backup

 private function backup()
 {
     $content = '<!-- ' . PHP_EOL . date('d.m.Y H:i:s') . PHP_EOL;
     $content .= 'From : ' . $this->From . PHP_EOL;
     $content .= 'To : ' . implode(', ', array_column($this->getToAddresses(), 0)) . PHP_EOL;
     $content .= 'Subject : ' . $this->Subject . PHP_EOL;
     $content .= ' -->' . PHP_EOL;
     $content .= $this->Body;
     $dir = rex_path::addonData('phpmailer', 'mail_backup/' . date('Y') . '/' . date('m'));
     $count = 1;
     $backupFile = $dir . '/' . date('Y-m-d_H_i_s') . '.html';
     while (file_exists($backupFile)) {
         $backupFile = $dir . '/' . date('Y-m-d_H_i_s') . '_' . ++$count . '.html';
     }
     rex_file::put($backupFile, $content);
 }
开发者ID:DECAF,项目名称:redaxo,代码行数:16,代码来源:mailer.php


示例11: execute

 public function execute()
 {
     // error_reporting(E_ALL);ini_set("display_errors",1);
     if (!isset(self::$convert_to[$this->params['convert_to']])) {
         $convert_to = self::$convert_to[self::$convert_to_default];
     } else {
         $convert_to = self::$convert_to[$this->params['convert_to']];
     }
     $density = (int) $this->params['density'];
     if (!in_array($density, self::$densities)) {
         $density = self::$density_default;
     }
     $from_path = realpath($this->media->getMediapath());
     $ext = rex_file::extension($from_path);
     if (!$ext) {
         return;
     }
     if (!in_array(strtolower($ext), self::$convert_types)) {
         return;
     }
     $convert_path = self::getConvertPath();
     if ($convert_path == '') {
         return;
     }
     $filename = $this->media->getMediaFilename();
     $filename_wo_ext = substr($filename, 0, strlen($filename) - strlen($ext));
     $to_path = rex_path::addonCache('media_manager', 'media_manager__convert2img_' . md5($this->media->getMediapath()) . '_' . $filename_wo_ext . $convert_to['ext']);
     $cmd = $convert_path . ' -density ' . $density . ' "' . $from_path . '[0]" -colorspace RGB "' . $to_path . '"';
     exec($cmd, $out, $ret);
     if ($ret != 0) {
         return false;
     }
     $image_src = call_user_func($convert_to['createfunc'], $to_path);
     if (!$image_src) {
         return;
     }
     $this->media->setImage($image_src);
     $this->media->refreshImageDimensions();
     $this->media->setFormat($convert_to['ext']);
     $this->media->setMediaFilename($filename);
     $this->media->setHeader('Content-Type', $convert_to['content-type']);
     unlink($to_path);
 }
开发者ID:DECAF,项目名称:redaxo,代码行数:43,代码来源:effect_convert2img.php


示例12: execute

 public function execute()
 {
     if (!rex::getUser()->isAdmin()) {
         throw new rex_api_exception('You do not have the permission!');
     }
     $addonkey = rex_request('addonkey', 'string');
     $upload = rex_request('upload', [['upload_file', 'bool'], ['oldversion', 'string'], ['redaxo', 'array[string]'], ['description', 'string'], ['status', 'int'], ['replace_assets', 'bool'], ['ignore_tests', 'bool']]);
     $file = [];
     $archive = null;
     $file['version'] = $upload['upload_file'] ? rex_addon::get($addonkey)->getVersion() : $upload['oldversion'];
     $file['redaxo_versions'] = $upload['redaxo'];
     $file['description'] = $upload['description'];
     $file['status'] = $upload['status'];
     try {
         if ($upload['upload_file']) {
             $archive = rex_path::addonCache('install', md5($addonkey . time()) . '.zip');
             $exclude = [];
             if ($upload['replace_assets']) {
                 $exclude[] = 'assets';
             }
             if ($upload['ignore_tests']) {
                 $exclude[] = 'tests';
             }
             rex_install_archive::copyDirToArchive(rex_path::addon($addonkey), $archive, null, $exclude);
             if ($upload['replace_assets']) {
                 rex_install_archive::copyDirToArchive(rex_url::addonAssets($addonkey), $archive, $addonkey . '/assets');
             }
             $file['checksum'] = md5_file($archive);
         }
         rex_install_webservice::post(rex_install_packages::getPath('?package=' . $addonkey . '&file_id=' . rex_request('file', 'int', 0)), ['file' => $file], $archive);
     } catch (rex_functional_exception $e) {
         throw new rex_api_exception($e->getMessage());
     }
     if ($archive) {
         rex_file::delete($archive);
     }
     unset($_REQUEST['addonkey']);
     unset($_REQUEST['file']);
     rex_install_packages::deleteCache();
     return new rex_api_result(true, rex_i18n::msg('install_info_addon_uploaded', $addonkey));
 }
开发者ID:staabm,项目名称:redaxo,代码行数:41,代码来源:api_package_upload.php


示例13: execute

 public function execute()
 {
     if (!rex::getUser()->isAdmin()) {
         throw new rex_api_exception('You do not have the permission!');
     }
     $this->addonkey = rex_request('addonkey', 'string');
     $function = static::GET_PACKAGES_FUNCTION;
     $packages = rex_install_packages::$function();
     $this->fileId = rex_request('file', 'int');
     if (!isset($packages[$this->addonkey]['files'][$this->fileId])) {
         return null;
     }
     $this->file = $packages[$this->addonkey]['files'][$this->fileId];
     $this->checkPreConditions();
     try {
         $archivefile = rex_install_webservice::getArchive($this->file['path']);
     } catch (rex_functional_exception $e) {
         throw new rex_api_exception($e->getMessage());
     }
     $message = '';
     $this->archive = $archivefile;
     if ($this->file['checksum'] != md5_file($archivefile)) {
         $message = rex_i18n::msg('install_warning_zip_wrong_checksum');
     } elseif (!$this->isCorrectFormat($archivefile)) {
         $message = rex_i18n::msg('install_warning_zip_wrong_format');
     } elseif (is_string($msg = $this->doAction())) {
         $message = $msg;
     }
     rex_file::delete($archivefile);
     if ($message) {
         $message = rex_i18n::msg('install_warning_addon_not_' . static::VERB, $this->addonkey) . '<br />' . $message;
         $success = false;
     } else {
         $message = rex_i18n::msg('install_info_addon_' . static::VERB, $this->addonkey) . (static::SHOW_LINK ? ' <a href="' . rex_url::backendPage('packages') . '">' . rex_i18n::msg('install_to_addon_page') . '</a>' : '');
         $success = true;
         unset($_REQUEST['addonkey']);
     }
     return new rex_api_result($success, $message);
 }
开发者ID:eaCe,项目名称:redaxo,代码行数:39,代码来源:api_package_download.php


示例14: execute

 public function execute()
 {
     global $I18N;
     $this->addonkey = rex_request('addonkey', 'string');
     $function = static::GET_PACKAGES_FUNCTION;
     $packages = rex_install_packages::$function();
     $this->fileId = rex_request('file', 'int');
     if (!isset($packages[$this->addonkey]['files'][$this->fileId])) {
         return null;
     }
     $this->file = $packages[$this->addonkey]['files'][$this->fileId];
     $this->checkPreConditions();
     $archivefile = rex_install_webservice::getArchive($this->file['path']);
     $message = '';
     $this->archive = $archivefile;
     if ($this->file['checksum'] != md5_file($archivefile)) {
         $message = $I18N->msg('install_warning_zip_wrong_checksum');
     } elseif (!file_exists("phar://{$archivefile}/" . $this->addonkey)) {
         $message = $I18N->msg('install_warning_zip_wrong_format');
     } elseif (is_string($msg = $this->doAction())) {
         $message = $msg;
     }
     rex_file::delete($archivefile);
     if ($message) {
         $message = $I18N->msg('install_warning_addon_not_' . static::VERB, $this->addonkey) . '<br />' . $message;
         $success = false;
     } else {
         $message = $I18N->msg('install_info_addon_' . static::VERB, $this->addonkey) . (static::SHOW_LINK ? ' <a href="index.php?page=addon">' . $I18N->msg('install_to_addon_page') . '</a>' : '');
         $success = true;
         unset($_REQUEST['addonkey']);
     }
     if ($success) {
         return $message;
     } else {
         throw new rex_install_functional_exception($message);
     }
 }
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:37,代码来源:api_package_download.php


示例15: catch

        } catch (InvalidArgumentException $e) {
            $error[] = rex_i18n::msg($key . '_invalid');
        }
    }
    $config['debug'] = isset($settings['debug']) && $settings['debug'];
    rex::setProperty('debug', $config['debug']);
    foreach (rex_system_setting::getAll() as $setting) {
        $key = $setting->getKey();
        if (isset($settings[$key])) {
            if (($msg = $setting->setValue($settings[$key])) !== true) {
                $error[] = $msg;
            }
        }
    }
    if (empty($error)) {
        if (rex_file::putConfig($configFile, $config) > 0) {
            $success = rex_i18n::msg('info_updated');
        }
    }
}
$sel_lang = new rex_select();
$sel_lang->setStyle('class="form-control"');
$sel_lang->setName('settings[lang]');
$sel_lang->setId('rex-id-lang');
$sel_lang->setSize(1);
$sel_lang->setSelected(rex::getProperty('lang'));
foreach (rex_i18n::getLocales() as $l) {
    $sel_lang->addOption($l, $l);
}
if (!empty($error)) {
    echo rex_view::error(implode('<br />', $error));
开发者ID:staabm,项目名称:redaxo,代码行数:31,代码来源:system.settings.php


示例16: getSystemPlugins

 /**
  * {@inheritdoc}
  */
 public function getSystemPlugins()
 {
     if (rex::isSetup() || rex::isSafeMode()) {
         // in setup and safemode this method is called before the package .lang files are added to rex_i18n
         // so don't use getProperty(), to avoid loading all properties without translations
         $properties = rex_file::getConfig($this->getPath(parent::FILE_PACKAGE));
         $systemPlugins = isset($properties['system_plugins']) ? (array) $properties['system_plugins'] : [];
     } else {
         $systemPlugins = (array) $this->getProperty('system_plugins', []);
     }
     $plugins = [];
     foreach ($systemPlugins as $plugin) {
         if ($this->pluginExists($plugin)) {
             $plugins[$plugin] = $this->getPlugin($plugin);
         }
     }
     return $plugins;
 }
开发者ID:staabm,项目名称:redaxo,代码行数:21,代码来源:addon.php


示例17: array_unshift

     $subject = $ep->getSubject();
     $file = rex_plugin::get('be_style', $mypage)->getPath('scss/default.scss');
     array_unshift($subject, $file);
     return $subject;
 }, rex_extension::EARLY);
 if (rex::getUser() && $this->getProperty('compile')) {
     rex_addon::get('be_style')->setProperty('compile', true);
     rex_extension::register('PACKAGES_INCLUDED', function () {
         $compiler = new rex_scss_compiler();
         $compiler->setRootDir($this->getPath('scss/'));
         $compiler->setScssFile($this->getPath('scss/master.scss'));
         // Compile in backend assets dir
         $compiler->setCssFile($this->getPath('assets/css/styles.css'));
         $compiler->compile();
         // Compiled file to copy in frontend assets dir
         rex_file::copy($this->getPath('assets/css/styles.css'), $this->getAssetsPath('css/styles.css'));
     });
 }
 rex_view::addCssFile($this->getAssetsUrl('css/styles.css'));
 rex_view::addJsFile($this->getAssetsUrl('javascripts/redaxo.js'));
 rex_extension::register('PAGE_HEADER', function (rex_extension_point $ep) {
     $icons = [];
     foreach (['57', '60', '72', '76', '114', '120', '144', '152'] as $size) {
         $size = $size . 'x' . $size;
         $icons[] = '<link rel="apple-touch-icon-precomposed" sizes="' . $size . '" href="' . $this->getAssetsUrl('images/apple-touch-icon-' . $size . '.png') . '" />';
     }
     foreach (['16', '32', '96', '128', '196'] as $size) {
         $size = $size . 'x' . $size;
         $icons[] = '<link rel="icon" type="image/png" href="' . $this->getAssetsUrl('images/favicon-' . $size . '.png') . '" sizes="' . $size . '" />';
     }
     $icons[] = '<meta name="msapplication-TileColor" content="#FFFFFF" />';
开发者ID:DECAF,项目名称:redaxo,代码行数:31,代码来源:boot.php


示例18: loadProperties

 /**
  * Loads the properties of package.yml.
  */
 private function loadProperties()
 {
     static $cache = null;
     if (is_null($cache)) {
         $cache = rex_file::getCache(rex_path::cache('packages.cache'));
     }
     $id = $this->getPackageId();
     $file = $this->getPath(self::FILE_PACKAGE);
     if (!file_exists($file)) {
         $this->propertiesLoaded = true;
         return;
     }
     if (isset($cache[$id]) && (!rex::isBackend() || !($user = rex::getUser()) || !$user->isAdmin() || $cache[$id]['timestamp'] >= filemtime($file))) {
         $properties = $cache[$id]['data'];
     } else {
         $properties = rex_file::getConfig($file);
         $cache[$id]['timestamp'] = filemtime($file);
         $cache[$id]['data'] = $properties;
         static $registeredShutdown = false;
         if (!$registeredShutdown) {
             $registeredShutdown = true;
             register_shutdown_function(function () use(&$cache) {
                 foreach ($cache as $package => $_) {
                     if (!rex_package::exists($package)) {
                         unset($cache[$package]);
                     }
                 }
                 rex_file::putCache(rex_path::cache('packages.cache'), $cache);
             });
         }
     }
     foreach ($properties as $key => $value) {
         if (!isset($this->properties[$key])) {
             $this->properties[$key] = rex_i18n::translateArray($value, false, [$this, 'i18n']);
         }
     }
     $this->propertiesLoaded = true;
 }
开发者ID:staabm,项目名称:redaxo,代码行数:41,代码来源:package.php


示例19: toTar

 public function toTar($filename, $useGzip)
 {
     // Encode processed files into TAR file format
     $this->__generateTar();
     // GZ Compress the data if we need to
     if ($useGzip) {
         // Make sure we have gzip support
         if (!function_exists('gzencode')) {
             return false;
         }
         $file = gzencode($this->tar_file);
     } else {
         $file = $this->tar_file;
     }
     // Write the TAR file
     //    $fp = fopen($filename,"wb");
     //    fwrite($fp,$file);
     //    fclose($fp);
     // kein Filename gegeben => Inhalt zurueckgeben
     if (!$filename) {
         return $file;
     }
     // STM: hier mit put_file_contents ist viel schneller
     return rex_file::put($filename, $file) !== false;
 }
开发者ID:alsahh,项目名称:redaxo,代码行数:25,代码来源:tar.php


示例20: elseif

         if ($media_manager) {
             $thumbnail = '<img class="thumbnail" src="' . rex_url::backendController(['rex_media_type' => 'rex_mediapool_preview', 'rex_media_file' => $encoded_file_name]) . '" alt="' . $alt . '" title="' . $alt . '" />';
         }
     }
 }
 // ----- get file size
 $size = $file_size;
 $file_size = rex_formatter::bytes($size);
 if ($file_title == '') {
     $file_title = '[' . rex_i18n::msg('pool_file_notitle') . ']';
 }
 $file_title .= ' [' . $file_id . ']';
 // ----- opener
 $opener_link = '';
 if ($opener_input_field == 'TINYIMG') {
     if (rex_media::isImageType(rex_file::extension($file_name))) {
         $opener_link .= '<a class="btn btn-select" href="javascript:insertImage(\'$file_name\',\'' . $files->getValue('title') . '\')">' . rex_i18n::msg('pool_image_get') . '</a>';
     }
 } elseif ($opener_input_field == 'TINY') {
     $opener_link .= '<a class="btn btn-select" href="javascript:insertLink(\'' . $file_name . '\');"">' . rex_i18n::msg('pool_link_get') . '</a>';
 } elseif ($opener_input_field != '') {
     $opener_link = '<a class="btn btn-xs btn-select" href="javascript:selectMedia(\'' . $file_name . '\', \'' . addslashes(htmlspecialchars($files->getValue('title'))) . '\');">' . rex_i18n::msg('pool_file_get') . '</a>';
     if (substr($opener_input_field, 0, 14) == 'REX_MEDIALIST_') {
         $opener_link = '<a class="btn btn-xs btn-select" href="javascript:selectMedialist(\'' . $file_name . '\');">' . rex_i18n::msg('pool_file_get') . '</a>';
     }
 }
 $ilink = rex_url::currentBackendPage(array_merge(['file_id' => $file_id, 'rex_file_category' => $rex_file_category], $arg_url));
 $add_td = '<td></td>';
 if ($PERMALL) {
     $add_td = '<td><input type="checkbox" name="selectedmedia[]" value="' . $file_name . '" /></td>';
 }
开发者ID:alsahh,项目名称:redaxo,代码行数:31,代码来源:media.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP rex_fragment类代码示例发布时间:2022-05-23
下一篇:
PHP rex_extension类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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