Code Monkey home page Code Monkey logo

console's Introduction

The Console Package Build Status

Latest Stable Version Total Downloads Latest Unstable Version License

The Console package provides the infrastructure for building command line applications with the Joomla! Framework.

Installation via Composer

Add "joomla/console": "~2.0" to the require block in your composer.json and then run composer install.

{
	"require": {
		"joomla/console": "~2.0"
	}
}

Alternatively, you can simply run the following from the command line:

composer require joomla/console "~2.0"

If you want to include the test sources and docs, use

composer require --prefer-source joomla/console "~2.0"

console's People

Contributors

alikon avatar hackwar avatar hleithner avatar joomla-jenkins avatar mbabker avatar nibra avatar philetaylor avatar wilsonge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

nibra hackwar alikon

console's Issues

Regarding adding --live-site to this package

For reference please see the CMS repo issue joomla/joomla-cms#38518 and tagging @nibra so we can carry the discussion here.

The issue in the CMS repo had to do with CMS–specific classes always expecting to run in a web context. For example, the CMS' MVCFactory service always creates MVCFactory factory objects after pushing a SiteRouter service to them. Creating the SiteRouter service requires instantiating the SiteApplication object which which assumes it's running in a web context, therefore expects $_SERVER['HTTP_HOST'] to contain an actual domain name. However, under CLI this contains the path the PHP script we passed to the PHP executable which cannot be parsed as a domain name, causing an exception to be apt out by the Uri framework object.

Question 1: Since the framework is isolated from the CMS, wouldn't it stand to reason that a developer extending the framework Console package would be aware of the CLI–only execution context and not engage in this kind of tomfoolery?

The solution in the CMS repo is to pass a --live-site option which contains the URL to the site the CLI application corresponds to. If this is not available, it will fall back to the application's live_site configuration key. If that is also empty / undefined it will fall back to a fake domain name.

Question 2: Since the framework console application does not have a configuration registry this would be impossible to do. Wouldn't that mean that we would always fall back to the fake domain name, necessitating overriding the method which handles the --live-site option in the CMS?

Question 3: Assuming questions 1 and 2 are answered in the affirmative, would that not mean that the point of having a --live-site option in the framework console application is rather moot?

I mean, sure, I can transfer (parts of) the code to the framework, but does it make sense / does the code belong in the framework? That was why I was sceptical yesterday and why @HLeithner told me I should modify the CMS console application instead.

PHP 8.0 com_finder array issue / solution review

Steps to reproduce the issue

Use smart search component on the frontend with a test query

Expected result

Show search results

Actual result

0 array_merge() does not accept unknown named parameters

System information (as much as possible)

Joomla 4 Beta 8 - Dev
PHP 8.0 - fpm
NGINX

Additional comments

I have fixed / bypassed error as follows

components/com_finder/src/Model/SearchModel.php line 289

  • $include = call_user_func_array('array_merge', $this->includedTerms);
  • $include = call_user_func_array('array_merge', array_values($this->includedTerms));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.