Questions tagged [console]

The tag has no usage guidance.

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

Running Craft Console Commands on Webfaction

I'm trying to run a few of Craft's console commands on a Webfaction server to automate running Craft migrations and resolving Project Config changes, and it's throwing an error. Here's what I'm doing: ...
1
vote
1answer
29 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
156 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
416 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
13 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
61 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 ...
1
vote
3answers
873 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
939 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
139 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
345 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
216 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
89 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
609 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
367 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
126 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
563 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
134 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?