Skip to content

Commit

Permalink
Updated some notes with the paths to what we're editing
Browse files Browse the repository at this point in the history
Thanks to Edison Valdez for highlighting this in the comments! http://knpuniversity.com/screencast/composer#comment-1533775747
  • Loading branch information
weaverryan committed Aug 8, 2014
1 parent 23b67af commit bce08d3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion knpu/composer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,19 @@ we're going to do this inside a custom Drupal module.
To start, I've created a function called ``get_current_files`` deep inside
my project, which returns an array of filenames::

// list_files.module
// sites/all/modules/list_files/list_files.module
// ...

function get_current_files()
{
return array('foo');
}

.. tip::

I've already created a module called ``list_files`` and enabled it before
starting the tutorial.

I've also gone far enough to print these onto the screen. Ok great, now let's
get to work!

Expand Down Expand Up @@ -188,6 +193,9 @@ Now that Composer has downloaded the Finder library, let's use it! To keep
things simple, I'll paste in some Finder code that looks for all gif files
that have been modified within the past day::

// sites/all/modules/list_files/list_files.module
// ...

/**
* A utility function to return the array of current SplFileInfo objects
*/
Expand Down Expand Up @@ -225,6 +233,9 @@ thing is that Composer helps us out. To use Composer's autoloader, simply
include the ``vendor/autoload.php`` file somewhere in your project. For now,
let's put it right inside this function::

// sites/all/modules/list_files/list_files.module
// ...

function get_current_files()
{
require __DIR__.'/../../../../vendor/autoload.php';
Expand All @@ -242,6 +253,7 @@ For Drupal, this might be the ``settings.php`` file::

// sites/default/settings.php
require __DIR__.'/../../vendor/autoload.php';

// ... the rest of the file

When we refresh, everything still works.
Expand Down

0 comments on commit bce08d3

Please sign in to comment.