joomlatools / joomlatools-console Goto Github PK
View Code? Open in Web Editor NEWCommand line interface (CLI) for Joomla.
Home Page: https://www.joomlatools.com/developer/tools/console/
License: Mozilla Public License 2.0
Command line interface (CLI) for Joomla.
Home Page: https://www.joomlatools.com/developer/tools/console/
License: Mozilla Public License 2.0
Add a --relative
flag to the extension:symlink
command to make symlinks relative to the site root directory.
When I execute this command: vendor/bin/joomla site:install --skip-exists-check --www=website --mysql-login=XXX:XXX --mysql-host=XXX --mysql-database=XXX www.testpakket.be
I receive the following error: database with name XXX already exists.
-> Install.php:152
Add pls superuser login:password parameters to site:create and/or site:install to create a custom superuser for the first install. Admin/admin is kinda unsecure.
Recent changes to joomlatools/joomlatools-vagrant have changed the default log path name and format. We need to update this in console as well otherwise the vhosts are not picked up by pimpmylog on the box.
seen with official version 1.4.11.
All option names use "-" as delimiter, just mysql_db_prefix uses "_". I would suggest to do it in a unique way.
Since there might be a lot of scripts in use, maybe it is a better approach to add the option mysql-db-prefix instead of replacing the old value with it. One could declare the old one as obsolete and remove it at a later time
In Extension.Install.php
$model = new \InstallerModelDiscover();
$model->discover();
$results = $model->getItems();
But $model->getItems() return limited result. By default only 20 extensions have been returning.
In getItems:
try
{
// Load the list items and add the items to the internal cache.
$this->cache[$store] = $this->_getList($this->_getListQuery(), $this->getStart(), $this->getState('list.limit'));
}
As a result, if the extension is not included in the first twenty, it will be ignored.
Is there a way to get a PHP shell or run raw PHP code after Joomla is loaded?
Something like joomla eval 'echo JRoute::_("url-query-string");'
Thank you.
The Joomlatools Vagrant 1.5 release now has Nginx running on port 81. Ensure we create Nginx config files for new sites too, including Kodekit Platform
List all available sites.
Right now we store plugins inside the installed directory. If we update or change the version, Composer will completely remove this directory. Result is missing plugins.
Store plugins in a ~/.joomlatools directory to solve this.
$ uname -a
Linux tower 5.2.8-1-MANJARO #1 SMP PREEMPT Fri Aug 9 19:34:20 UTC 2019 x86_64 GNU/Linux
$ joomla --version
Joomla Console tools 1.5.3
Are you working on the Joomlatools Vagrant box: no
PHP Notice: Undefined property: stdClass::$name in /srv/http/.composer/vendor/joomlatools/console/src/Joomlatools/Console/Joomla/Ut
[me@tower http]$ sudo -u http joomla site:list --www /srv/http
PHP Notice: Undefined property: stdClass::$name in /srv/http/.composer/vendor/joomlatools/console/src/Joomlatools/Console/Joomla/Util.php on line 140
2. salon (joomla-cms 3.9.11)
A PHP Notice.
Add Joomla 3.8 compatibility.
Verify the following commands:
https://github.com/joomlatools/textman/pull/431#issuecomment-339886990
It seems Joomla Console has an issue installing a symlinked extension when it has similarly named plugin folder, it somehow calls the uninstall.sql
when trying install the TEXTman Notify plugin plugins/textman/notify
.
$ joomla site:create textman --symlink=textman -vvv
...
Installing textman ..
Enabling plugin `textman` (ID #10001) ..
Installing textman ..
Enabling plugin `textman` (ID #10002) ..
Installing textman ..
Enabling plugin `textman` (ID #10004) ..
Installing com_textman ..
Installing notify ..
Enabling plugin `notify` (ID #10005) ..
Your new Joomla site has been configured.
You can login using the following username and password combination: admin/admin.
It installs everything but it drops the #__textman_revisions
table and deletes textman-files
and textman-images
in the #__files_containers
table, pretty much everything in the uninstall.sql
. It works, however, when I renamed the plugin plg:textman.notify
to plg:koowa.textman
i.e. moving the notify plugin from plugins/textman
folder to plugins/koowa/textman
Allow Joomla package and web installer to be downloaded using proxy environment variables, if set. cURL, if installed/enabled, might prove useful for this.
When installing kodekit-platform, use the Nginx and Varnish config templates from the timble/kodekit-platform repository:
Add a command to the core that duplicates a website and copies its files and database.
I think this is a bug.
I am trying to register my custom component and I am getting a PhP Fatal Error.
I am doing:
joomla extension:register --www=/Volumes/DataDrive/Sites/Joomla joomla4 com_church
`joomla extension:register --www=/Volumes/DataDrive/Sites/Joomla joomla4 com_church
PHP Fatal error: Class Joomlatools\Console\Joomla\Application contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Joomla\Application\AbstractApplication::doExecute) in /Volumes/UserDrive/Users/username/.composer/vendor/joomlatools/console/src/Joomlatools/Console/Joomla/Application.php on line 24
Fatal error: Class Joomlatools\Console\Joomla\Application contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Joomla\Application\AbstractApplication::doExecute) in /Volumes/UserDrive/Users/username/.composer/vendor/joomlatools/console/src/Joomlatools/Console/Joomla/Application.php on line 24`
I try to setup Joomla in a docker imaged, based on alpine linux, derieved from mwaeckerlin/php-fpm. Basic Joomla now works, but when I try to install any extension, I get several error messages.
Create file Dockerfile
:
FROM mwaeckerlin/php-fpm
ENV LANGUAGES ""
ENV MYSQL_USER "root"
ENV MYSQL_PASSWORD "ert456"
ENV MYSQL_DATABASE "websites"
ENV MYSQL_HOST "mysql"
ENV WEB_ROOT_PATH "/joomla/websites"
ENV CONTAINER "websites"
USER root
RUN apk add composer git mysql-client php7-mbstring php7-simplexml php7-session php7-mysqli php7-mbstring php7-bz2 php7-zip \
&& (test ! -d "${WEB_ROOT_PATH%/*}" || rm -rf "${WEB_ROOT_PATH%/*}") \
&& mkdir -p "${WEB_ROOT_PATH%/*}" \
&& mkdir /composer \
&& cd /composer \
&& composer require joomlatools/console \
&& /composer/vendor/bin/joomla site:download --www "${WEB_ROOT_PATH%/*}" "${WEB_ROOT_PATH##*/}" \
&& chown -R nginx "${WEB_ROOT_PATH%/*}" \
&& sed -i 's,^ *;\? *session.save_path =.*,session.save_path = "/tmp",' /etc/php7/php.ini \
&& mkdir /joomla/plugins \
&& mv /start.sh /start-php-fpm.sh
USER nginx
ADD start.sh /start.sh
Create file start.sh
and set it's executable mode chmod +x start.sh
:
#!/bin/sh -e
echo | mysql -u root -pert456 -h mysql websites || \
/composer/vendor/bin/joomla database:install \
--www "${WEB_ROOT_PATH%/*}" \
-L "${MYSQL_USER}:${MYSQL_PASSWORD}" \
--mysql-database "${MYSQL_DATABASE}" \
-H "${MYSQL_HOST}" \
"${WEB_ROOT_PATH##*/}"
test -e ${WEB_ROOT_PATH}/configuration.php || \
/composer/vendor/bin/joomla site:configure \
--www "${WEB_ROOT_PATH%/*}" \
-L "${MYSQL_USER}:${MYSQL_PASSWORD}" \
--mysql-database "${MYSQL_DATABASE}" \
-H "${MYSQL_HOST}" \
"${WEB_ROOT_PATH##*/}"
sed -i "s,public *\$session_handler *=.*;,public \$session_handler = 'none';," ${WEB_ROOT_PATH}/configuration.php
/start-php-fpm.sh
docker build --rm --force-rm -t mwaeckerlin/joomla .
docker run --name joomla-mysql -d -e MYSQL_ROOT_PASSWORD=ert456 mysql:5
docker run -d --name joomla -p 8001:8080 --link joomla-mysql:mysql mwaeckerlin/joomla
docker exec -it joomla sh
/composer/vendor/bin/joomla extension:install --www "${WEB_ROOT_PATH%/*}" "${WEB_ROOT_PATH##*/}" com_virtuemart
Get error messages:
nginx@php-fpm[59717c39181a]:/$ /composer/vendor/bin/joomla extension:install --www "${WEB_ROOT_PATH%/*}" "${WEB_ROOT_PATH##*/}" com_virtuemart
PHP Notice: Constant JROUTER_MODE_RAW already defined in /joomla/websites/libraries/import.php on line 60
Notice: Constant JROUTER_MODE_RAW already defined in /joomla/websites/libraries/import.php on line 60
PHP Notice: Constant JROUTER_MODE_SEF already defined in /joomla/websites/libraries/import.php on line 67
Notice: Constant JROUTER_MODE_SEF already defined in /joomla/websites/libraries/import.php on line 67
Does not install the component, com_virtuemart
is missing:
nginx@php-fpm[59717c39181a]:/$ ls /joomla/websites/components/
com_ajax com_fields com_newsfeeds
com_banners com_finder com_search
com_config com_mailto com_tags
com_contact com_media com_users
com_content com_menus com_wrapper
com_contenthistory com_modules index.html
Installation succeeds.
I also tried to install from zip-files using extension:installfile
, but I get the same result.
Because there are so many different ways to restart the various services based on OS and tools, it will be easiest to replace the command with our own box server:restart command. Only run it if the environment is the Joomlatools Vagrant box.
The symfony/console package version is currently locked at 2.7.x, while 4.0 is already released. Update composer.json and the code accordingly.
Since Composer 1.0 release we are unable to install plugins. The composer show --all
command does not work anymore: https://github.com/joomlatools/joomlatools-console/blob/master/src/Joomlatools/Console/Command/Plugin/Install.php#L66 and should be replaced by whatever is now required to fetch package info.
Prepare maintenance release v1.4.7
Instead of downloading the site from and extracting it to /var/www, make it possible to clone the repo instead.
Add --from-file
flag to vhost:create
to use external files as template.
The joomla site:create command needs a bit more database queries now than before. In particular, we are missing the insertion of the j_schemas table. The missing logic is highlighted here: https://github.com/joomla/joomla-cms/blob/04f09d5c9b834c5a8a1707013a94720e777ceed7/installation/model/database.php#L482-L537
Two ways to try and solve this:
More info: https://groups.google.com/forum/?fromgroups#!topic/joomla-dev-cms/ohoKk6h7VI0
Use shallow clone for repository cloning in Joomlatools\Console\Command\Site\Download
to speed up installation (of platform).
Replace .dev with .test tld to prevent the coming HSTS defaults in Chrome from breaking .dev domains.
See: https://ma.ttias.be/chrome-force-dev-domains-https-via-preloaded-hsts/
The joomla bootstrapper logic relies on legacy classes that have now been removed from joomla-platform core in joomlatools/joomlatools-platform#258.
It's logical but without the git package, downloading the Joomla! versions won't work. It isn't mentioned in the installation nor in the requirements:
Requirements
Composer
Joomla version 2.5 and up.
The extension:install
and other related commands are failing to execute when Joomla error_reporting
is set to Development:
Notice: Constant JROUTER_MODE_RAW already defined in /var/www/html/libraries/import.php on line 60
Notice: Constant JROUTER_MODE_SEF already defined in /var/www/html/libraries/import.php on line 67
Warning: session_name(): Cannot change session name when headers already sent in /var/www/html/libraries/joomla/session/handler/native.php on line 128
Warning: session_cache_limiter(): Cannot change cache limiter when headers already sent in /var/www/html/libraries/joomla/session/handler/native.php on line 235
The conflict relies on both libraries/import.php
and libraries/import.legacy.php
being required. The first directly by Bootstrapper and the latest indirectly by includes/framework.php
which will ultimately require it. Usually this kind of conflicts would have been unnoticed because of the use of required_once
statement, but in this case those are two different files.
This has been already reported at #97 but aparently not identified as an issue, most likely because of the error_reporting
setting.
If a package name (vendor/package) is passed to the extension:install command, install it using Composer
We are currently hardcoding a bunch of possible locations for autoload.php (see #44). If possible we should make this more flexible, and find the autoloader.php location based on the Composer manifest.
Hello joomlatools,
really nice CLI tool, great and very helpful.
In my eyes a very important function is missed to use it on a daily base - a command to initialize an existing site like for eg. composer does.
I did not check your routines so much for now, but maybe you do see an option to add a class / cmd for this feature request?
Add a vhost:alias
command to add a new alias to the ServerAlias
line in the site vhost.
Due to whitespace changes in configuration.php-dist in Joomla 3.7 our regexp for configuration.php is not working correctly.
See: https://github.com/joomla/joomla-cms/blob/staging/installation/configuration.php-dist#L65
The feed at http://update.joomla.org/language/translationlist_3.xml is used to update languages. We can use this to install languages through the command line.
Add a site:language command that will look for the corresponding download package, and install it with our Composer installer.
No idea why it wants to start a session but something seems to break.
PHP 7.1
Joomla CMS 3.7.5
Joomla Console tools 1.4.10
$ joomla extension:install --www=/var/www mysite 'mod_upload'
[RuntimeException]
Failed to start the session
extension:install [--www WWW] [--] <site> <extension> (<extension>)...
By default, we clone platform using the SSH protocol, which does not work if there is no correct key installed. Use HTTPS for platform.
using official version 1.4.11
Using the option --mysql-db-prefix produces an error, That's fine for the moment, because the syntax is not allowed (yet). Using --mysql_db_prefix instead is accepted, but the new value is not used with the table names. They still are prefixed with the default "j_".
Here cmd:
joomla site:create joomla1 --www=/var/www/html
Joomla creates at the /var/www/html/joomla1, but
cat sites-available/1-joomla1.conf | grep '/var/www/'
DocumentRoot /var/www/joomla1
<Directory /var/www/joomla1>
And if i run
joomla vhost:create joomla1 --www=/var/www/html
i see:
cat sites-available/1-joomla1.conf | grep '/var/www/'
DocumentRoot /var/www/html/joomla1
<Directory /var/www/joomla1>
Since the list of available options is getting a bit big, it would make life easier if we could store the settings in a config.yaml file.
Apache runs back on port 80 so make sure default port is set correctly.
Joomla added a new isClient method to JApplication derivatives to replace isSite and isAdmin. We should define this ourselves in the Application since it's breaking with Joomla 3.7.0
site:token does not work on Joomlatools Platform
Make the symlinker easily configurable by storing directory relations in a JSON file. This allows any project to use custom symlink options by putting in a symlinker.json
file in its root.
Inspiration:
When trying to install a first plugin, there is no composer.json yet in the plugins directory. Recent versions of Composer will prompt the user if they want to use a composer.json file in the parent directory if it exists. This breaks the plugin:install
command.
Add the --no-intercation
flag to fix this.
Prepare 1.5 release
When you install a plugin in the repo folder itself it's available to be committed. Ignore the contents of plugins/*
try to use your command
joomla site:create test
and get
gzip: /root/.config/composer/vendor/joomlatools/console/bin/.files/cache/7522513af9d772a10efbc54fc410dbce/current.tar.gz: not in gzip format
[RuntimeException]
Downloaded tar archive "current.tar.gz" could not be verified. A common cause is an interrupted download:
check your internet connection and try again.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.