Пример #1
0
 function runOperation(&$node)
 {
     if ($this->copysubtree) {
         // Using command line script ezsubtreecopy.php to copy subtrees
         $php = $_SERVER['_'];
         $siteaccess = $GLOBALS['eZCurrentAccess']['name'];
         $source = '--src-node-id=' . $node->attribute('node_id');
         $destination = ' --dst-node-id=' . $this->target_id;
         $command = "{$php} bin/php/ezsubtreecopy.php -s {$siteaccess} {$source} {$destination} --all-versions --keep-creator --keep-time";
         exec($command, $output, $return_var);
         return $return_var == 0;
     } else {
         return copyObject($node->attribute('object'), false, $this->target_id);
     }
 }
Пример #2
0
// 批量删除object
$result = $ossClient->deleteObjects($bucket, array("b.file", "c.file"));
foreach ($result as $object) {
    Common::println($object);
}
sleep(2);
unlink("c.file.localcopy");
//******************************* 完整用法参考下面函数 ****************************************************
listObjects($ossClient, $bucket);
listAllObjects($ossClient, $bucket);
createObjectDir($ossClient, $bucket);
putObject($ossClient, $bucket);
uploadFile($ossClient, $bucket);
getObject($ossClient, $bucket);
getObjectToLocalFile($ossClient, $bucket);
copyObject($ossClient, $bucket);
modifyMetaForObject($ossClient, $bucket);
getObjectMeta($ossClient, $bucket);
deleteObject($ossClient, $bucket);
deleteObjects($ossClient, $bucket);
doesObjectExist($ossClient, $bucket);
/**
 * 创建虚拟目录
 *
 * @param OssClient $ossClient OssClient实例
 * @param string $bucket 存储空间名称
 * @return null
 */
function createObjectDir($ossClient, $bucket)
{
    try {
Пример #3
0
$chooseVersions = $versionHandling == 'user-defined';
if ($chooseVersions) {
    $allVersions = $Module->actionParameter('VersionChoice') == 1 ? true : false;
} else {
    $allVersions = $versionHandling == 'last-published' ? false : true;
}
if ($Module->isCurrentAction('Copy')) {
    // actually do copying after a user has selected object versions to copy
    $newParentNodeID = $http->postVariable('SelectedNodeID');
    return copyObject($Module, $object, $allVersions, $newParentNodeID);
} else {
    if ($Module->isCurrentAction('CopyNode')) {
        // we get here after a user selects target node to place the source object under
        if ($chooseVersions) {
            // redirect to the page with choice of versions to copy
            $Result = array();
            chooseObjectVersionsToCopy($Module, $Result, $object);
        } else {
            // actually do copying of the pre-configured object version(s)
            $selectedNodeIDArray = eZContentBrowse::result($Module->currentAction());
            $newParentNodeID = $selectedNodeIDArray[0];
            return copyObject($Module, $object, $allVersions, $newParentNodeID);
        }
    } else {
        /*
        Browse for target node.
        We get here when a user clicks "copy" button when viewing some node.
        */
        browse($Module, $object);
    }
}
Пример #4
0
 function runOperation(&$object)
 {
     return copyObject($object->attribute('object'), false, $this->target_id);
 }