@@ -5,7 +5,7 @@ Here are more detailed descriptions for different features you may find in the p
55## Contents
66
77- [ Classes or plain scripts] ( #classes-or-plain-scripts )
8- - [ Class detection performance] ( #class-detection-performance )
8+ - [ Class detection performance] ( #class-detection-and- performance )
99 - [ Class scripts alternative launcher] ( #class-scripts-alternative-launcher )
1010- [ Parameter types] ( #parameter-types )
1111- [ Type casting from requests] ( #type-casting-from-requests )
@@ -79,8 +79,8 @@ aspects of developing a console script with this library:
7979 * _ Class-based_ : Just create a class-based script.
8080 * Generally, your launcher's detector will detect the new class automatically.
8181 Otherwise, update the detection rules in the launcher.
82- * In case of [ caching detected class names] ( #class-detection-performance ) , you should re-create the cache file:
83- ` php your-launcher.php script-launcher:clear-cache `
82+ * In case of [ caching detected class names] ( #class-detection-and- performance ) , you should re-create the cache
83+ file: ` php your-launcher.php script-launcher:clear-cache `
8484* ** Naming and grouping scripts** :
8585 * _ Plain_ : Placing scripts in different directories is your main option.
8686 * If you enable completion, then you may group your scripts by alias prefixes: generate completion scripts for
@@ -95,7 +95,7 @@ aspects of developing a console script with this library:
9595 detection rules to access a selected subset of scripts.
9696</details >
9797
98- ### Class detection performance
98+ ### Class detection and performance
9999
100100` ScriptClassDetector ` provides you with these ways (non-exclusive) to set detection rules:
101101
@@ -106,7 +106,7 @@ aspects of developing a console script with this library:
106106 * User-friendly: pretty much - in trivial cases (all scripts are within a single directory or its subdirectories)
107107 it is enough to specify just a single directory.
108108 * Use case: in most cases this method covers your needs.
109- 1 . ` excludeDirectory() ` allows you to filter out a directory that definitely should not be parsed. Obviously,
109+ 2 . ` excludeDirectory() ` allows you to filter out a directory that definitely should not be parsed. Obviously,
110110 this method works well only when paired with ` searchDirectory() ` method in the recursive mode.
111111 * Use case: the directory specified in ` searchDirectory() ` contains subdirectories that definitely do not contain
112112 console scripts. So you can improve the detection performance by filtering out non-relevant subpaths.
@@ -117,6 +117,12 @@ aspects of developing a console script with this library:
117117 * Use cases:
118118 * Cherry-picking particular scripts.
119119 * Improving detection performance (instead of pointing at a directory with thousands of files).
120+ 4 . Though not a part of ` ScriptClassDetector ` setup, there is a way to mark a class script ignored by all class
121+ detectors: redefine ` ScriptClassAbstract::isAvailableByDetector() ` method for your particular script and make it
122+ return ` false ` if you do not want that script to be detectable.
123+
124+ Do note however, that the detector's ` scriptClassName() ` method does _ not_ consider
125+ ` ScriptClassAbstract::isAvailableByDetector() ` and thus still allows to cherry-pick otherwise ignored scripts.
120126
121127Now consider an odd case. You have a large project (gigabytes / tens of thousands of files), but your console scripts
122128are scattered throughout your whole project for some reason - for instance, each console script is placed close to
0 commit comments