Questions tagged [cli]
An acronym for "Command Line Interface". The interface to a program that consists entirely of text, as opposed to (although not necessarily mutually exclusive to) a GUI, or Graphical User Interface.
25 questions
1
vote
2
answers
222
views
can I fix (update) the database from the CLI? (J4)
I'm looking for a way to run the DB "Fix" action that was present in J3 from the Manage Extensions Database menu item.
Longer explanation --
I am trying to deploy upgrades from my dev ...
0
votes
1
answer
39
views
"In Folder.php line 108: Cannot open source folder" after running core:update
An error message without any hints on how to proceed. I'm guessing permission problem? But which folder is the source folder?
Running again in verbose mode:
$ php7.4 cli/joomla.php core:update -vvv
...
0
votes
1
answer
35
views
" ! [NOTE] There are available updates to apply" - but no way to apply them via CLI?
When using Joomla CLI to check for update, I run
php cli/joomla.php update:extensions:check
and get
! [NOTE] There are available updates to apply
[ OK] Check complete. ...
0
votes
1
answer
93
views
Upgrade Joomla CLi script to handle bulk import of items into articles
I am upgrading a client's CLi script that is used to automatically bulk import news items into Joomla articles. The code was originally programmed for Joomla 3 and now needs to support Joomla 4.
I ...
0
votes
1
answer
333
views
PHP load class from namespace error
I have been using this doc to convert a client's CLi news import script from Joomla 3 to 4. The code has been stripped of all the JSON to article code for brevity.
I have gone over all of my code and ...
0
votes
1
answer
412
views
How do Joomla CLI/Console jobs and Task Scheduler jobs fit together?
I know that this could be considered a subjective question, but I think it's important.
(I do produce Joomla documentation for extension developers and it would be useful to relay answers to them).
In ...
0
votes
2
answers
326
views
Help with update a JoomlaCli-Application from Joomla 3 to Joomla 4
I'm working with a JoomlaCli Application, called from a external php command via a cronjob. It worked in Joomla 3, but in Joomla 4 some classes have changed.
Our class name is import
Namespaces:
use ...
2
votes
0
answers
166
views
SimpleXML load file error for cli PHP script
I am using the following code in the Joomla Cli to import news items into articles on a client's website. It was working perfectly until yesterday when an error was reported and no news items were ...
0
votes
1
answer
418
views
Call to undefined method Joomla\CMS\Application\ConsoleApplication::getTemplate()
I am converting some Joomla 3 CLI applications to use the Joomla Console and this message is causing my new CLI's to fail. There are various entries in Joomla tracker relating to similar issues where ...
0
votes
1
answer
96
views
How to setup a custom command-line class in Joomla4?
I'm interesting in developing a custom command-line class in Joomla4, but I don't know where to get started.
Can anyone provide a general example on how to set up a class for this purpose?
1
vote
1
answer
40
views
Change debug variable during cli script execution
I'm trying to make a script to update components and I want to retrieve the logs to check the execution of all the requests related to the update of a component.
In the script I use Joomla methods, ...
1
vote
1
answer
27
views
Omit previously imported articles by comparing existing articles aliases with generated aliases
I am needing to compare the generated articles aliases of items imported from an external news API against those that are already stored in the com_content database to ensure that duplicates are ...
1
vote
3
answers
398
views
Execute Joomla CLI script to bulk import JSON data to articles
I have the following PHP code working to bulk add array items from JSON to com_content. The code is executed by directly accessing the file in the web browser. For example, http://examples.com/json-...
2
votes
2
answers
2k
views
Loading a helper file in Joomla 4
I'm having trouble with using a helper file in Joomla 4, I'm not really sure where I'm going wrong.
I have a helper file in my template, like templates/mytemplate/html/helper.php and this works well ...
2
votes
4
answers
711
views
CLI directory is publicly accessible. Is it supposed to be? Is that safe?
I've searched around and can't find an explanation. According to some documentation, it seems to be something for the admin to execute from the shell.
1
vote
1
answer
120
views
Error JLIB_APPLICATION_ERROR_INVALID_CONTROLLER from CLI on Joomla 3.7
I have an issue with a cli php script that I'm trying to execute.
I want to add an article with custom fields.
The part where I add articles is working well, but when I add the code to load the ...
0
votes
0
answers
84
views
Can't get a task to work from CLI
I've got a custom component I've written which has a task that needs to be run every evening.
I'm using JApplicationCli but I can't get it to work.
From searching on the web I've found a suggestion to ...
1
vote
1
answer
111
views
Joomla Framework folder "libraries" missing
I'm having difficulties when trying to implement the example given on https://docs.joomla.org/Framework:Creating_a_Stand-alone_Application#Examples
I'm trying to do the first example and I'm getting ...
2
votes
0
answers
210
views
CLI for joomla 4 not working for me
Joomla 4
PHP 7.3.1
Composer and NPM node modules installed
Following this doc on Joomladocs, CLI Update, php cli/joomla.php - and whatever command I add after doesn't work. I get an error message (...
2
votes
1
answer
294
views
Joomla SEF url in CLI script
I am new to Joomla, I am writing a script under folder cli. I am calling helper file of admin component where I fetch category and return url of category.
The function in helper is fine and works ...
1
vote
2
answers
196
views
Installing language from CLI
Does anybody know of a way to automate the installation of language packs via the CLI, as opposed to using the Extensions -> Language(s) menu in the administrator CMS?
I am automating a site build ...
0
votes
1
answer
943
views
How to use external PHP library in Joomla! CLI application - Class not found
I'm working on a custom Joomla! CLI application and would like to rely on an external PHP library to reuse some functionality.
// Set flag that this is a parent file.
const _JEXEC = 1;
...
0
votes
3
answers
524
views
How to add a CLI file to the /CLI directory as part of a component install
I have a component that needs a CLI file for use with cron. Is there a proper way to use the components manifest file to specify that the component includes a CLI file and that CLI file should be ...
1
vote
2
answers
665
views
JApplicationCli command line interface app does not work as explained in the tutorial
I have a Joomla website and I'm working on a Joomla command line interface application that would do some scheduled maintenance tasks. I follow the below article in building the cli app:
https://docs....
1
vote
1
answer
118
views
How does Joomla initialise all active libraries and plugins?
I'm trying to import Joomla in a Yii application. It goes well, but some plugins and libraries are not loaded. Does anyone know how to achieve this? Something like
JPluginHelper::loadAllActivePlugins(...