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
> PHP part of this project lives in `EightshiftLibs` namespace.
8
+
> The PHP codebase of this project lives in `EightshiftLibs` namespace.
9
9
10
-
Because WordPress lives in a global namespace, we had to provide the way for your project to be unique. That is why we implemented [**Imposter**](https://github.com/infinum/imposter-plugin)script inside `composer.json`. Imposter adds a namespace prefix on all the packages inside the `vendor` folder that uses namespacing.
10
+
Because WordPress lives in a global namespace, we had to provide the way for your project to be unique. That is why we implemented [**Imposter**](https://github.com/infinum/imposter-plugin)in `composer.json`. Imposter adds a namespace prefix to all the packages inside the `vendor` folder that use namespacing.
11
11
12
-
You can change the vendor prefix in your `composer.json` file. But if you do this, make sure you delete the `vendor` folder before running the command to install the composer packages again with the `composer install` command.
12
+
You can change the vendor prefix in your `composer.json` file. If you do this, make sure you delete the `vendor` folder and re-run `composer install`.
13
13
14
+
Using the default setup, your project will have the namespace you defined in the setup process.
14
15
16
+
However, let's say you change your `composer.json` file to contain this snippet:
15
17
```json
16
18
"autoload": {
17
19
"psr-4": {
@@ -25,14 +27,16 @@ You can change the vendor prefix in your `composer.json` file. But if you do thi
25
27
}
26
28
```
27
29
28
-
For example, with the default setup, your project will have the namespace you defined in the setup process. But let's say you have the structure from the previous example:
29
-
30
30
- Your current namespace is: `CustomProject`.
31
-
- Namespace for all packages used from Eightshift libs is`EightshiftBoilerplateVendor\CustomProject`.
32
-
-Also, every package you additionally install will follow the same convention: `EightshiftBoilerplateVendor\SomePackageNamespace`.
31
+
- Namespace for Eightshift Libs becomes:`EightshiftBoilerplateVendor\EightshiftLibs`.
32
+
-Every package you additionally install will follow the same convention: `EightshiftBoilerplateVendor\SomePackageNamespace`.
33
33
34
-
**To sum it up**: you don't need to change the default vendor prefix if you only run one theme or one plugin with Eightshift Boilerplate. But if you have multiple Eightshift Boilerplate powered themes or plugins installed, please change the vendor prefix on each of the projects.
34
+
**To sum it up**: you don't need to change the default vendor prefix if you only run one theme or one plugin with Eightshift Development Kit. If you have multiple Eightshift Development Kit-powered themes or plugins installed, please change the vendor prefix on each of the projects.
35
35
36
36
### Important note
37
37
38
-
If you are installing additional composer packages make sure that they don't have any inline namespace usage. All `use` keys must be defined in the top of the files. Imposter plugin is not able to resolve this and it will throw and fatal error. To fix this ether create a PR on the package and fix this for everyone, or you can exclude this package from imposter script. Keep in mind that can have some unexpected side effects that we can't predict.
38
+
If you are installing additional composer packages, make sure that they don't have any inline namespace usage. All referenced classes should be imported with `use` statements, which must be defined at the top of files.
39
+
40
+
The Imposter plugin is not able to replace inline namespaces, which will cause issues with classname resolution and result in a fatal error getting thrown.
41
+
42
+
To fix these issues, either create a PR on the package and fix this for everyone, or exclude this package from imposter script. Keep in mind that can have some unexpected side effects that we can't predict.
0 commit comments