I need to get an input string from the user and do something with it during the install. I see there’s a window for that. Can I get an example of how to use it? I might need a yes/no question too.
'setup-options' => 'HTML code goes here',
No, it’s not mandatory. I need to make it so that it skips the page if there is no license found. That should be a bug.
Also, is the license screen mandatory or is there a way to skip it during the install?
<?php
echo "Running install-script.php";
$obj = $modx->getObject('modSnippet',array('name'=>'SPForm')); // newly created snippet object
if (!$obj) {
die("SPForm snippet not found<br>");
}
$newRecipientArray = 'Webmaster :' . $_POST['user_email'];
//$newRecipientArray = 'Webmaster :' . $user_email;
$props = array(
array (
'name'=>'recipientArray',
'desc'=>'Recipients',
'type'=>'textfield',
'options'=>'',
'value'=>$newRecipientArray
),
array(
'name'=>'errorsTo',
'desc'=>'Where to email error reports',
'type'=>'textfield',
'options'=>'',
'value'=>$newRecipientArray
)
);
if ($obj->setProperties($props, true) == false) {
die("Couldn't set properties");
}
if ($obj->save() == false ) {
die("Couldn't save properties");
}
?>Attempting to install package with signature: SPForm-3.0.5-beta
Package found...now preparing to install.
Grabbing package workspace...
Workspace environment initiated, now installing package...
PHP notice: Undefined variable: user_email
PHP notice: Undefined property: xPDOVehicle::$modx
Attempting to install package with signature: SPForm-3.0.5-beta
Package found...now preparing to install.
Grabbing package workspace...
Workspace environment initiated, now installing package...
PHP notice: Undefined variable: obj
Attempting to install package with signature: SPForm-3.0.5-beta
Package found...now preparing to install.
Grabbing package workspace...
Workspace environment initiated, now installing package...
PHP notice: Undefined property: xPDOVehicle::$modx
Attempting to install package with signature: SPForm-3.0.5-beta
Package found...now preparing to install.
Grabbing package workspace...
Workspace environment initiated, now installing package...
PHP notice: Undefined variable: modx
Attempting to install package with signature: SPForm-3.0.5-beta
Package found...now preparing to install.
Grabbing package workspace...
Workspace environment initiated, now installing package...
Successfully installed package SPForm-3.0.5-beta
Attempting to install package with signature: SPForm-3.0.5-beta
Package found...now preparing to install.
Grabbing package workspace...
Workspace environment initiated, now installing package...
Successfully installed package SPForm-3.0.5-beta
Attempting to install package with signature: SPForm-3.0.5-beta
Package found...now preparing to install.
Grabbing package workspace...
Workspace environment initiated, now installing package...
PHP notice: Undefined variable: modx
<label for="snippetDescription">Snippet 1 Description:</label> <input type="text" name="snippetDescription" id="snippetDescription" width="300" value="The first test snippet." />
<?php
$success= false;
switch ($options[XPDO_TRANSPORT_PACKAGE_ACTION]) {
case XPDO_TRANSPORT_ACTION_INSTALL:
case XPDO_TRANSPORT_ACTION_UPGRADE:
$snippet = $object->xpdo->getObject('modSnippet',array('name' => 'TestSnippet1'));
if ($snippet != null) {
$snippet->set('description',$options['snippetDescription']);
$snippet->save();
} else {
$object->xpdo->log(XPDO_LOG_LEVEL_ERROR,'TestSnippet1 could not be found, so the description could not be changed.');
}
$success= true;
break;
case XPDO_TRANSPORT_ACTION_UNINSTALL:
$success= true;
break;
}
return $success;
resolver_type => 'php', resolver_source => $sources['build'] . "install-script.php", resolver_target => "return '" . $sources['build'] . "';"
What’s the function of the target setting for script resolvers? I couldn’t figure out what to set it to.
$vehicle->resolve('php',array(
'source' => $sources['resolvers'] . 'test.resolver.php',
));
).

I’d have to see the build script - sounds like a bug, but I don’t know what your build script looks like.
I’m not sure if this is a bug or a feature.

- Firebug shows a seemingly endless stream of activity -- about two executions per second -- from ext-base.js as long as the console is open.
That might be an event listener, but I don’t see it anywhere else in the Manager.
Quote from: BobRay at Nov 21, 2008, 12:51 AMI’d have to see the build script - sounds like a bug, but I don’t know what your build script looks like.
I’m not sure if this is a bug or a feature.
if (false) {
/* create categories */
/* This sets the snippets' categories using the $snippet array */
//$i++;
$attr = array(
XPDO_TRANSPORT_UNIQUE_KEY => 'category',
XPDO_TRANSPORT_PRESERVE_KEYS => false,
XPDO_TRANSPORT_UPDATE_OBJECT => true,
XPDO_TRANSPORT_RELATED_OBJECTS => true,
XPDO_TRANSPORT_RELATED_OBJECT_ATTRIBUTES => array (
'modSnippet' => array (
XPDO_TRANSPORT_PRESERVE_KEYS => false,
XPDO_TRANSPORT_UPDATE_OBJECT => true,
XPDO_TRANSPORT_UNIQUE_KEY => 'name',
)
)
);
$categoryObject= $modx->newObject('modCategory');
$categoryObject->set('category','spform-snippets');
//$categoryObject->set('id', $i);
$categoryObject->addMany($snippets,'modSnippet');
$vehicle = $builder->createVehicle($categoryObject,$attr);
$builder->putVehicle($vehicle);
/* Now we'll set the chunks' category using the $chunks array */
//$i++;
$attr = array(
XPDO_TRANSPORT_UNIQUE_KEY => 'category',
XPDO_TRANSPORT_PRESERVE_KEYS => false,
XPDO_TRANSPORT_UPDATE_OBJECT => true,
XPDO_TRANSPORT_RELATED_OBJECTS => true,
XPDO_TRANSPORT_RELATED_OBJECT_ATTRIBUTES => array (
'modChunk' => array (
XPDO_TRANSPORT_PRESERVE_KEYS => false,
XPDO_TRANSPORT_UPDATE_OBJECT => true,
XPDO_TRANSPORT_UNIQUE_KEY => 'name',
)
)
);
$categoryObject= $modx->newObject('modCategory');
$categoryObject->set('category','spform-chunks');
//$categoryObject->set('id', $i);
$categoryObject->addMany($chunks,'modChunk');
$vehicle = $builder->createVehicle($categoryObject,$attr);
$builder->putVehicle($vehicle);
/* done setting categories */