本文整理汇总了PHP中VersionCheck类的典型用法代码示例。如果您正苦于以下问题:PHP VersionCheck类的具体用法?PHP VersionCheck怎么用?PHP VersionCheck使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VersionCheck类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display conference management index page.
*/
function index($args, &$request)
{
// Manager requests should come to the Conference context, not Sched Conf
if ($request->getRequestedSchedConfPath() != 'index') {
$request->redirect(null, 'index', 'manager');
}
$this->validate();
$this->setupTemplate($request);
$conference =& $request->getConference();
$templateMgr =& TemplateManager::getManager($request);
// Display a warning message if there is a new version of OJS available
$newVersionAvailable = false;
if (Config::getVar('general', 'show_upgrade_warning')) {
import('lib.pkp.classes.site.VersionCheck');
if ($latestVersion = VersionCheck::checkIfNewVersionExists()) {
$newVersionAvailable = true;
$templateMgr->assign('latestVersion', $latestVersion);
$currentVersion =& VersionCheck::getCurrentDBVersion();
$templateMgr->assign('currentVersion', $currentVersion->getVersionString());
// Get contact information for site administrator
$roleDao = DAORegistry::getDAO('RoleDAO');
$siteAdmins =& $roleDao->getUsersByRoleId(ROLE_ID_SITE_ADMIN);
$templateMgr->assign_by_ref('siteAdmin', $siteAdmins->next());
}
}
$templateMgr->assign('newVersionAvailable', $newVersionAvailable);
$schedConfDao = DAORegistry::getDAO('SchedConfDAO');
$schedConfs = $schedConfDao->getAll(false, $conference->getId());
$templateMgr->assign_by_ref('schedConfs', $schedConfs);
$templateMgr->assign('announcementsEnabled', $conference->getSetting('enableAnnouncements'));
$templateMgr->assign('helpTopicId', 'conference.index');
$templateMgr->display(ROLE_PATH_MANAGER . '/index.tpl');
}
开发者ID:artkuo,项目名称:ocs,代码行数:36,代码来源:ManagerHandler.inc.php
示例2: index
/**
* Display journal management index page.
*/
function index($args, $request)
{
$this->setupTemplate($request);
$journal = $request->getJournal();
$templateMgr = TemplateManager::getManager($request);
// Display a warning message if there is a new version of OJS available
$newVersionAvailable = false;
if (Config::getVar('general', 'show_upgrade_warning')) {
import('lib.pkp.classes.site.VersionCheck');
if ($latestVersion = VersionCheck::checkIfNewVersionExists()) {
$newVersionAvailable = true;
$templateMgr->assign('latestVersion', $latestVersion);
$currentVersion = VersionCheck::getCurrentDBVersion();
$templateMgr->assign('currentVersion', $currentVersion->getVersionString());
// Get contact information for site administrator
$roleDao = DAORegistry::getDAO('RoleDAO');
$siteAdmins = $roleDao->getUsersByRoleId(ROLE_ID_SITE_ADMIN);
$templateMgr->assign('siteAdmin', $siteAdmins->next());
}
}
$templateMgr->assign('newVersionAvailable', $newVersionAvailable);
$templateMgr->assign('publishingMode', $journal->getSetting('publishingMode'));
$templateMgr->assign('announcementsEnabled', $journal->getSetting('enableAnnouncements'));
$session = $request->getSession();
$session->unsetSessionVar('enrolmentReferrer');
$templateMgr->display('manager/index.tpl');
}
开发者ID:utlib,项目名称:ojs,代码行数:30,代码来源:ManagerHandler.inc.php
示例3: getPatch
/**
* Find the applicable patch for the current code version (if available).
* @param $versionInfo array as returned by parseVersionXML()
* @param $codeVersion as returned by getCurrentCodeVersion()
* @return string
*/
function getPatch(&$versionInfo, $codeVersion = null)
{
if (!isset($codeVersion)) {
$codeVersion =& VersionCheck::getCurrentCodeVersion();
}
if (isset($versionInfo['patch'][$codeVersion->getVersionString()])) {
return $versionInfo['patch'][$codeVersion->getVersionString()];
}
return null;
}
开发者ID:alenoosh,项目名称:ojs,代码行数:16,代码来源:VersionCheck.inc.php
示例4: executePluginTest
/**
* Executes the plug-in test.
* @param $pluginCategory string
* @param $pluginDir string
* @param $pluginName string
* @param $filterGroups array
*/
protected function executePluginTest($pluginCategory, $pluginDir, $pluginName, $filterGroups)
{
// Make sure that the xml configuration is valid.
$filterConfigFile = 'plugins/' . $pluginCategory . '/' . $pluginDir . '/filter/' . PLUGIN_FILTER_DATAFILE;
$this->validateXmlConfig(array('./' . $filterConfigFile, './lib/pkp/' . $filterConfigFile));
// Make sure that data from earlier tests is being deleted first.
$filterDao =& DAORegistry::getDAO('FilterDAO');
/* @var $filterDao FilterDAO */
foreach ($filterGroups as $filterGroupSymbolic) {
foreach ($filterDao->getObjectsByGroup($filterGroupSymbolic) as $filter) {
$filterDao->deleteObject($filter);
}
foreach ($filterDao->getObjectsByGroup($filterGroupSymbolic, 0, true) as $filter) {
$filterDao->deleteObject($filter);
}
}
$filterGroupDao =& DAORegistry::getDAO('FilterGroupDAO');
/* @var $filterGroupDao FilterGroupDAO */
foreach ($filterGroups as $filterGroupSymbolic) {
$filterGroupDao->deleteObjectBySymbolic($filterGroupSymbolic);
}
// Mock request and router.
import('lib.pkp.classes.core.PKPRouter');
import('classes.core.Request');
$mockRequest = $this->getMock('Request', array('getRouter', 'getUser'));
$router = new PKPRouter();
$mockRequest->expects($this->any())->method('getRouter')->will($this->returnValue($router));
$mockRequest->expects($this->any())->method('getUser')->will($this->returnValue(null));
Registry::set('request', $mockRequest);
// Instantiate the installer.
import('classes.install.Install');
$installFile = './lib/pkp/tests/plugins/testPluginInstall.xml';
$params = $this->getConnectionParams();
$installer = new Install($params, $installFile, true);
// Parse the plug-ins version.xml.
import('lib.pkp.classes.site.VersionCheck');
self::assertFileExists($versionFile = './plugins/' . $pluginCategory . '/' . $pluginDir . '/version.xml');
self::assertArrayHasKey('version', $versionInfo =& VersionCheck::parseVersionXML($versionFile));
self::assertType('Version', $pluginVersion =& $versionInfo['version']);
$installer->setCurrentVersion($pluginVersion);
// Install the plug-in.
self::assertTrue($installer->execute());
// Reset the hook registry.
Registry::set('hooks', $nullVar = null);
// Test whether the installation is idempotent.
self::assertTrue($installer->execute());
// Test whether the filter groups have been installed.
foreach ($filterGroups as $filterGroupSymbolic) {
// Check the group.
self::assertType('FilterGroup', $filterGroupDao->getObjectBySymbolic($filterGroupSymbolic), $filterGroupSymbolic);
}
}
开发者ID:ramonsodoma,项目名称:pkp-lib,代码行数:59,代码来源:PluginTestCase.inc.php
示例5: systemInfo
/**
* Show system information summary.
* @param $args array
* @param $request PKPRequest
*/
function systemInfo($args, $request)
{
$this->setupTemplate($request, true);
$versionDao = DAORegistry::getDAO('VersionDAO');
$currentVersion = $versionDao->getCurrentVersion();
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('currentVersion', $currentVersion);
if ($request->getUserVar('versionCheck')) {
$latestVersionInfo = VersionCheck::getLatestVersion();
$latestVersionInfo['patch'] = VersionCheck::getPatch($latestVersionInfo);
$templateMgr->assign('latestVersionInfo', $latestVersionInfo);
}
$templateMgr->display('admin/systemInfo.tpl');
}
开发者ID:jprk,项目名称:pkp-lib,代码行数:19,代码来源:AdminFunctionsHandler.inc.php
示例6: display
/**
* Display the form.
*/
function display()
{
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('localeOptions', $this->supportedLocales);
$templateMgr->assign('clientCharsetOptions', $this->supportedClientCharsets);
$templateMgr->assign('connectionCharsetOptions', $this->supportedConnectionCharsets);
$templateMgr->assign('databaseCharsetOptions', $this->supportedDatabaseCharsets);
$templateMgr->assign('encryptionOptions', $this->supportedEncryptionAlgorithms);
$templateMgr->assign('databaseDriverOptions', $this->checkDBDrivers());
$templateMgr->assign('supportsMBString', String::hasMBString() ? Locale::translate('common.yes') : Locale::translate('common.no'));
$templateMgr->assign('phpIsSupportedVersion', version_compare(PHP_REQUIRED_VERSION, PHP_VERSION) != 1);
$templateMgr->assign('phpRequiredVersion', PHP_REQUIRED_VERSION);
$templateMgr->assign('phpVersion', PHP_VERSION);
$templateMgr->assign('version', VersionCheck::getCurrentCodeVersion());
parent::display();
}
开发者ID:alenoosh,项目名称:ojs,代码行数:19,代码来源:InstallForm.inc.php
示例7: index
/**
* Display site admin index page.
*/
function index($args, &$request)
{
$this->validate();
$this->setupTemplate($request);
$templateMgr =& TemplateManager::getManager();
// Display a warning message if there is a new version of OJS available
$newVersionAvailable = false;
if (Config::getVar('general', 'show_upgrade_warning')) {
import('lib.pkp.classes.site.VersionCheck');
if ($latestVersion = VersionCheck::checkIfNewVersionExists()) {
$newVersionAvailable = true;
$templateMgr->assign('latestVersion', $latestVersion);
$currentVersion =& VersionCheck::getCurrentDBVersion();
$templateMgr->assign('currentVersion', $currentVersion->getVersionString());
}
}
$templateMgr->assign('newVersionAvailable', $newVersionAvailable);
$templateMgr->display('admin/index.tpl');
}
开发者ID:Rygbee,项目名称:harvester,代码行数:22,代码来源:AdminHandler.inc.php
示例8: journal
/**
* Display The Journal page.
* @param $args array
* @param $request PKPRequest
*/
function journal($args, $request)
{
$templateMgr = TemplateManager::getManager($request);
$this->setupTemplate($request);
// Display a warning message if there is a new version of OJS available
if (Config::getVar('general', 'show_upgrade_warning')) {
import('lib.pkp.classes.site.VersionCheck');
if ($latestVersion = VersionCheck::checkIfNewVersionExists()) {
$templateMgr->assign('newVersionAvailable', true);
$templateMgr->assign('latestVersion', $latestVersion);
$currentVersion = VersionCheck::getCurrentDBVersion();
$templateMgr->assign('currentVersion', $currentVersion->getVersionString());
// Get contact information for site administrator
$roleDao = DAORegistry::getDAO('RoleDAO');
$siteAdmins = $roleDao->getUsersByRoleId(ROLE_ID_SITE_ADMIN);
$templateMgr->assign('siteAdmin', $siteAdmins->next());
}
}
$templateMgr->display('management/settings/journal.tpl');
}
开发者ID:bkroll,项目名称:ojs,代码行数:25,代码来源:SettingsHandler.inc.php
示例9: systemInfo
/**
* Show system information summary.
*/
function systemInfo()
{
$this->validate();
$this->setupTemplate(true);
$configData =& Config::getData();
$dbconn =& DBConnection::getConn();
$dbServerInfo = $dbconn->ServerInfo();
$versionDao =& DAORegistry::getDAO('VersionDAO');
$currentVersion =& $versionDao->getCurrentVersion();
$versionHistory =& $versionDao->getVersionHistory();
$serverInfo = array('admin.server.platform' => Core::serverPHPOS(), 'admin.server.phpVersion' => Core::serverPHPVersion(), 'admin.server.apacheVersion' => function_exists('apache_get_version') ? apache_get_version() : Locale::translate('common.notAvailable'), 'admin.server.dbDriver' => Config::getVar('database', 'driver'), 'admin.server.dbVersion' => empty($dbServerInfo['description']) ? $dbServerInfo['version'] : $dbServerInfo['description']);
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign_by_ref('currentVersion', $currentVersion);
$templateMgr->assign_by_ref('versionHistory', $versionHistory);
$templateMgr->assign_by_ref('configData', $configData);
$templateMgr->assign_by_ref('serverInfo', $serverInfo);
if (Request::getUserVar('versionCheck')) {
$latestVersionInfo =& VersionCheck::getLatestVersion();
$latestVersionInfo['patch'] = VersionCheck::getPatch($latestVersionInfo);
$templateMgr->assign_by_ref('latestVersionInfo', $latestVersionInfo);
}
$templateMgr->display('admin/systemInfo.tpl');
}
开发者ID:ramonsodoma,项目名称:harvester,代码行数:26,代码来源:AdminFunctionsHandler.inc.php
示例10: fetch
/**
* Handle fetch requests for this plugin.
*/
function fetch()
{
$plugin =& $this->getPLNPlugin();
$templateMgr =& TemplateManager::getManager();
$journal =& Request::getJournal();
$templateMgr->assign_by_ref('journal', $journal);
$pluginVersionFile = $this->getPluginPath() . DIRECTORY_SEPARATOR . 'version.xml';
$pluginVersion =& VersionCheck::parseVersionXml($pluginVersionFile);
$templateMgr->assign_by_ref('pluginVersion', $pluginVersion);
$terms = array();
$termsAccepted = $plugin->termsAgreed($journal->getId());
if ($termsAccepted) {
$templateMgr->assign('termsAccepted', 'yes');
$terms = unserialize($plugin->getSetting($journal->getId(), 'terms_of_use'));
$termsAgreement = unserialize($plugin->getSetting($journal->getId(), 'terms_of_use_agreement'));
} else {
$templateMgr->assign('termsAccepted', 'no');
}
$termKeys = array_keys($terms);
$termsDisplay = array();
foreach ($termKeys as $key) {
$termsDisplay[] = array('key' => $key, 'term' => $terms[$key]['term'], 'updated' => $terms[$key]['updated'], 'accepted' => $termsAgreement[$key]);
}
$templateMgr->assign('termsDisplay', new ArrayItemIterator($termsDisplay));
$versionDao =& DAORegistry::getDAO('VersionDAO');
$ojsVersion =& $versionDao->getCurrentVersion();
$templateMgr->assign('ojsVersion', $ojsVersion->getVersionString());
$publishedArticlesDAO =& DAORegistry::getDAO('PublishedArticleDAO');
$range = new DBResultRange(PLN_PLUGIN_PING_ARTICLE_COUNT);
$publishedArticles =& $publishedArticlesDAO->getPublishedArticlesByJournalId($journal->getId(), $range, true);
$templateMgr->assign_by_ref('articles', $publishedArticles);
$templateMgr->assign_by_ref('pln_network', $plugin->getSetting($journal->getId(), 'pln_network'));
$templateMgr->display($this->getTemplatePath() . DIRECTORY_SEPARATOR . 'ping.tpl', 'text/xml');
return true;
}
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:38,代码来源:PLNGatewayPlugin.inc.php
示例11: display
/**
* Display the form.
*/
function display()
{
$templateMgr = TemplateManager::getManager($this->_request);
$templateMgr->assign('version', VersionCheck::getCurrentCodeVersion());
parent::display($this->_request);
}
开发者ID:jprk,项目名称:pkp-lib,代码行数:9,代码来源:MaintenanceForm.inc.php
示例12: checkIfNewVersionExists
/**
* Checks the application's version against the latest version
* on the PKP servers.
* @return string or false if no newer version
*/
function checkIfNewVersionExists()
{
$versionInfo =& VersionCheck::getLatestVersion();
$latestVersion = $versionInfo['release'];
$currentVersion =& VersionCheck::getCurrentDBVersion();
if ($currentVersion->compare($latestVersion) < 0) {
return $latestVersion;
} else {
return false;
}
}
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:16,代码来源:VersionCheck.inc.php
示例13: createData
/**
* Create initial required data.
* @return boolean
*/
function createData()
{
if ($this->getParam('manualInstall')) {
// Add insert statements for default data
// FIXME use ADODB data dictionary?
$this->executeSQL(sprintf('INSERT INTO site (primary_locale, installed_locales) VALUES (\'%s\', \'%s\')', $this->getParam('locale'), join(':', $this->installedLocales)));
$this->executeSQL(sprintf('INSERT INTO site_settings (setting_name, setting_type, setting_value, locale) VALUES (\'%s\', \'%s\', \'%s\', \'%s\')', 'title', 'string', addslashes(Locale::translate(INSTALLER_DEFAULT_SITE_TITLE)), $this->getParam('locale')));
$this->executeSQL(sprintf('INSERT INTO site_settings (setting_name, setting_type, setting_value, locale) VALUES (\'%s\', \'%s\', \'%s\', \'%s\')', 'contactName', 'string', addslashes(Locale::translate(INSTALLER_DEFAULT_SITE_TITLE)), $this->getParam('locale')));
$this->executeSQL(sprintf('INSERT INTO site_settings (setting_name, setting_type, setting_value, locale) VALUES (\'%s\', \'%s\', \'%s\', \'%s\')', 'contactEmail', 'string', addslashes($this->getParam('adminEmail')), $this->getParam('locale')));
$this->executeSQL(sprintf('INSERT INTO users (username, first_name, last_name, password, email, date_registered, date_last_login) VALUES (\'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\')', $this->getParam('adminUsername'), $this->getParam('adminUsername'), $this->getParam('adminUsername'), Validation::encryptCredentials($this->getParam('adminUsername'), $this->getParam('adminPassword'), $this->getParam('encryption')), $this->getParam('adminEmail'), Core::getCurrentDate(), Core::getCurrentDate()));
$this->executeSQL(sprintf('INSERT INTO roles (conference_id, user_id, role_id) VALUES (%d, (SELECT user_id FROM users WHERE username = \'%s\'), %d)', 0, $this->getParam('adminUsername'), ROLE_ID_SITE_ADMIN));
// Install email template list and data for each locale
$emailTemplateDao =& DAORegistry::getDAO('EmailTemplateDAO');
foreach ($emailTemplateDao->installEmailTemplates($emailTemplateDao->getMainEmailTemplatesFilename(), true) as $sql) {
$this->executeSQL($sql);
}
foreach ($this->installedLocales as $locale) {
foreach ($emailTemplateDao->installEmailTemplateData($emailTemplateDao->getMainEmailTemplateDataFilename($locale), true) as $sql) {
$this->executeSQL($sql);
}
}
} else {
// Add initial site data
$locale = $this->getParam('locale');
$siteDao =& DAORegistry::getDAO('SiteDAO', $this->dbconn);
$site = new Site();
$site->setRedirect(0);
$site->setMinPasswordLength(INSTALLER_DEFAULT_MIN_PASSWORD_LENGTH);
$site->setPrimaryLocale($locale);
$site->setInstalledLocales($this->installedLocales);
$site->setSupportedLocales($this->installedLocales);
if (!$siteDao->insertSite($site)) {
$this->setError(INSTALLER_ERROR_DB, $this->dbconn->errorMsg());
return false;
}
$siteSettingsDao =& DAORegistry::getDAO('SiteSettingsDAO');
$siteSettingsDao->updateSetting('title', array($locale => Locale::translate(INSTALLER_DEFAULT_SITE_TITLE)), null, true);
$siteSettingsDao->updateSetting('contactName', array($locale => Locale::translate(INSTALLER_DEFAULT_SITE_TITLE)), null, true);
$siteSettingsDao->updateSetting('contactEmail', array($locale => $this->getParam('adminEmail')), null, true);
// Add initial site administrator user
$userDao =& DAORegistry::getDAO('UserDAO', $this->dbconn);
$user = new User();
$user->setUsername($this->getParam('adminUsername'));
$user->setPassword(Validation::encryptCredentials($this->getParam('adminUsername'), $this->getParam('adminPassword'), $this->getParam('encryption')));
$user->setFirstName($user->getUsername());
$user->setLastName('');
$user->setEmail($this->getParam('adminEmail'));
if (!$userDao->insertUser($user)) {
$this->setError(INSTALLER_ERROR_DB, $this->dbconn->errorMsg());
return false;
}
$roleDao =& DAORegistry::getDao('RoleDAO', $this->dbconn);
$role = new Role();
$role->setConferenceId(0);
$role->setUserId($user->getId());
$role->setRoleId(ROLE_ID_SITE_ADMIN);
if (!$roleDao->insertRole($role)) {
$this->setError(INSTALLER_ERROR_DB, $this->dbconn->errorMsg());
return false;
}
// Install email template list and data for each locale
$emailTemplateDao =& DAORegistry::getDAO('EmailTemplateDAO');
$emailTemplateDao->installEmailTemplates($emailTemplateDao->getMainEmailTemplatesFilename());
foreach ($this->installedLocales as $locale) {
$emailTemplateDao->installEmailTemplateData($emailTemplateDao->getMainEmailTemplateDataFilename($locale));
}
// Add initial plugin data to versions table
$versionDao =& DAORegistry::getDAO('VersionDAO');
import('site.VersionCheck');
$categories = PluginRegistry::getCategories();
foreach ($categories as $category) {
PluginRegistry::loadCategory($category, true);
$plugins = PluginRegistry::getPlugins($category);
foreach ($plugins as $plugin) {
$versionFile = $plugin->getPluginPath() . '/version.xml';
if (FileManager::fileExists($versionFile)) {
$versionInfo =& VersionCheck::parseVersionXML($versionFile);
$pluginVersion = $versionInfo['version'];
$pluginVersion->setCurrent(1);
$versionDao->insertVersion($pluginVersion);
} else {
$pluginVersion = new Version();
$pluginVersion->setMajor(1);
$pluginVersion->setMinor(0);
$pluginVersion->setRevision(0);
$pluginVersion->setBuild(0);
$pluginVersion->setDateInstalled(Core::getCurrentDate());
$pluginVersion->setCurrent(1);
$pluginVersion->setProductType('plugins.' . $category);
$pluginVersion->setProduct(basename($plugin->getPluginPath()));
$versionDao->insertVersion($pluginVersion);
}
}
}
}
return true;
//.........这里部分代码省略.........
开发者ID:jalperin,项目名称:ocs,代码行数:101,代码来源:Install.inc.php
示例14: elseif
}
} elseif (strlen($subtext)) {
imagettftext($image, 11, 0, $imageMarginLeft, 43, $color, $font, $subtext);
}
return $image;
}
private function displayImage($arrText)
{
header('Content-Type: image/png');
//show empty pixel if version is recent
if ($arrText[0] == 0) {
echo base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=');
exit;
}
//Check for cached images
$strCacheName = md5($arrText[0] . '_' . $arrText[4] . '_' . $arrText[5] . '_' . $arrText[6]);
$strCacheFolder = 'cache/images/';
if (file_exists($strCacheFolder . $strCacheName . '.png') && filemtime($strCacheFolder . $strCacheName . '.png') + 3600 > time()) {
echo file_get_contents($strCacheFolder . $strCacheName . '.png');
exit;
} else {
$image = $this->createImageWithText($arrText[1], $arrText[2], $arrText[3], $arrText[0]);
imagepng($image, $strCacheFolder . $strCacheName . '.png', 0);
imagedestroy($image);
echo file_get_contents($strCacheFolder . $strCacheName . '.png');
exit;
}
}
}
$versionCheck = new VersionCheck();
$versionCheck->handler();
开发者ID:EQdkpPlus,项目名称:misc-wikitools,代码行数:31,代码来源:tools.php
示例15: display
/**
* Display the form.
*/
function display()
{
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('localeOptions', $this->supportedLocales);
$templateMgr->assign('localesComplete', $this->localesComplete);
$templateMgr->assign('clientCharsetOptions', $this->supportedClientCharsets);
$templateMgr->assign('connectionCharsetOptions', $this->supportedConnectionCharsets);
$templateMgr->assign('databaseCharsetOptions', $this->supportedDatabaseCharsets);
$templateMgr->assign('encryptionOptions', $this->supportedEncryptionAlgorithms);
$templateMgr->assign('allowFileUploads', get_cfg_var('file_uploads') ? __('common.yes') : __('common.no'));
$templateMgr->assign('maxFileUploadSize', get_cfg_var('upload_max_filesize'));
$templateMgr->assign('databaseDriverOptions', $this->checkDBDrivers());
$templateMgr->assign('supportsMBString', String::hasMBString() ? __('common.yes') : __('common.no'));
$templateMgr->assign('phpIsSupportedVersion', version_compare(PHP_REQUIRED_VERSION, PHP_VERSION) != 1);
$templateMgr->assign('phpRequiredVersion', PHP_REQUIRED_VERSION);
$templateMgr->assign('phpVersion', PHP_VERSION);
$templateMgr->assign('version', VersionCheck::getCurrentCodeVersion());
$templateMgr->assign('passwordLength', INSTALLER_DEFAULT_MIN_PASSWORD_LENGTH);
parent::display();
}
开发者ID:EreminDm,项目名称:water-cao,代码行数:23,代码来源:InstallForm.inc.php
示例16: display
/**
* @copydoc Form::display
*/
function display($request = null, $template = null)
{
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('version', VersionCheck::getCurrentCodeVersion());
parent::display($request, $template);
}
开发者ID:pkp,项目名称:pkp-lib,代码行数:9,代码来源:MaintenanceForm.inc.php
示例17: explode
/**
* Checks whether the given version file exists and whether it
* contains valid data. Returns a Version object if everything
* is ok, otherwise null.
*
* @param $versionFile string
* @param $templateMgr TemplateManager
* @return Version or null if invalid or missing version file
*/
function &getValidPluginVersionInfo($versionFile, &$templateMgr)
{
$nullVar = null;
if (FileManager::fileExists($versionFile)) {
$versionInfo =& VersionCheck::parseVersionXML($versionFile);
} else {
$templateMgr->assign('message', 'manager.plugins.versionFileNotFound');
return $nullVar;
}
$pluginVersion =& $versionInfo['version'];
// Validate plugin name and type to avoid abuse
$productType = explode(".", $versionInfo['type']);
if (count($productType) != 2 || $productType[0] != 'plugins') {
return $nullVar;
$templateMgr->assign('message', 'manager.plugins.versionFileInvalid');
}
$namesToValidate = array($pluginVersion->getProduct(), $productType[1]);
foreach ($namesToValidate as $nameToValidate) {
if (!String::regexp_match('/[a-z][a-zA-Z0-9]+/', $nameToValidate)) {
return $nullVar;
$templateMgr->assign('message', 'manager.plugins.versionFileInvalid');
}
}
return $pluginVersion;
}
开发者ID:master3395,项目名称:CBPPlatform,代码行数:34,代码来源:VersionCheck.inc.php
示例18: upgradePlugin
/**
* Upgrade a plugin to a newer version from the user's filesystem
* @param $path string path to plugin Directory
* @param $templateMgr reference to template manager
* @return boolean
*/
function upgradePlugin($path, &$templateMgr)
{
$this->validate();
$versionFile = $path . VERSION_FILE;
$templateMgr->assign('error', true);
$templateMgr->assign('path', 'upgrade');
$pluginVersion =& VersionCheck::getValidPluginVersionInfo($versionFile, $templateMgr);
if (is_null($pluginVersion)) {
return false;
}
assert(is_a($pluginVersion, 'Version'));
$versionDao =& DAORegistry::getDAO('VersionDAO');
$installedPlugin = $versionDao->getCurrentVersion($pluginVersion->getProduct(), true);
if (!$installedPlugin) {
$templateMgr->assign('message', 'manager.plugins.pleaseInstall');
return false;
}
if ($this->checkIfNewer($pluginVersion->getProduct(), $pluginVersion)) {
$templateMgr->assign('message', 'manager.plugins.installedVersionNewer');
return false;
} else {
$pluginDest = Core::getBaseDir() . DIRECTORY_SEPARATOR . strtr($pluginVersion->getProductType(), '.', DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $pluginVersion->getProduct();
FileManager::rmtree($pluginDest);
if (FileManager::fileExists($pluginDest, 'dir')) {
$templateMgr->assign('message', 'manager.plugins.deleteError');
return false;
}
if (!FileManager::copyDir($path, $pluginDest)) {
$templateMgr->assign('message', 'manager.plugins.copyError');
return false;
}
$upgradeFile = $pluginDest . UPGRADE_FILE;
if (FileManager::fileExists($upgradeFile)) {
$params = $this->setConnectionParams();
$installer = new Upgrade($params, $upgradeFile, true);
if (!$installer->execute()) {
$templateMgr->assign('message', array('manager.plugins.upgradeFailed', $installer->getErrorString()));
return false;
}
}
$installedPlugin->setCurrent(0);
$pluginVersion->setCurrent(1);
$versionDao->insertVersion($pluginVersion, true);
$templateMgr->assign('message', array('manager.plugins.upgradeSuccessful', $pluginVersion->getVersionString()));
$templateMgr->assign('uploaded', true);
$templateMgr->assign('error', false);
return true;
}
}
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:55,代码来源:PluginManagementHandler.inc.php
示例19: addPluginVersions
/**
* Insert or update plugin data in versions
* and plugin_settings tables.
* @return boolean
*/
function addPluginVersions()
{
$versionDao =& DAORegistry::getDAO('VersionDAO');
import('lib.pkp.classes.site.VersionCheck');
$fileManager = new FileManager();
$categories = PluginRegistry::getCategories();
foreach ($categories as $category) {
PluginRegistry::loadCategory($category);
$plugins = PluginRegistry::getPlugins($category);
if (is_array($plugins)) {
foreach ($plugins as $plugin) {
$versionFile = $plugin->getPluginPath() . '/version.xml';
if ($fileManager->fileExists($versionFile)) {
$versionInfo =& VersionCheck::parseVersionXML($versionFile);
$pluginVersion = $versionInfo['version'];
} else {
$pluginVersion = new Version(1, 0, 0, 0, Core::getCurrentDate(), 1, 'plugins.' . $category, basename($plugin->getPluginPath()), '', 0, $plugin->isSitePlugin());
}
$versionDao->insertVersion($pluginVersion, true);
}
}
}
return true;
}
开发者ID:EreminDm,项目名称:water-cao,代码行数:29,代码来源:Installer.inc.php
示例20: upgradePlugin
/**
* Upgrade a plugin to a newer version from the user's filesystem
* @param $category string
* @param $plugin string
* @param $path string path to plugin Directory
* @param $category string
* @param $plugin string
* @return Version|null The upgraded version, on success; null on fail
*/
function upgradePlugin($category, $plugin, $path, &$errorMsg)
{
$versionFile = $path . '/' . PLUGIN_VERSION_FILE;
$pluginVersion = VersionCheck::getValidPluginVersionInfo($versionFile, $errorMsg);
if (!$pluginVersion) {
return null;
}
// Check whether the uploaded plug-in fits the original plug-in.
if ('plugins.' . $category != $pluginVersion->getProductType()) {
$errorMsg = __('manager.plugins.wrongCategory');
return null;
}
if ($plugin != $pluginVersion->getProduct()) {
$errorMsg = __('manager.plugins.wrongName');
return null;
}
$versionDao = DAORegistry::getDAO('VersionDAO');
$installedPlugin = $versionDao->getCurrentVersion($pluginVersion->getProductType(), $pluginVersion->getProduct(), true);
if (!$installedPlugin) {
$errorMsg = __('manager.plugins.pleaseInstall');
return null;
}
if ($this->_checkIfNewer($pluginVersion->getProductType(), $pluginVersion->getProduct(), $pluginVersion)) {
$errorMsg = __('manager.plugins.installedVersionNewer');
return null;
} else {
$pluginDest = Core::getBaseDir() . '/plugins/' . $category . '/' . $plugin;
$pluginLibDest = Core::getBaseDir() . '/' . PKP_LIB_PATH . '/plugins/' . $category . '/' . $plugin;
// Delete existing files.
$fileManager = new FileManager();
if (is_dir($pluginDest)) {
$fileManager->rmtree($pluginDest);
}
if (is_dir($pluginLibDest)) {
$fileManager->rmtree($pluginLibDest);
}
// Check whether deleting has worked.
if (is_dir($pluginDest) || is_dir($pluginLibDest)) {
$errorMsg = __('message', 'manager.plugins.deleteError');
return null;
}
// Copy the plug-in from the temporary folder to the
// target folder.
// Start with the library part (if any).
$libPath = $path . '/lib';
if (is_dir($libPath)) {
if (!$fileManager->copyDir($libPath, $pluginLibDest)) {
$errorMsg = __('manager.plugins.copyError');
return null;
}
// Remove the library part of the temporary folder.
$fileManager->rmtree($libPath);
}
// Continue with the application-specific part (mandatory).
if (!$fileManager->copyDir($path, $pluginDest)) {
$errorMsg = __('manager.plugins.copyError');
return null;
}
// Remove the temporary folder.
$fileManager->rmtree(dirname($path));
$upgradeFile = $pluginDest . '/' . PLUGIN_UPGRADE_FILE;
if ($fileManager->fileExists($upgradeFile)) {
$params = $this->_getConnectionParams();
$installer = new Upgrade($params, $upgradeFile, true);
if (!$installer->execute()) {
$errorMsg = __('manager.plugins.upgradeFailed', array('errorString' => $installer->getErrorString()));
return null;
}
}
$installedPlugin->setCurrent(0);
$pluginVersion->setCurrent(1);
$versionDao->insertVersion($pluginVersion, true);
return $pluginVersion;
}
}
开发者ID:doana,项目名称:pkp-lib,代码行数:84,代码来源:PluginHelper.inc.php
注:本文中的VersionCheck类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论