@@ -47,14 +47,19 @@ we're going to do this inside a custom Drupal module.
47
47
To start, I've created a function called ``get_current_files `` deep inside
48
48
my project, which returns an array of filenames::
49
49
50
- // list_files.module
50
+ // sites/all/modules/list_files/ list_files.module
51
51
// ...
52
52
53
53
function get_current_files()
54
54
{
55
55
return array('foo');
56
56
}
57
57
58
+ .. tip ::
59
+
60
+ I've already created a module called ``list_files `` and enabled it before
61
+ starting the tutorial.
62
+
58
63
I've also gone far enough to print these onto the screen. Ok great, now let's
59
64
get to work!
60
65
@@ -188,6 +193,9 @@ Now that Composer has downloaded the Finder library, let's use it! To keep
188
193
things simple, I'll paste in some Finder code that looks for all gif files
189
194
that have been modified within the past day::
190
195
196
+ // sites/all/modules/list_files/list_files.module
197
+ // ...
198
+
191
199
/**
192
200
* A utility function to return the array of current SplFileInfo objects
193
201
*/
@@ -225,6 +233,9 @@ thing is that Composer helps us out. To use Composer's autoloader, simply
225
233
include the ``vendor/autoload.php `` file somewhere in your project. For now,
226
234
let's put it right inside this function::
227
235
236
+ // sites/all/modules/list_files/list_files.module
237
+ // ...
238
+
228
239
function get_current_files()
229
240
{
230
241
require __DIR__.'/../../../../vendor/autoload.php';
@@ -242,6 +253,7 @@ For Drupal, this might be the ``settings.php`` file::
242
253
243
254
// sites/default/settings.php
244
255
require __DIR__.'/../../vendor/autoload.php';
256
+
245
257
// ... the rest of the file
246
258
247
259
When we refresh, everything still works.
0 commit comments