You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+35-19
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,8 @@ Fractor is a generic tool for changing all kinds of files via defined rules—si
10
10
11
11
The main package `a9f/fractor` provides infrastructure for configuring, running and extending Fractor,
12
12
but no rules for changing any files.
13
-
These are provided by individual packages specific for different file types (like `a9f/fractor-xml`)
14
-
or ecosystems (like `a9f/typo3-fractor`).
13
+
These are provided by individual packages specific for different file types
14
+
(like `a9f/fractor-composer-json`, `a9f/fractor-xml` or `a9f/fractor-yaml`) or ecosystems (like `a9f/typo3-fractor`).
15
15
16
16
For different file types, different operation modes are possible.
17
17
For XML, there is a full-blown tree traversal implemented in `a9f/fractor-xml`,
@@ -28,15 +28,29 @@ there is no advanced support available right now.
28
28
* Available rules for composer.json files are documented in [the fractor-composer-json package](./packages/fractor-composer-json/docs/composer-json-fractor-rules.md)
29
29
* Available rules for TYPO3 are documented in [the typo3-fractor package](./packages/typo3-fractor/docs/typo3-fractor-rules.md)
30
30
31
+
## Requirements
32
+
33
+
Fractor needs at least PHP 8.2.
34
+
If you want to migrate outdated systems, that don't support PHP 8.2, you can install Fractor, for example, in a Docker
35
+
container that is based on a PHP 8.2 image and then run it from there.
36
+
Alternatively, you can run Fractor within a CI Pipeline that is using PHP 8.2 and then commit the code changes within CI.
31
37
32
38
## Installation
33
39
34
-
Install Fractor via composer by running the following command in your terminal:
40
+
If you want to migrate common files, you can specify the file types you want to support.
41
+
Fractor core will be installed automatically and doesn't need to be required directly.
42
+
43
+
Install Fractor with the file types you need via composer by running the following command in your terminal:
35
44
36
45
```bash
37
-
# you can use any combination of packages here;
38
-
# as TYPO3 users, you probably want a9f/typo3-fractor foremost.
Execute Fractor from the command line, passing the path to your configuration file as an argument:
155
+
Before executing the code migrations, run the following command to see a preview of what Fractor will do:
142
156
143
157
```bash
144
-
vendor/bin/fractor process -f fractor.php
158
+
vendor/bin/fractor process --dry-run
145
159
```
146
160
147
-
Fractor will apply the rules specified in the configuration file to the targeted files.
161
+
Fractor will output all the potential changes on the console without real execution.
162
+
148
163
Review the changes made by Fractor to ensure they meet your expectations.
164
+
If you see some things that Fractor should not migrate for some reason, adjust your config file and exclude either rules,
165
+
some paths or single files.
149
166
150
-
You would also run fractor in dry mode:
167
+
When you feel confident, execute the code migrations with the following command:
151
168
152
169
```bash
153
-
vendor/bin/fractor process -f fractor.php --dry-run
170
+
vendor/bin/fractor process
154
171
```
155
172
156
-
Fractor will output all the potential changes on the console without real execution.
173
+
Fractor will now apply the rules specified in the configuration file to the targeted files.
157
174
158
175
## Customization
159
176
@@ -181,8 +198,6 @@ Here's how you can extend Fractor with a custom rule:
181
198
182
199
### Supporting New File Types
183
200
184
-
#### Supporting New File Types
185
-
186
201
- To support a new file type, you will need to implement an instance of `\a9f\Fractor\Fractor\FileProcessor`.
187
202
This processor must take care of decoding a file and then traversing the decoded file structure
188
203
(e.g., the DOM tree of an XML file; see `\a9f\FractorXml\XmlFileProcessor` for an example)
@@ -196,7 +211,8 @@ Here's how you can extend Fractor with a custom rule:
196
211
197
212
- Document your custom rules and file type extensions to aid other users in understanding and utilizing your contributions.
198
213
199
-
By extending Fractor in this manner, you can enhance its capabilities and adapt it to handle a wider range of file formats and transformation scenarios.
214
+
By extending Fractor in this manner, you can enhance its capabilities and adapt it to handle a wider range of file formats
215
+
and transformation scenarios.
200
216
201
217
## Contributing
202
218
@@ -210,7 +226,7 @@ we welcome contributions from the community. Here's how you can contribute:
210
226
211
227
## Support
212
228
213
-
For any questions or support regarding Fractor, please open an issue on GitHub. We'll do our best to assist you promptly.
229
+
For any questions or support regarding Fractor, please open an issue on GitHub. We'll do our best to help you promptly.
0 commit comments