Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [console]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
18 views

Craft console app within windows batch script

I try to create a simple deployment batch script that would work on windows. To do that, I need to interact with Craft console app. How do I pass multiple commands to it to perform installation? I ...
1
vote
1answer
27 views

Calling Craft Console Commands from Plugin?

I am in the process of building a plugin that has a controller that accepts a HTTP request. If the token and request are valid, I would like to call a Craft Console Command from within the plugin (e.g....
1
vote
1answer
126 views

Why is my custom console command throwing Calling unknown method: …getAcceptsJson?

I have a module with a console controller (ScriptsController): namespace modules\vetscripts\console\controllers; use yii\console\Controller; use yii\console\ExitCode; use modules\vetscripts\...
0
votes
0answers
8 views

AssetBundle-related when installing a plugin via console and not via Cp

I have a plugin which registers an AssetBundle. The asset bundle itself is quite basic and only includes one JS-File. In the init() method of my plugin, I register the bundle: // registering the ...
0
votes
0answers
31 views

Run craft commands from console bootstrap file

i want to change the craft email settings from console, because it is not possible to change all settings with enviroment variables. When i run this file, which is based on the craft executable, from ...
0
votes
0answers
35 views

How do you register template paths from a module or plugin when a console controller action is called?

When developing Craft 3 plugins/modules, we usually tie into the View::EVENT_REGISTER_CP_TEMPLATE_ROOTS or View::EVENT_REGISTER_SITE_TEMPLATE_ROOTS RegisterTemplateRootsEvent events to register custom ...
1
vote
2answers
404 views

Unable to run console commands (Craft 3, MAMP)

This was asked and solved previously, but for Craft 2, see Error Connecting To (MAMP Pro) Database in Console Command. Unable to make it work here. In short, running console commands like ./craft abc ...
1
vote
1answer
595 views

How do I create console commands for my module or plugin?

I would like to create a custom console command for my Craft 3 plugin. I've looked at the Yii docs and understand commands are defined using controllers extending \yii\console\Controller but cannot ...
1
vote
1answer
97 views

How can I call console controllers

I have a controller in the console folder. How can I call this controller via ajax please? I tried to config a route in Routes.php, and then call this route by jquery Get() function. But none of ...
1
vote
1answer
226 views

Reset admin account password using command line interface

Can I reset admin password using console CLI interface? Didn't see anything like that when I run the craft file directly and it displayed list of commands.
2
votes
2answers
165 views

How can I render a page template from a queue job/console controller?

I'm trying to call craft\web\View::renderPageTemplate from within a console controller (also tried from a queue job), but running into all kinds of trouble: E.g. Exception 'Twig_Error_Runtime' with ...
2
votes
1answer
79 views

Run Craft Find and Replace via Console

I'm trying to streamline my deployments for local, staging and production and would like to know if it's possible to invoke the Find and Replace method via Console. I have a multi-config in place, but ...
2
votes
1answer
580 views

How do I configure multiple environments for console commands?

I have built a plugin with some console commands for automating some regular tasks that will be run by a cron job for my site. In order to get the commands working, I had to replicate my database ...
2
votes
0answers
340 views

Craft\ConsoleApp and its behaviors do not have a method or closure named “getTheme”

I'm trying to render a template from a console command, but i'm getting the following error: Craft\ConsoleApp and its behaviors do not have a method or closure named "getTheme" The code looks like ...
1
vote
1answer
117 views

How to set CRAFT_PLUGINS_PATH when invoking a console plugin action

I have an install where I've moved the plugins/ directory outside of the craft/ directory. I've set CRAFT_PLUGINS_PATH in index.php and for web requests everything works fine. Now I need to run a ...
0
votes
1answer
84 views

Unable to connect to db via console with a custom config directory path

I've just used yiic for the first time for a plugin record installation and found that the db.php config file didn't seem to be picked up and I got database connection failures. I added a console ...
1
vote
1answer
523 views

Enable craft.log for console commands [closed]

I've got devMode enabled and can see the log happening in craft/storage/runtime/logs/craft.log for browser requests... but was wondering if there is a way to enable this level of logging (detailing ...
0
votes
1answer
131 views

Running a console command produces an error mentioning sessions. How do I resolve?

None of the craft core console commands to work. For example: ./yiic querygen all My_MyRecord produces an error which includes mention of session? How do I get craft console commands working again?