1 | <?php |
||
13 | class MongodbCommands extends DrushCommands { |
||
14 | |||
15 | /** |
||
16 | * The mongodb.tools service. |
||
17 | * |
||
18 | * @var \Drupal\mongodb\Install\Tools |
||
19 | */ |
||
20 | protected $tools; |
||
21 | |||
22 | /** |
||
23 | * MongodbCommands constructor. |
||
24 | * |
||
25 | * @param \Drupal\mongodb\Install\Tools $tools |
||
26 | * The mongodb.tools service. |
||
27 | */ |
||
28 | public function __construct(Tools $tools) { |
||
31 | |||
32 | /** |
||
33 | * Drop the Simpletest leftover collections. |
||
34 | * |
||
35 | * @command mongodb:clean-tests |
||
36 | * @aliases mdct,mo-clean |
||
37 | * |
||
38 | * @usage drush mongodb:clean-tests |
||
39 | * Clean test results after "bash tests.bash". |
||
40 | */ |
||
41 | function mongodbCleanTests() { |
||
55 | |||
56 | /** |
||
57 | * Execute a find() query against a collection. |
||
58 | * |
||
59 | * @param string $alias |
||
60 | * The database alias. |
||
61 | * @param string $collection |
||
62 | * The collection name in the database. |
||
63 | * @param string $selector |
||
64 | * A MongoDB find() selector in JSON format. Defaults to '{}'. |
||
65 | * @param array $options |
||
66 | * A Drush-magic parameter enabling Drush to choose the output format. |
||
67 | * |
||
68 | * @return array |
||
69 | * The matching documents, in array format. |
||
70 | * |
||
71 | * @usage drush mongodb:find <collection> <query>... |
||
72 | * <query> is a single JSON selector in single string format. Quote it. |
||
73 | * @usage drush mongodb:find logger watchdog |
||
74 | * Get the logger/watchdog error-level templates |
||
75 | * @usage drush mo-find logger watchdog '{ "severity": 3 }' |
||
76 | * Get all the logger/watchdog entries tracking rows. |
||
77 | * @usage drush mdbf keyvalue kvp_state '{ "_id": "system.theme_engine.files" }' |
||
78 | * Get a specific State entry. Note how escaping needs to be performed in |
||
79 | * the shell. |
||
80 | * |
||
81 | * @command mongodb:find |
||
82 | * @aliases mdbf,mo-find |
||
83 | */ |
||
84 | public function mongodbFind( |
||
92 | |||
93 | /** |
||
94 | * Print MongoDB settings in Yaml format. |
||
95 | * |
||
96 | * @usage mongodb:settings |
||
97 | * Report on the settings as seen by the MongoDB module suite. |
||
98 | * |
||
99 | * The "unused" $options allows Drush to know the command should support the |
||
100 | * --format option, with the chosen default. |
||
101 | * |
||
102 | * @command mongodb:settings |
||
103 | * @aliases mdbs,mo-set |
||
104 | */ |
||
105 | public function mongodbSettings($options = ['format' => 'yaml']) { |
||
108 | |||
109 | } |
||
110 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.