Skip to content

Commit 3e8cc33

Browse files
feature: aligned output path and updated readme
1 parent 334864d commit 3e8cc33

File tree

2 files changed

+24
-46
lines changed

2 files changed

+24
-46
lines changed

ERDiagramXMLExportBundle/DependencyInjection/GraphMLWriter.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -180,18 +180,18 @@ private function createAttributes($entry): string
180180

181181
$rootElement = [
182182
'rootElementName' => 'y:NodeLabel',
183-
'_attributes' => [
184-
'alignement' => 'left',
185-
'autoSizePolicy' => 'content',
183+
'_attributes' => [
184+
'alignement' => 'left',
185+
'autoSizePolicy' => 'content',
186186
'horizontalTextPosition' => 'center',
187-
'verticalTextPosition' => 'top',
188-
'visible' => 'true',
189-
'clipContent' => 'true',
190-
'hasDetailsColor' => 'false',
191-
'omitDetails' => 'false',
192-
'modelName' => 'internal',
193-
'modelPosition' => 'c',
194-
'configuration' => 'com.yworks.entityRelationship.label.attributes',
187+
'verticalTextPosition' => 'top',
188+
'visible' => 'true',
189+
'clipContent' => 'true',
190+
'hasDetailsColor' => 'false',
191+
'omitDetails' => 'false',
192+
'modelName' => 'internal',
193+
'modelPosition' => 'c',
194+
'configuration' => 'com.yworks.entityRelationship.label.attributes',
195195
],
196196

197197
];
@@ -263,12 +263,15 @@ private function createEdge($source, $target, $relationType = '', $labelName)
263263

264264
private function writeToFile()
265265
{
266-
$dirname = dirname(__DIR__, 5) . '/var/tmp/';
266+
$dirname = dirname(__DIR__, 5) . '/var/bundles/ERDiagramXMLExportBundle';
267+
if (!is_dir($dirname)) {
268+
\Pimcore\File::mkdir($dirname);
269+
}
267270

268271
if (empty($this->filename)) {
269-
$file = $dirname . 'output.graphml';
272+
$file = $dirname . '/pimcore.graphml';
270273
} else {
271-
$file = $dirname . $this->filename . '.graphml';
274+
$file = $dirname . '/' . $this->filename . '.graphml';
272275
}
273276

274277
file_put_contents($file, $this->xmlOutput);
@@ -283,4 +286,4 @@ private function createFooter()
283286
</data>
284287
</graphml>";
285288
}
286-
}
289+
}

README.md

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,15 @@ Just open the generated file with the yEd Graph Editor, which you can find here:
88
`https://www.yworks.com/products/yed/download`.
99
After opening the file you should use the `Layout` Tab in the Graph Editor to arrange the rendered Graphics according your needs.
1010

11-
### Usage
11+
### Installation
1212
```
13-
bin/console basilicom::create-er-diagram-xml-export
14-
bin/console basilicom::create-er-diagram-xml-export <filename>
13+
composer require basilicom/er-diagram-xml-export-bundle
1514
```
1615

17-
The generated file will be saved in the `\var\tmp\` Folder with filename`output.graphml` .
18-
You can also provide your own filename.
19-
#### Pimcore Configuration
20-
Make sure to enable the Bundle in `app/config/bundles.php`, e.g.
21-
22-
```
23-
return [
24-
Basilicom\ERDiagramXMLExportBundle\ERDiagramXMLExportBundle::class => ['all' => true],
25-
];
16+
### Usage
2617
```
27-
28-
and add it to BundleCollection in `AppKernel.php`, e.g.
29-
18+
bin/console basilicom::create-er-diagram-xml-export
19+
bin/console basilicom::create-er-diagram-xml-export <filename>
3020
```
31-
...
32-
use Basilicom\ERDiagramXMLExportBundle\ERDiagramXMLExportBundle;
33-
...
3421

35-
class AppKernel extends Kernel
36-
{
37-
/**
38-
* @param BundleCollection $collection
39-
*/
40-
public function registerBundlesToCollection(BundleCollection $collection)
41-
{
42-
if (class_exists(ERDiagramXMLExportBundle::class)) {
43-
$collection->addBundle(new ERDiagramXMLExportBundle());
44-
}
45-
}
46-
}
47-
```
22+
The generated file will be saved in the `var/bundles/ERDiagramXMLExportBundle` folder with filename `pimcore.graphml` or the given `<filename>.graphml`.

0 commit comments

Comments
 (0)