本文整理汇总了PHP中rex_file::copy方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_file::copy方法的具体用法?PHP rex_file::copy怎么用?PHP rex_file::copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex_file
的用法示例。
在下文中一共展示了rex_file::copy方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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"));
}
示例2: testCopyToDir
public function testCopyToDir()
{
$orig = $this->getPath('file.txt');
$copyDir = $this->getPath('copy');
$copyFile = $this->getPath('copy/file.txt');
$content = 'test';
rex_file::put($orig, $content);
rex_dir::create($copyDir);
$this->assertTrue(rex_file::copy($orig, $copyDir), 'copy() returns true on success');
$this->assertEquals($content, rex_file::get($copyFile), 'content of new file is the same as of original file');
}
示例3: copy
/**
* Copies a directory
*
* @param string $srcdir Path of the source directory
* @param string $dstdir Path of the destination directory
* @return boolean TRUE on success, FALSE on failure
*/
public static function copy($srcdir, $dstdir)
{
$srcdir = rtrim($srcdir, DIRECTORY_SEPARATOR);
$dstdir = rtrim($dstdir, DIRECTORY_SEPARATOR);
if (!self::create($dstdir)) {
return false;
}
$state = true;
foreach (rex_finder::factory($srcdir)->recursive() as $srcfilepath => $srcfile) {
$dstfile = $dstdir . substr($srcfilepath, strlen($srcdir));
if ($srcfile->isDir()) {
$state = self::create($dstfile) && $state;
} else {
$state = rex_file::copy($srcfilepath, $dstfile) && $state;
}
}
return $state;
}
示例4: 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" />';
示例5: foreach
<?php
/**
* Backendstyle Addon.
*
* @author jan.kristinus[at]redaxo[dot]de Jan Kristinus
* @author <a href="http://www.yakamara.de">www.yakamara.de</a>
* @author markus[dot]staab[at]redaxo[dot]de Markus Staab
* @author <a href="http://www.redaxo.org">www.redaxo.org</a>
*
* @package redaxo5
*/
$files = [$this->getPath('vendor/bootstrap/assets/javascripts/bootstrap.js') => $this->getAssetsPath('javascripts/bootstrap.js'), $this->getPath('vendor/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.eot') => $this->getAssetsPath('fonts/bootstrap/glyphicons-halflings-regular.eot'), $this->getPath('vendor/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.svg') => $this->getAssetsPath('fonts/bootstrap/glyphicons-halflings-regular.svg'), $this->getPath('vendor/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf') => $this->getAssetsPath('fonts/bootstrap/glyphicons-halflings-regular.ttf'), $this->getPath('vendor/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.woff') => $this->getAssetsPath('fonts/bootstrap/glyphicons-halflings-regular.woff'), $this->getPath('vendor/font-awesome/fonts/fontawesome-webfont.eot') => $this->getAssetsPath('fonts/fontawesome-webfont.eot'), $this->getPath('vendor/font-awesome/fonts/fontawesome-webfont.svg') => $this->getAssetsPath('fonts/fontawesome-webfont.svg'), $this->getPath('vendor/font-awesome/fonts/fontawesome-webfont.ttf') => $this->getAssetsPath('fonts/fontawesome-webfont.ttf'), $this->getPath('vendor/font-awesome/fonts/fontawesome-webfont.woff') => $this->getAssetsPath('fonts/fontawesome-webfont.woff'), $this->getPath('vendor/font-awesome/fonts/fontawesome-webfont.woff2') => $this->getAssetsPath('fonts/fontawesome-webfont.woff2'), $this->getPath('vendor/font-awesome/fonts/FontAwesome.otf') => $this->getAssetsPath('fonts/FontAwesome.otf'), $this->getPath('vendor/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js') => $this->getAssetsPath('javascripts/perfect-scrollbar.jquery.min.js'), $this->getPath('vendor/perfect-scrollbar/css/perfect-scrollbar.min.css') => $this->getAssetsPath('css/perfect-scrollbar.min.css')];
foreach ($files as $source => $destination) {
rex_file::copy($source, $destination);
}
示例6: copyHtaccess
public static function copyHtaccess()
{
rex_file::copy(rex_path::addon('yrewrite', 'setup/.htaccess'), rex_path::frontend('.htaccess'));
}
示例7: foreach
<?php
/**
* Backendstyle Addon.
*
* @author jan.kristinus[at]redaxo[dot]de Jan Kristinus
* @author <a href="http://www.yakamara.de">www.yakamara.de</a>
* @author markus[dot]staab[at]redaxo[dot]de Markus Staab
* @author <a href="http://www.redaxo.org">www.redaxo.org</a>
*
* @package redaxo\be-style
*
* @var rex_addon $this
*/
$files = (require __DIR__ . '/vendor_files.php');
foreach ($files as $source => $destination) {
rex_file::copy($this->getPath($source), $this->getAssetsPath($destination));
}