setName('files:object:put')
->setDescription('Write a file to the object store')
->addArgument('input', InputArgument::REQUIRED, 'Source local path, use - to read from STDIN')
->addArgument('object', InputArgument::REQUIRED, 'Object to write')
->addOption('bucket', 'b', InputOption::VALUE_REQUIRED, "Bucket where to store the object, only required in cases where it can't be determined from the config");
;
}
public function execute(InputInterface $input, OutputInterface $output): int {
$object = $input->getArgument('object');
$inputName = (string)$input->getArgument('input');
$objectStore = $this->objectUtils->getObjectStore($input->getOption('bucket'), $output);
if (!$objectStore) {
return -1;
}
if ($fileId = $this->objectUtils->objectExistsInDb($object)) {
$output->writeln("Warning, object $object belongs to an existing file, overwriting the object contents can lead to unexpected behavior.");
$output->writeln("You can use occ files:put $inputName $fileId to write to the file safely.");
$output->writeln('');
/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$question = new ConfirmationQuestion('Write to the object anyway? [y/N] ', false);
if (!$helper->ask($input, $output, $question)) {
return -1;
}
}
$source = $inputName === '-' ? STDIN : fopen($inputName, 'r');
if (!$source) {
$output->writeln("Failed to open $inputName");
return self::FAILURE;
}
$objectStore->writeObject($object, $source, $this->mimeTypeDetector->detectPath($inputName));
return self::SUCCESS;
}
}
ions
The official jQuery user interface library: https://github.com/jquery/jquery-ui
<!doctype html><htmllang="en"><head><metacharset="utf-8"><title>jQuery UI Droppable - Revert draggable position</title><linkrel="stylesheet"href="../../themes/base/jquery.ui.all.css"><scriptsrc="../../jquery-1.8.3.js"></script><scriptsrc="../../ui/jquery.ui.core.js"></script><scriptsrc="../../ui/jquery.ui.widget.js"></script><scriptsrc="../../ui/jquery.ui.mouse.js"></script><scriptsrc="../../ui/jquery.ui.draggable.js"></script><scriptsrc="../../ui/jquery.ui.droppable.js"></script><linkrel="stylesheet"href="../demos.css"><style>#draggable,#draggable2{width:100px;height:100px;padding:0.5em;float:left;margin:10px10px10px0;}#droppable{width:150px;height:150px;padding:0.5em;float:left;margin:10px;}</style><script>$(function(){$("#draggable").draggable({revert:"valid"});$("#draggable2").draggable({revert:"invalid"});$("#droppable").droppable({activeClass:"ui-state-hover",hoverClass:"ui-state-active",drop:function(event,ui){$(this).addClass("ui-state-highlight").find("p").html("Dropped!");}});});</script></head><body><divid="draggable"class="ui-widget-content"><p>I revert when I'm dropped</p></div><divid="draggable2"class="ui-widget-content"><p>I revert when I'm not dropped</p></div><divid="droppable"class="ui-widget-header"><p>Drop me here</p></div><divclass="demo-description"><p>Return the draggable (or it's helper) to its original location when dragging stops with the boolean <code>revert</code> option set on the draggable.</p></div></body></html>