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
In modern `content.xml` packages, assets usually live under paths such as `content/resources/...`.
110
+
Older projects and some transitional exports may still reference legacy layouts such as `files/tmp/...`.
111
+
The parser exposes this through `getResourceLayout()`.
99
112
100
-
// JSON serialization
101
-
$jsonData = json_encode($parser);
113
+
### Export JSON
102
114
103
-
// Export directly to a JSON file
104
-
$parser->exportJson('path/to/output.json');
115
+
```php
116
+
$json = $parser->exportJson();
117
+
$parser->exportJson('/path/to/output.json');
118
+
```
105
119
106
-
// Retrieve full metadata as array
107
-
$meta = $parser->getMetadata();
120
+
### Extract Project Files
121
+
122
+
```php
123
+
$parser->extract('/path/to/destination');
108
124
```
109
125
110
-
## Error Handling
126
+
## Version Compatibility
127
+
128
+
The parser distinguishes between project format and eXeLearning version:
111
129
112
-
The parser includes robust error handling:
113
-
- Detects invalid .elp files
114
-
- Throws exceptions for parsing errors
115
-
- Supports both version 2 and 3 file formats
130
+
-`getContentFormat()` tells you whether the package uses legacy `contentv3.xml` or modern `content.xml`
131
+
-`getVersion()` reports the detected eXeLearning major version
132
+
- In practice this means:
133
+
- eXeLearning 2.x legacy `.elp` => version `2`
134
+
- modern ODE-based `.elp` => usually version `3`
135
+
-`.elpx` packages with root `content.dtd` are treated as likely v4-style packages and currently report version `4`
136
+
- otherwise modern ODE-based packages default to version `3`
116
137
117
-
## Performance
138
+
This distinction matters because some projects created with newer eXeLearning builds still identify themselves internally with `exe_version=3.0`, so strict `v4` detection is not always possible from the package alone.
139
+
For that reason, the library combines explicit metadata with format heuristics:
118
140
119
-
- Lightweight implementation
120
-
- Minimal memory footprint
121
-
- Fast XML parsing using native PHP extensions
141
+
-`.elpx`
142
+
-`content.xml`
143
+
- root `content.dtd`
144
+
- optionally `content/resources/...` as the modern resource layout
145
+
146
+
## Error Handling
122
147
123
-
## Contributing
148
+
The parser throws exceptions for:
124
149
125
-
Contributions are welcome! Please submit pull requests or open issues on our GitHub repository.
0 commit comments