本文整理汇总了PHP中rex_path::addon方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_path::addon方法的具体用法?PHP rex_path::addon怎么用?PHP rex_path::addon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex_path
的用法示例。
在下文中一共展示了rex_path::addon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createArchives
private function createArchives()
{
$path = rex_path::base('releases/' . $this->version . '/');
if (file_exists($path)) {
rex_dir::deleteFiles($path);
}
rex_dir::create($path);
$complete = new ZipArchive();
$update = new ZipArchive();
$complete->open($path . 'redaxo_' . $this->version . '.zip', ZipArchive::CREATE);
$update->open($path . 'redaxo_update_' . $this->version . '.zip', ZipArchive::CREATE);
$files = ['assets/.redaxo', 'media/.redaxo', 'redaxo/cache/.htaccess', 'redaxo/cache/.redaxo', 'redaxo/data/.htaccess', 'redaxo/data/.redaxo', 'redaxo/src/.htaccess', 'redaxo/index.php', 'index.php', 'LICENSE.md', 'README.md'];
foreach ($files as $file) {
$complete->addFile(rex_path::base($file), $file);
}
$this->addDir($complete, rex_path::core(), 'redaxo/src/core');
$this->addDir($update, rex_path::core(), 'core');
foreach (self::$addons as $addon) {
$this->addDir($complete, rex_path::addon($addon), 'redaxo/src/addons/' . $addon);
$this->addDir($update, rex_path::addon($addon), 'addons/' . $addon);
}
$this->addDir($complete, rex_path::core('assets'), 'assets');
$addon = rex_addon::get('be_style');
$this->addDir($complete, $addon->getPath('assets'), 'assets/addons/be_style');
$this->addDir($complete, $addon->getPlugin('redaxo')->getPath('assets'), 'assets/addons/be_style/plugins/redaxo');
$files = (require $addon->getPath('vendor_files.php'));
foreach ($files as $source => $destination) {
$complete->addFile($addon->getPath($source), 'assets/addons/be_style/' . $destination);
}
$complete->close();
$update->close();
}
示例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"));
}
示例3: 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);
}
示例4: __construct
public function __construct($tableName, $fieldset, $whereCondition, $method = 'post', $debug = false)
{
parent::rex_form($tableName, $fieldset, $whereCondition, $method, $debug);
if (OOAddon::isAvailable('metainfo')) {
require_once rex_path::addon('metainfo', 'extensions/extension_art_metainfo.inc.php');
$this->sqlFields = _rex_a62_metainfo_sqlfields(global_settings_metainfo::PREFIX, '');
}
}
示例5: doAction
protected function doAction()
{
if (($msg = $this->extractArchiveTo(rex_path::addon($this->addonkey))) !== true) {
return $msg;
}
rex_package_manager::synchronizeWithFileSystem();
rex_install_packages::addedPackage($this->addonkey);
}
示例6: __construct
public function __construct()
{
$this->root_dir = rex_path::addon('be_style');
$this->scss_file = rex_path::addon('be_style', 'assets') . 'styles.scss';
$this->css_file = rex_path::addon('be_style', 'assets') . 'styles.css';
$this->formatter = 'scss_formatter_compressed';
$this->strip_comments = true;
}
示例7: __construct
public function __construct($tableName, $fieldset, $whereCondition, $method = 'post', $debug = false)
{
parent::rex_form($tableName, $fieldset, $whereCondition, $method, $debug);
if (OOAddon::isAvailable('metainfo')) {
require_once rex_path::addon('metainfo', 'extensions/extension_art_metainfo.inc.php');
$sqlCols = rex_asd_news_config::getConfig('sql');
$this->sqlFields = _rex_a62_metainfo_sqlfields('asd_', 'AND (`p`.`restrictions` = "" OR p.`restrictions` LIKE "%|' . $this->getValue($sqlCols['category']) . '|%") ');
}
}
示例8: execute
public function execute()
{
$config = rex_plugin::get('cronjob', 'article_status')->getProperty('config');
$from = $config['from'];
$to = $config['to'];
$from['before'] = (array) $from['before'];
$to['before'] = (array) $to['before'];
$sql = rex_sql::factory();
// $sql->setDebug();
$sql->setQuery('
SELECT name
FROM ' . rex::getTablePrefix() . 'metainfo_field
WHERE name="' . $from['field'] . '" OR name="' . $to['field'] . '"
');
$rows = $sql->getRows();
if ($rows < 2) {
if ($rows == 0) {
$msg = 'Metainfo fields "' . $from['field'] . '" and "' . $to['field'] . '" not found';
} else {
$field = $sql->getValue('name') == $from['field'] ? $to['field'] : $from['field'];
$msg = 'Metainfo field "' . $field . '" not found';
}
$this->setMessage($msg);
return false;
}
$time = time();
$sql->setQuery('
SELECT id, clang_id, status
FROM ' . rex::getTablePrefix() . 'article
WHERE
( ' . $from['field'] . ' > 0
AND ' . $from['field'] . ' < ' . $time . '
AND status IN (' . implode(',', $from['before']) . ')
AND (' . $to['field'] . ' > ' . $time . ' OR ' . $to['field'] . ' = 0 OR ' . $to['field'] . ' = "")
)
OR
( ' . $to['field'] . ' > 0
AND ' . $to['field'] . ' < ' . $time . '
AND status IN (' . implode(',', $to['before']) . ')
)
');
$rows = $sql->getRows();
include_once rex_path::addon('structure', 'functions/function_rex_structure.php');
for ($i = 0; $i < $rows; ++$i) {
if (in_array($sql->getValue('status'), $from['before'])) {
$status = $from['after'];
} else {
$status = $to['after'];
}
rex_article_service::articleStatus($sql->getValue('id'), $sql->getValue('clang_id'), $status);
$sql->next();
}
$this->setMessage('Updated articles: ' . $rows);
return true;
}
示例9: 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));
}
示例10: readFolder
function readFolder($dir)
{
if (!is_dir($dir)) {
rex_dir::copy(rex_path::addon('import_export', 'backup'), rex_path::addonData('import_export', 'backups'));
}
$hdl = opendir($dir);
$folder = array();
while (false !== ($file = readdir($hdl))) {
$folder[] = $file;
}
return $folder;
}
示例11: getMyPackages
public static function getMyPackages()
{
if (is_array(self::$myPackages)) {
return self::$myPackages;
}
self::$myPackages = self::getPackages('?only_my=1');
foreach (self::$myPackages as $key => $addon) {
if (!is_dir(rex_path::addon($key))) {
unset(self::$myPackages[$key]);
}
}
return self::$myPackages;
}
示例12: 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;
}
示例13: 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));
}
示例14: asImage
public function asImage()
{
if ($this->asImage) {
return;
}
$this->asImage = true;
$this->image = [];
$this->image['format'] = strtolower(rex_file::extension($this->getMediapath()));
$this->image['src'] = false;
// if mimetype detected and in imagemap -> change format
if (class_exists('finfo') && ($finfo = new finfo(FILEINFO_MIME_TYPE))) {
if ($ftype = @$finfo->file($this->image['filepath'])) {
if (array_key_exists($ftype, $this->mimetypeMap)) {
$this->image['format'] = $this->mimetypeMap[$ftype];
}
}
}
if ($this->image['format'] == 'jpg' || $this->image['format'] == 'jpeg') {
$this->image['format'] = 'jpeg';
$this->image['src'] = @imagecreatefromjpeg($this->getMediapath());
} elseif ($this->image['format'] == 'gif') {
$this->image['src'] = @imagecreatefromgif($this->getMediapath());
} elseif ($this->image['format'] == 'wbmp') {
$this->image['src'] = @imagecreatefromwbmp($this->getMediapath());
} else {
$this->image['src'] = @imagecreatefrompng($this->getMediapath());
if ($this->image['src']) {
imagealphablending($this->image['src'], false);
imagesavealpha($this->image['src'], true);
$this->image['format'] = 'png';
}
}
if (!$this->image['src']) {
$this->setMediapath(rex_path::addon('media_manager', 'media/warning.jpg'));
$this->asImage();
} else {
$this->refreshImageDimensions();
}
}
示例15:
<?php
rex_yform::addTemplatePath(rex_path::addon('yform', 'ytemplates'));