patternlab-php-core icon indicating copy to clipboard operation
patternlab-php-core copied to clipboard

WIP - Configurable Paths

Open EvanLovely opened this issue 8 years ago • 3 comments

Intended to fix #35 to bring in configurable paths besides just pointing towards source directory. This needs to be backwards compatible as well.

EvanLovely avatar Nov 02 '17 16:11 EvanLovely

I've got a commit on this branch that cleans up the config setting so diffs should make much more sense now.

EvanLovely avatar Nov 02 '17 16:11 EvanLovely

I could see using self::getOption() in Config.php as it utilizes a nice function from ArrayFinder that allows you to do self::getOption('paths.source.patterns') and not having to worry about if paths or paths.source is there before trying to get paths.source.patterns. Kind of like this:

- self::$options["patternSourceDir"] =
-   isset(self::$options["patternSourceDir"])
-     ? self::$options["sourceDir"] . DIRECTORY_SEPARATOR . self::cleanDir(self::$options["patternSourceDir"])
-     : self::$options["sourceDir"] . DIRECTORY_SEPARATOR . "_patterns";

+ self::$options["patternSourceDir"] =
+   self::getOption('paths.source.patterns')
+     ? self::$options["baseDir"] . self::cleanDir(self::getOption("paths.source.patterns"))
+     : self::$options["sourceDir"] . DIRECTORY_SEPARATOR . "_patterns";

EvanLovely avatar Nov 02 '17 16:11 EvanLovely

Oh wait a sec @EvanLovely are you just doing what I think you're doing here? Cleaning up the crappy whitespace with literally zero code changes otherwise?

If so, can we merge this down to develop (yay clean diffs) so we can point any subsequent PRs at that easier to follow base? Or maybe a separate PR so this can act as an umbrella ticket? shrug

sghoweri avatar Nov 02 '17 22:11 sghoweri