Your custom-made Enterprise Server Plug-ins that were developed for previous versions of Enterprise Server might no longer be compatible with Enterprise 9.
Ask your integrator to check your custom plug-ins for compatibility and optionally have them made compatible before installing them in Enterprise Server 9.
Notes for the integrator
Check your plug-ins for usage of the following functions in the PluginInfo.php files:
- isInstalled()
- runInstallation()
If used, please refer to the following file for a description of the required changes for Enterprise 9.0 compatibility:
- Enterprise/server/interfaces/plugins/EnterprisePlugin.class.php
In short, the file describes that the isInstalled()
function should be removed and that for most cases you need to use a TestCase instead of using the runInstallation() function.
You can add your own TestCase to show up at the Health Check page. To do so, follow these steps:
Step 1. Create a file with the following name:
- config/plugins/Foo/testsuite/HealthCheck2/Foo_TestCase.php
Step 2. Add the following code fragment to the file (assumed is that your plug-in is named Foo).
Note: Pay attention to the strong name convention for the folder name and class name: both require your plug-in name. By adding the TestCase it should automatically be picked up by the Health Check page.
require_once BASEDIR.'/server/wwtest/testsuite/TestSuiteInterfaces.php';
class WW_TestSuite_HealthCheck2_Foo_TestCase extends TestCase
{
public function getDisplayName() { return '... your description ...'; }
public function getTestGoals() { return '... your description ...'; }
public function getTestMethods() { return '... your description ...'; }
public function getPrio() { return 0; }
final public function runTest()
{
if( ... your condition ... ) {
$this->setResult( 'ERROR', '... your error message ...' );
}
}
}
Test case modules
If you have TestCase modules shipped with your plug-in to show up on the Health Check page, it is no longer needed to check if your plug-in is enabled. Enterprise 9 does this for you automatically and therefore code fragments like the following can be removed from your TestCase modules:
// When plug-in is not installed or disabled, skip test and refer to the Server Plug-ins page to install/enable.
$pluginObj = BizServerPlugin::getPluginForConnector( 'Foo' );
if( $pluginObj && $pluginObj->IsInstalled ) {
if( !$pluginObj->IsActive ) {
$this->setResult('NOTINSTALLED', 'The Foo plug-in is disabled.' );
return;
}
} else {
$this->setResult('NOTINSTALLED', 'The Foo plug-in is not installed.' );
return;
}
Automated test scripts
If you have an automated test script for you plug-in, you can enable your plug-in on-the-fly. After running the test, you can disable the plug-in again. For example:
final public function runTest()
{
// Make sure the Foo plugin is active (enabled).
require_once BASEDIR.'/server/utils/TestSuite.php';
$utils = new WW_Utils_TestSuite();
$didActivate = $utils->activatePluginByName( $this, 'Foo' );
if( is_null($didActivate) ) { // NULL indicates error.
return; // Errors are already handled.
}
// Run the test.
...
// De-activate the Foo plugin again (but only when we did activate).
if( $didActivate ) {
$utils->deactivatePluginByName( $this, 'Foo' );
}
}
Server enabled check
Checking wether a certain plug-in is enabled was previously done as follows:
if( BizServerPlugin::checkPluginInstalled( 'Foo_PubPublishing' ) ) {
...
}
The checkPluginInstalled() function is no longer supported and therefore code fragments like above needs to be written as follows:
if( BizServerPlugin::isPluginActivated( 'Foo' ) ) {
...
}
Note: The connector interface name (such as. PubPublishing) is no longer given. Pass in the plug-in name only.
Tip: The Enterprise/server/interfaces/plugins/EnterprisePlugin.class.php file describes 3 new functions and provides you with more control over the installation procedure of your plug-ins. Refer to the file for more information.
Related Information
The Server Plug-ins page in Enterprise Server 9
About the ImageMagick Preview Server plug-in for Enterprise Server 9
Related Tasks
Managing Server plug-ins in Enterprise Server 9
Installing a custom Enterprise Server plug-in in Enterprise Server 9
Uninstalling a custom Enterprise Server plug-in from Enterprise Server 9
Reference Materials
Enterprise Server plug-ins are not working after installing or upgrading Enterprise Server
Comment
Do you have corrections or additional information about this article? Leave a comment! Do you have a question about what is described in this article? Please contact Support.
0 comments
Please sign in to leave a comment.