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
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
WP Starter
2
2
==========
3
3
4
-
> WordPress whole-site Composer packages has never been so easy.
4
+
> WordPress whole-site Composer packages have never been so easy.
5
5
6
6
WP Starter is the easiest and fastest way to bootstrap WordPress sites entirely based on
7
7
[Composer](https://getcomposer.org/).
@@ -15,7 +15,7 @@ WP Starter is the easiest and fastest way to bootstrap WordPress sites entirely
15
15
16
16
# License
17
17
18
-
MIT. See LICENSE file.
18
+
MIT. See [LICENSE](LICENSE) file.
19
19
20
20
# Dependencies
21
21
@@ -41,6 +41,6 @@ file an issue as they are public.
41
41
42
42
WP Starter is hosted on GitHub. Feel free to open issues there for suggestions, questions and real issues.
43
43
44
-
# Who's Behind
44
+
# Who's Behind This?
45
45
46
46
I'm Giuseppe, I deal with PHP since 2005. For questions, rants or chat ping me on Twitter ([@gmazzap](https://twitter.com/gmazzap)) or on ["The Loop"](http://chat.stackexchange.com/rooms/6/the-loop) (Stack Exchange) chat. Well, it's possible I'll ignore rants.
Copy file name to clipboardExpand all lines: docs/complete-example.md
+37-38Lines changed: 37 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,10 @@ title: Complete Usage Example
4
4
-->
5
5
# Complete Usage Example
6
6
7
-
Sometimes out-of-the-box settings for WP Starter may be fine, sometimes not. In this page there's an usage example that will make use of
8
-
all WP Starter configuration. Explanation is provided below in this page.
7
+
For some projects, out-of-the-box settings for WP Starter may be just fine, others might need more customization. This page contains a usage example that makes use of
8
+
all of WP Starter configuration. Explanations are provided further down below after the example.
9
9
10
-
# A *fully-equipped*`composer.json`
10
+
# A *fullyequipped*`composer.json`
11
11
12
12
```json
13
13
{
@@ -95,58 +95,57 @@ all WP Starter configuration. Explanation is provided below in this page.
95
95
96
96
## Example Explained
97
97
98
-
The example above may be a little scary, but reality is that great majority of WP Starter installations don't need a so much detailed configuration. E.g. the `composer.json` provided in the *"Quick Start"* docs section is a lot less complex and still perfectly functional.
98
+
The example above might seem a little scary, but most of the time you won't need such a detailed configuration. E.g. the `composer.json` provided in the *"Quick Start"* docs section is a lot less complex and still perfectly functional.
99
99
100
-
Only reason to publish a so hardly customized `composer.json` is to show how WP Starter configuration allows a full control on any aspect of its work, but only if required.
100
+
The only reason I publish such a heavily customized `composer.json` is to demonstrate how WP Starter configuration allows you to exert full control over every aspect of its process, in case this should be required.
101
101
102
-
All the configurations used in the example above are explained below, section by section.
102
+
All of the configurations used in the example above are explained below, section by section.
103
103
104
-
### `"name"`, `"description"` and `"type"`sections
104
+
### `"name"`, `"description"` and `"type"` sections
105
105
106
-
This are simple Composer settings. See [official docs](https://getcomposer.org/doc/04-schema.md) to know more.
106
+
These are simple Composer settings. See [official docs](https://getcomposer.org/doc/04-schema.md) to know more.
107
107
108
108
### `"minimum-stability"` section
109
109
110
-
By default Composer filters packages by stability, only installing one that are tagged as stable.
110
+
By default, Composer filters packages by stability, only installing versions that are tagged as stable.
111
111
112
-
By using this setting ([see Compose docs](https://getcomposer.org/doc/04-schema.md#minimum-stability)) is possible to tell Composer to also install packages with different stability.
113
-
114
-
This is necessary in the example because some packages used are not stable and are added to project pulling them from Git repositories.
112
+
By using this setting ([see Compose docs](https://getcomposer.org/doc/04-schema.md#minimum-stability)), it is possible to tell Composer to also install packages with different stability flags.
115
113
114
+
This is necessary in the example because some packages that are used are not stable and are added to project by pulling them from Git repositories.
116
115
117
116
### `"repositories"` section
118
117
119
-
This is [a Composer setting](https://getcomposer.org/doc/04-schema.md#repositories) that allows to set custom repositories where to search for packages.
118
+
This is [a Composer setting](https://getcomposer.org/doc/04-schema.md#repositories) that allows to add custom repositories that will be searched for packages by Composer.
120
119
121
120
I've added 3 entries.
122
121
123
-
The first is [wpackagist](https://wpackagist.org). It is a mirror of the official WordPress plugin and theme directories as a Composer repository. In short, it allows to install all the plugins and themes available in official WordPress repository as Composer packages, no matter if they *natively* support Composer or not.
122
+
The first is [wpackagist](https://wpackagist.org). It is a mirror of the official wordpress.org plugin and theme repository as a Composer repository. In short, it allows you to install all the plugins and themes available in the official wordpress.org repository as Composer packages, no matter if they *natively* support Composer or not.
124
123
125
-
The other two repositories are Gist of mine. They were created to show in this example how to use custom packages to collect files that you want to share among WP Starter projects. More on this below.
124
+
The other two repositories are Gists of mine. They were created for this example to demonstrate how to use custom packages to collect files that you want to share among WP Starter projects. More on this below.
126
125
127
126
### `"require"` section
128
127
129
-
There are 3 packages required, and first of them is WP Starter. It is required, of course.
128
+
There are 3 required packages, and the first one is WP Starter. It is required, of course.
130
129
131
-
The second is WordPress package. Even if WP Starter requires WordPress, but it is explicitly required to have a better control on the WordPress version that will be installed.
130
+
The second is the WordPress package. Even if WP Starter requires WordPress, it is still explicitly required to have a better control over the WordPress version that will be installed.
132
131
133
-
The third package required is `"gmazzap/wpstarter-example-files"`. It is a package I created for this example to show how to use a custom package (in this case saved in a Gist) to collect files to be shared among WP Starter projects. Files contained in this package will be used in the example for various purposes.
132
+
The third required package is `"gmazzap/wpstarter-example-files"`. It is a package I created for this example to show how to use a custom package (in this case saved as a Gist) to collect files to be shared among WP Starter projects. Files contained in this package will be used in the example for various purposes.
134
133
135
134
### `"require-dev"` section
136
135
137
136
There are five packages required for development purposes.
138
137
139
-
First two, "query-monitor" and "debug-bar", are popular plugins for debugging. They are both available in WordPress repository and required via wpackagist.
138
+
The first two, "query-monitor" and "debug-bar", are popular plugins for debugging. They are both available in the wordpress.org repository and required via wpackagist.
140
139
141
-
Third package is ["Laps"](https://github.com/Rarst/laps), a profiler plugin by [@Rarst](http://t.co/dTX2awK3Qv) (Andrey Savchenko) that supports Composer natively and is available on Packagist.
140
+
The third package is ["Laps"](https://github.com/Rarst/laps), a profiler plugin by [@Rarst](http://t.co/dTX2awK3Qv) (Andrey Savchenko) that supports Composer natively and is available on Packagist.
142
141
143
-
The fourth package is ["plugin-profiler"](https://wordpress.org/plugins/plugin-profiler/), a profiler for plugins, it is available in WordPress repository and required via wpackagist.
142
+
The fourth package is ["plugin-profiler"](https://wordpress.org/plugins/plugin-profiler/), a profiler for plugins, it is available in wordpress.org repository and required via wpackagist.
144
143
145
144
By reading its [installation instructions](https://wordpress.org/plugins/plugin-profiler/installation/) you'll see that one of the installation options is to create a MU plugin that loads the regular plugin file.
146
145
147
-
For the purpose of this example I created a very simple MU plugin that just does that, and that is the fifth package required. It is located in [a Gist](https://gist.github.com/Giuseppe-Mazzapica/9939793dfb2a2361cd0f) listed in `"repositories"` to be accessible to Composer.
146
+
For the purpose of this example I created a very simple MU plugin that just does that, and that is the fifth required package. It is located in [a Gist](https://gist.github.com/Giuseppe-Mazzapica/9939793dfb2a2361cd0f) listed in `"repositories"` to be accessible to Composer.
148
147
149
-
This MU plugin will be placed in its own folder inside `mu-plugin` folder, but WordPress will be still capable to load thanks to WP Starter loader.
148
+
This MU plugin will be placed in its own folder inside `mu-plugin` folder, but WordPress will still be capable to load it thanks to WP Starter MU loader code.
150
149
151
150
### `"config"` section
152
151
@@ -158,42 +157,42 @@ In the example above it is used to tell Composer to create optimized autoloader
158
157
159
158
The first entry in this section adds the method `WCM\WPStarter\Setup::run()` as `"post-install-cmd"` script. (See [Composer docs](https://getcomposer.org/doc/articles/scripts.md)). This is the only mandatory entry.
160
159
161
-
The second entry adds the same method as `"post-update-cmd"` script. This makes Composer to run again WP Starter routine after any update. The reason is that files copied by WP Starter via "dropins" configuration (see below) may be updated, so the updated file should be copied again in content folder.
160
+
The second entry adds the same method as `"post-update-cmd"` script. This makes Composer run WP Starter routine again after any update. The reason is that files copied by WP Starter via "dropins" configuration (see below) may be updated, so the updated file should be copied into the content folder again.
162
161
163
-
The third entry, adds the same method using a custom name. This will never run automatically by Composer, but if there is the need to run WP Starter routine manually, this alias will simplify that task: `composer run wpstarter` is easier to type, to remember and more intuitive of`composer run post-install-cmd`.
162
+
The third entry adds the same method using a custom name. This will never run automatically by Composer, but if there is the need to run WP Starter routine manually, this alias will simplify that task: `composer run wpstarter` is easier to type, to remember and more intuitive than`composer run post-install-cmd`.
164
163
165
164
### `"extra"` section
166
165
167
-
`"wordpress-install-dir"` tells Composer where to place WordPress package. This is not a WP Starter configuration, but is defined by [WordPress core installer](https://github.com/johnpbloch/wordpress-core-installer). This setting is optional and when not used, "wordpress" is used as default.
166
+
`"wordpress-install-dir"` tells Composer where to place the WordPress package. This is not a WP Starter configuration, but is defined by [WordPress core installer](https://github.com/johnpbloch/wordpress-core-installer). This setting is optional and when not used, "wordpress" is used as default.
168
167
169
168
`"wordpress-content-dir"` informs WP Starter where the content folder is located. This configuration is optional and when not used, "wp-content" is used as default.
170
169
171
-
Please note that this option will **not** make Composer to place plugins and themes into the given directory.
170
+
Please note that this option will **not** make Composer place plugins and themes into the given directory.
172
171
173
-
This option is required only if the content folder is not the standard one and only if WP Starter needs to know where content folder is located, that is, when the `"dropins"` and/or the `"gitignore"` WP Starter configuration are used.
172
+
This option is required only if the content folder is not the standard one and only if WP Starter needs to know where the content folder is located, that is, when the `"dropins"` and/or the `"gitignore"` WP Starter configurations are used.
174
173
175
-
`"wpstarter"` is the object where take place all the WP Starter configurations. All the available settings are documented in the *"WP Starter Options"* documentation page.
174
+
`"wpstarter"` is the object in which all the WP Starter configuration takes place. All the available settings are documented in the *"WP Starter Options"* documentation page.
176
175
177
176
In the example above I used:
178
177
179
-
-`"dropins"` to tell WP Starter to move two files from their package folder (where Composer placed them) to the project content folder. This is required because WordPress recognize these specific files only if they are placed there.
178
+
-`"dropins"` to tell WP Starter to move two files from their package folder (where Composer placed them) to the project content folder. This is required because WordPress recognizes these specific files only if they are placed there.
180
179
181
-
`object-cache.php` is a dropin to manage object cache using Memcached PECL extension (it's a slightly modified version of [this file](https://github.com/tollmanz/wordpress-pecl-memcached-object-cache)) and `it_IT.php` is a locale file (italian). Both needs to be placed in content folder to work. WP Starter copies them to content folder from the package I saved in a Gist. (see `require` section above).
180
+
`object-cache.php` is a dropin to manage an object cache using Memcached PECL extension (it's a slightly modified version of [this file](https://github.com/tollmanz/wordpress-pecl-memcached-object-cache)) and `it_IT.php` is a locale file (italian). Both need to be placed into the content folder to work. WP Starter copies them to the content folder from the package I saved in a Gist. (see `require` section above).
182
181
183
-
-`"prevent-overwrite"` is used to tell WP Starter to don't overwrite some files, specifically,`wp-config.php`, `index.php` and `.gitignore`.
182
+
-`"prevent-overwrite"` is used to tell WP Starter to not overwrite some files, specifically `wp-config.php`, `index.php` and `.gitignore`.
184
183
185
-
This is especially useful because WP Starter routine is set to be run after any update (see `"scripts"` section above) so any customization to any of these files that happened between installation and update would be lost if WP Starter is not instructed to not overwrite them.
184
+
This is especially useful because WP Starter routine is set to be run after any update (see `"scripts"` section above) so any customization to any of these files that happened between installation and update would be lost if WP Starter is not instructed not to overwrite them.
186
185
187
-
-`env-example` is used to tell WP Starter which file to copy as `.env.example` in project folder. The source used is the same Gist that contains `it_IT.php` file and is used to show how to use a custom package to collect files that you want to share among WP Starter projects.
186
+
-`env-example` is used to tell WP Starter which file to copy as `.env.example` in project folder. The source used is the same Gist that contains the `it_IT.php` file and is used to show how to use a custom package to collect files that you want to share among WP Starter projects.
188
187
189
-
-`gitignore` is used to tell WP Starter what to put in the `.gitignore` file that will be created in project folder. The configuration tells to ignore WordPress, content and vendor folders, a set of common to-be-ignored files and a list of three custom entries.
188
+
-`gitignore` is used to tell WP Starter what to put into the `.gitignore` file that will be created in the project folder. The configuration is set to ignore WordPress, content and vendor folders, a set of commonly ignored files and a list of three custom entries.
190
189
191
-
For more details about any of the WP Starter configuration have a look to*"WP Starter Options"* documentation page.
190
+
For more details about any of the WP Starter configurations have a look at the*"WP Starter Options"* documentation page.
192
191
193
192
### `"installer-paths"` section
194
193
195
194
This is a configuration section introduced by [composer/installers](https://github.com/composer/installers).
196
195
197
-
Using this configuration is possible to tell Composer where to place packages of specific types (see [Composer docs](https://getcomposer.org/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md)).
196
+
Using this configuration it is possible to tell Composer where to place packages of specific types (see [Composer docs](https://getcomposer.org/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md)).
198
197
199
-
This option is necessary here because I want to use `public/content` instead of default `wp-content` as project content folder, that is the installation target folder for plugins and themes.
198
+
This option is necessary here because I want to use `public/content` instead of default `wp-content` as the project's content folder, that is the target installation folder for plugins and themes.
0 commit comments