本文整理汇总了PHP中rex_path::pluginAssets方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_path::pluginAssets方法的具体用法?PHP rex_path::pluginAssets怎么用?PHP rex_path::pluginAssets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex_path
的用法示例。
在下文中一共展示了rex_path::pluginAssets方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doAction
public function doAction()
{
global $I18N, $REX;
// $REX is needed for update.inc.php
$path = rex_path::addon($this->addonkey);
$temppath = rex_path::addon('.new.' . $this->addonkey);
if (($msg = $this->extractArchiveTo($temppath)) !== true) {
return $msg;
}
// ---- include update.php
if (file_exists($temppath . 'update.inc.php')) {
try {
require $temppath . 'update.inc.php';
} catch (rex_install_functional_exception $e) {
return $e->getMessage();
}
if (($msg = OOAddon::getProperty($this->addonkey, 'updatemsg', '')) != '') {
return $msg;
}
if (!OOAddon::getProperty($this->addonkey, 'update', true)) {
return $I18N->msg('package_no_reason');
}
}
// ---- backup
$assets = rex_path::addonAssets($this->addonkey);
if (OOAddon::getProperty('install', 'backups')) {
$archivePath = rex_path::addonData('install', $this->addonkey . '/');
rex_dir::create($archivePath);
$archive = $archivePath . strtolower(preg_replace('/[^a-z0-9-_.]/i', '_', OOAddon::getVersion($this->addonkey))) . '.zip';
rex_install_archive::copyDirToArchive($path, $archive);
if (is_dir($assets)) {
rex_install_archive::copyDirToArchive($assets, $archive, 'assets');
}
}
// ---- copy plugins to new addon dir
foreach (OOPlugin::getRegisteredPlugins($this->addonkey) as $plugin) {
$pluginPath = $temppath . '/plugins/' . $plugin;
if (!is_dir($pluginPath)) {
rex_dir::copy(rex_path::plugin($this->addonkey, $plugin), $pluginPath);
} elseif (OOPlugin::isInstalled($this->addonkey, $plugin) && is_dir($pluginPath . '/files')) {
rex_dir::copy($pluginPath . '/files', rex_path::pluginAssets($this->addonkey, $plugin));
}
}
// ---- update main addon dir
rex_dir::delete($path);
rename($temppath, $path);
// ---- update assets
$origAssets = rex_path::addon($this->addonkey, 'assets');
if (is_dir($origAssets)) {
rex_dir::copy($origAssets, $assets);
}
OOAddon::setProperty($this->addonkey, 'version', $this->file['version']);
rex_install_packages::updatedPackage($this->addonkey, $this->fileId);
}
示例2: init
/**
* very basic setup steps, so everything is in place for our browser-based setup wizard.
*
* @param string $skinAddon
* @param string $skinPlugin
*/
public static function init($skinAddon = 'be_style', $skinPlugin = 'redaxo')
{
// initial purge all generated files
rex_delete_cache();
// delete backend session
rex_backend_login::deleteSession();
// copy alle media files of the current rex-version into redaxo_media
rex_dir::copy(rex_path::core('assets'), rex_path::assets());
// copy skins files/assets
rex_dir::copy(rex_path::addon($skinAddon, 'assets'), rex_path::addonAssets($skinAddon));
rex_dir::copy(rex_path::plugin($skinAddon, $skinPlugin, 'assets'), rex_path::pluginAssets($skinAddon, $skinPlugin));
}
示例3: getAssetsPath
/**
* {@inheritdoc}
*/
public function getAssetsPath($file = '')
{
return rex_path::pluginAssets($this->getAddon()->getName(), $this->getName(), $file);
}