|
@@ -2,14 +2,12 @@
|
|
|
|
|
|
namespace Drupal\reinstall;
|
|
namespace Drupal\reinstall;
|
|
|
|
|
|
-use Drupal\Component\Utility\Unicode;
|
|
|
|
use Drupal\Core\Entity\ContentEntityStorageInterface;
|
|
use Drupal\Core\Entity\ContentEntityStorageInterface;
|
|
use Drupal\Core\Entity\ContentEntityTypeInterface;
|
|
use Drupal\Core\Entity\ContentEntityTypeInterface;
|
|
use Drupal\Core\Entity\EntityTypeBundleInfo;
|
|
use Drupal\Core\Entity\EntityTypeBundleInfo;
|
|
use Drupal\Core\Entity\EntityTypeManagerInterface;
|
|
use Drupal\Core\Entity\EntityTypeManagerInterface;
|
|
use Drupal\Core\Session\AccountSwitcherInterface;
|
|
use Drupal\Core\Session\AccountSwitcherInterface;
|
|
use Drupal\Core\Session\UserSession;
|
|
use Drupal\Core\Session\UserSession;
|
|
-use Drupal\file\Entity\File;
|
|
|
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
|
use Symfony\Component\Serializer\Serializer;
|
|
use Symfony\Component\Serializer\Serializer;
|
|
use Symfony\Component\Yaml\Yaml;
|
|
use Symfony\Component\Yaml\Yaml;
|
|
@@ -98,6 +96,8 @@ class Dumper {
|
|
* The value of the app.root "parameter service".
|
|
* The value of the app.root "parameter service".
|
|
* @param \Symfony\Component\Serializer\Serializer $serializer
|
|
* @param \Symfony\Component\Serializer\Serializer $serializer
|
|
* The serializer service.
|
|
* The serializer service.
|
|
|
|
+ * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher
|
|
|
|
+ * The event_dispatcher service.
|
|
* @param string $path
|
|
* @param string $path
|
|
* The import path.
|
|
* The import path.
|
|
*/
|
|
*/
|
|
@@ -228,9 +228,12 @@ class Dumper {
|
|
* Prepare the dump destination directory and return the file name within it.
|
|
* Prepare the dump destination directory and return the file name within it.
|
|
*
|
|
*
|
|
* @param string $entityTypeName
|
|
* @param string $entityTypeName
|
|
|
|
+ * The type of the entities to dump.
|
|
* @param string $bundleName
|
|
* @param string $bundleName
|
|
|
|
+ * The bundle of the entities to dump.
|
|
*
|
|
*
|
|
* @return string
|
|
* @return string
|
|
|
|
+ * The path of the dump file.
|
|
*/
|
|
*/
|
|
protected function prepareDestination(string $entityTypeName, string $bundleName): string {
|
|
protected function prepareDestination(string $entityTypeName, string $bundleName): string {
|
|
$importPath = $this->importPath;
|
|
$importPath = $this->importPath;
|
|
@@ -258,7 +261,6 @@ class Dumper {
|
|
if (!is_dir($real)) {
|
|
if (!is_dir($real)) {
|
|
drupal_set_message("Non-existent base dump directory: $completePath.", "error");
|
|
drupal_set_message("Non-existent base dump directory: $completePath.", "error");
|
|
throw new \InvalidArgumentException("Non-existent base dump directory: $completePath.");
|
|
throw new \InvalidArgumentException("Non-existent base dump directory: $completePath.");
|
|
- return;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
$this->importPath = $real;
|
|
$this->importPath = $real;
|
|
@@ -268,8 +270,10 @@ class Dumper {
|
|
* Like NormalizerInterface::normalize(), but for an array.
|
|
* Like NormalizerInterface::normalize(), but for an array.
|
|
*
|
|
*
|
|
* @param array $entities
|
|
* @param array $entities
|
|
|
|
+ * The entities to convert to arrays.
|
|
*
|
|
*
|
|
* @return mixed
|
|
* @return mixed
|
|
|
|
+ * The array representing the entities.
|
|
*/
|
|
*/
|
|
protected function toArray(array $entities): array {
|
|
protected function toArray(array $entities): array {
|
|
$json_options = [];
|
|
$json_options = [];
|
|
@@ -278,4 +282,5 @@ class Dumper {
|
|
|
|
|
|
return $hash;
|
|
return $hash;
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|