|
@@ -1179,142 +1179,152 @@ function parsePackageInfo(&$packageXML, $testing_only = true, $method = 'install
|
|
|
'type' => 'error',
|
|
|
);
|
|
|
}
|
|
|
-
|
|
|
- $this_action = &$return[];
|
|
|
- $this_action = array(
|
|
|
- 'type' => $actionType,
|
|
|
- 'filename' => $action->fetch('@name'),
|
|
|
- 'description' => $action->fetch('.')
|
|
|
- );
|
|
|
-
|
|
|
-
|
|
|
- if (substr($actionType, 0, 6) != 'remove')
|
|
|
- {
|
|
|
- $this_action['unparsed_destination'] = $action->fetch('@destination');
|
|
|
- $this_action['destination'] = parse_path($action->fetch('@destination')) . '/' . basename($this_action['filename']);
|
|
|
- }
|
|
|
- else
|
|
|
+ elseif (in_array($actionType, array('require-file', 'remove-file', 'require-dir', 'remove-dir', 'move-file', 'move-dir', 'create-file', 'create-dir')))
|
|
|
{
|
|
|
- $this_action['unparsed_filename'] = $this_action['filename'];
|
|
|
- $this_action['filename'] = parse_path($this_action['filename']);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if (substr($actionType, 0, 4) == 'move' || substr($actionType, 0, 7) == 'require')
|
|
|
- {
|
|
|
- if ($action->exists('@from'))
|
|
|
- $this_action['source'] = parse_path($action->fetch('@from'));
|
|
|
- else
|
|
|
- $this_action['source'] = $temp_path . $this_action['filename'];
|
|
|
- }
|
|
|
+ $this_action = &$return[];
|
|
|
+ $this_action = array(
|
|
|
+ 'type' => $actionType,
|
|
|
+ 'filename' => $action->fetch('@name'),
|
|
|
+ 'description' => $action->fetch('.')
|
|
|
+ );
|
|
|
|
|
|
-
|
|
|
- if ($actionType == 'create-dir')
|
|
|
- {
|
|
|
- if (!mktree($this_action['destination'], false))
|
|
|
+
|
|
|
+ if (substr($actionType, 0, 6) != 'remove')
|
|
|
{
|
|
|
- $temp = $this_action['destination'];
|
|
|
- while (!file_exists($temp) && strlen($temp) > 1)
|
|
|
- $temp = dirname($temp);
|
|
|
-
|
|
|
- $return[] = array(
|
|
|
- 'type' => 'chmod',
|
|
|
- 'filename' => $temp
|
|
|
- );
|
|
|
+ $this_action['unparsed_destination'] = $action->fetch('@destination');
|
|
|
+ $this_action['destination'] = parse_path($action->fetch('@destination')) . '/' . basename($this_action['filename']);
|
|
|
}
|
|
|
- }
|
|
|
- elseif ($actionType == 'create-file')
|
|
|
- {
|
|
|
- if (!mktree(dirname($this_action['destination']), false))
|
|
|
+ else
|
|
|
{
|
|
|
- $temp = dirname($this_action['destination']);
|
|
|
- while (!file_exists($temp) && strlen($temp) > 1)
|
|
|
- $temp = dirname($temp);
|
|
|
+ $this_action['unparsed_filename'] = $this_action['filename'];
|
|
|
+ $this_action['filename'] = parse_path($this_action['filename']);
|
|
|
+ }
|
|
|
|
|
|
- $return[] = array(
|
|
|
- 'type' => 'chmod',
|
|
|
- 'filename' => $temp
|
|
|
- );
|
|
|
+
|
|
|
+ if (substr($actionType, 0, 4) == 'move' || substr($actionType, 0, 7) == 'require')
|
|
|
+ {
|
|
|
+ if ($action->exists('@from'))
|
|
|
+ $this_action['source'] = parse_path($action->fetch('@from'));
|
|
|
+ else
|
|
|
+ $this_action['source'] = $temp_path . $this_action['filename'];
|
|
|
}
|
|
|
|
|
|
- if (!is_writable($this_action['destination']) && (file_exists($this_action['destination']) || !is_writable(dirname($this_action['destination']))))
|
|
|
- $return[] = array(
|
|
|
- 'type' => 'chmod',
|
|
|
- 'filename' => $this_action['destination']
|
|
|
- );
|
|
|
- }
|
|
|
- elseif ($actionType == 'require-dir')
|
|
|
- {
|
|
|
- if (!mktree($this_action['destination'], false))
|
|
|
+
|
|
|
+ if ($actionType == 'create-dir')
|
|
|
{
|
|
|
- $temp = $this_action['destination'];
|
|
|
- while (!file_exists($temp) && strlen($temp) > 1)
|
|
|
- $temp = dirname($temp);
|
|
|
+ if (!mktree($this_action['destination'], false))
|
|
|
+ {
|
|
|
+ $temp = $this_action['destination'];
|
|
|
+ while (!file_exists($temp) && strlen($temp) > 1)
|
|
|
+ $temp = dirname($temp);
|
|
|
|
|
|
- $return[] = array(
|
|
|
- 'type' => 'chmod',
|
|
|
- 'filename' => $temp
|
|
|
- );
|
|
|
+ $return[] = array(
|
|
|
+ 'type' => 'chmod',
|
|
|
+ 'filename' => $temp
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- elseif ($actionType == 'require-file')
|
|
|
- {
|
|
|
- if ($action->exists('@theme'))
|
|
|
- $this_action['theme_action'] = $action->fetch('@theme');
|
|
|
-
|
|
|
- if (!mktree(dirname($this_action['destination']), false))
|
|
|
+ elseif ($actionType == 'create-file')
|
|
|
{
|
|
|
- $temp = dirname($this_action['destination']);
|
|
|
- while (!file_exists($temp) && strlen($temp) > 1)
|
|
|
- $temp = dirname($temp);
|
|
|
+ if (!mktree(dirname($this_action['destination']), false))
|
|
|
+ {
|
|
|
+ $temp = dirname($this_action['destination']);
|
|
|
+ while (!file_exists($temp) && strlen($temp) > 1)
|
|
|
+ $temp = dirname($temp);
|
|
|
|
|
|
- $return[] = array(
|
|
|
- 'type' => 'chmod',
|
|
|
- 'filename' => $temp
|
|
|
- );
|
|
|
+ $return[] = array(
|
|
|
+ 'type' => 'chmod',
|
|
|
+ 'filename' => $temp
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!is_writable($this_action['destination']) && (file_exists($this_action['destination']) || !is_writable(dirname($this_action['destination']))))
|
|
|
+ $return[] = array(
|
|
|
+ 'type' => 'chmod',
|
|
|
+ 'filename' => $this_action['destination']
|
|
|
+ );
|
|
|
}
|
|
|
+ elseif ($actionType == 'require-dir')
|
|
|
+ {
|
|
|
+ if (!mktree($this_action['destination'], false))
|
|
|
+ {
|
|
|
+ $temp = $this_action['destination'];
|
|
|
+ while (!file_exists($temp) && strlen($temp) > 1)
|
|
|
+ $temp = dirname($temp);
|
|
|
|
|
|
- if (!is_writable($this_action['destination']) && (file_exists($this_action['destination']) || !is_writable(dirname($this_action['destination']))))
|
|
|
- $return[] = array(
|
|
|
- 'type' => 'chmod',
|
|
|
- 'filename' => $this_action['destination']
|
|
|
- );
|
|
|
- }
|
|
|
- elseif ($actionType == 'move-dir' || $actionType == 'move-file')
|
|
|
- {
|
|
|
- if (!mktree(dirname($this_action['destination']), false))
|
|
|
+ $return[] = array(
|
|
|
+ 'type' => 'chmod',
|
|
|
+ 'filename' => $temp
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ elseif ($actionType == 'require-file')
|
|
|
{
|
|
|
- $temp = dirname($this_action['destination']);
|
|
|
- while (!file_exists($temp) && strlen($temp) > 1)
|
|
|
- $temp = dirname($temp);
|
|
|
+ if ($action->exists('@theme'))
|
|
|
+ $this_action['theme_action'] = $action->fetch('@theme');
|
|
|
|
|
|
- $return[] = array(
|
|
|
- 'type' => 'chmod',
|
|
|
- 'filename' => $temp
|
|
|
- );
|
|
|
+ if (!mktree(dirname($this_action['destination']), false))
|
|
|
+ {
|
|
|
+ $temp = dirname($this_action['destination']);
|
|
|
+ while (!file_exists($temp) && strlen($temp) > 1)
|
|
|
+ $temp = dirname($temp);
|
|
|
+
|
|
|
+ $return[] = array(
|
|
|
+ 'type' => 'chmod',
|
|
|
+ 'filename' => $temp
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!is_writable($this_action['destination']) && (file_exists($this_action['destination']) || !is_writable(dirname($this_action['destination']))))
|
|
|
+ $return[] = array(
|
|
|
+ 'type' => 'chmod',
|
|
|
+ 'filename' => $this_action['destination']
|
|
|
+ );
|
|
|
}
|
|
|
+ elseif ($actionType == 'move-dir' || $actionType == 'move-file')
|
|
|
+ {
|
|
|
+ if (!mktree(dirname($this_action['destination']), false))
|
|
|
+ {
|
|
|
+ $temp = dirname($this_action['destination']);
|
|
|
+ while (!file_exists($temp) && strlen($temp) > 1)
|
|
|
+ $temp = dirname($temp);
|
|
|
|
|
|
- if (!is_writable($this_action['destination']) && (file_exists($this_action['destination']) || !is_writable(dirname($this_action['destination']))))
|
|
|
- $return[] = array(
|
|
|
- 'type' => 'chmod',
|
|
|
- 'filename' => $this_action['destination']
|
|
|
- );
|
|
|
- }
|
|
|
- elseif ($actionType == 'remove-dir')
|
|
|
- {
|
|
|
- if (!is_writable($this_action['filename']) && file_exists($this_action['filename']))
|
|
|
- $return[] = array(
|
|
|
- 'type' => 'chmod',
|
|
|
- 'filename' => $this_action['filename']
|
|
|
- );
|
|
|
+ $return[] = array(
|
|
|
+ 'type' => 'chmod',
|
|
|
+ 'filename' => $temp
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!is_writable($this_action['destination']) && (file_exists($this_action['destination']) || !is_writable(dirname($this_action['destination']))))
|
|
|
+ $return[] = array(
|
|
|
+ 'type' => 'chmod',
|
|
|
+ 'filename' => $this_action['destination']
|
|
|
+ );
|
|
|
+ }
|
|
|
+ elseif ($actionType == 'remove-dir')
|
|
|
+ {
|
|
|
+ if (!is_writable($this_action['filename']) && file_exists($this_action['filename']))
|
|
|
+ $return[] = array(
|
|
|
+ 'type' => 'chmod',
|
|
|
+ 'filename' => $this_action['filename']
|
|
|
+ );
|
|
|
+ }
|
|
|
+ elseif ($actionType == 'remove-file')
|
|
|
+ {
|
|
|
+ if (!is_writable($this_action['filename']) && file_exists($this_action['filename']))
|
|
|
+ $return[] = array(
|
|
|
+ 'type' => 'chmod',
|
|
|
+ 'filename' => $this_action['filename']
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
- elseif ($actionType == 'remove-file')
|
|
|
+ else
|
|
|
{
|
|
|
- if (!is_writable($this_action['filename']) && file_exists($this_action['filename']))
|
|
|
- $return[] = array(
|
|
|
- 'type' => 'chmod',
|
|
|
- 'filename' => $this_action['filename']
|
|
|
- );
|
|
|
+ $return[] = array(
|
|
|
+ 'type' => 'error',
|
|
|
+ 'error_msg' => 'unknown_action',
|
|
|
+ 'error_var' => $actionType
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
|