?
avatar cheiff
cheiff
13 Aug 2017

Hi,
something in the moving of libraries (#17441) breaks the JInputCLI alias for CLI scripts.

Steps to reproduce the issue

Run a CLI script, it should find JInputCLI by invoking

$var = new JInputCLI();

Expected result

It finds JInputCLI.

Actual result

It does not find JInputCLI.
Application breaks.


I attach a test cli script (based on this script by Nicholas) that finds JInputCLI on a 3.7.4 and below but does not in 3.8.0 beta 1.

To run the the test, put the file in the cli folder of a joomla and run

php cli/jinputcli-test.php

I have found a workaround using this

      if (class_exists('JInputCLI'))
        {
          echo "JInputCLI exists\n";
          $this->input = new JInputCLI();
        }
        else
        {
          echo "JInputCLI does NOT exist\n";
          $this->input = new \Joomla\CMS\Input\Cli();
        }

Is this expected behaviour? Or do we have to include other class loader, on top of JLoader::import('joomla.application.cli') ?
If it is not expected, maybe other aliases are affected.

avatar cheiff cheiff - open - 13 Aug 2017
avatar joomla-cms-bot joomla-cms-bot - change - 13 Aug 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 13 Aug 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 13 Aug 2017
Category Libraries
avatar zero-24 zero-24 - change - 13 Aug 2017
Labels Added: ?
avatar zero-24 zero-24 - labeled - 13 Aug 2017
avatar mbabker
mbabker - comment - 13 Aug 2017

Since 3.2.0 the correct casing of the class name has been JInputCli and that's what it must be called as for the class aliasing system to correctly pick it up.

avatar mbabker mbabker - change - 13 Aug 2017
Labels Removed: ?
avatar mbabker mbabker - unlabeled - 13 Aug 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Aug 2017
Status New Information Required
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 14 Aug 2017

@cheiff if Information solves Issue please close it, thanks.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17522.

avatar cheiff
cheiff - comment - 14 Aug 2017

OK. Thank you.

avatar cheiff cheiff - change - 14 Aug 2017
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2017-08-14 09:50:02
Closed_By cheiff
avatar cheiff cheiff - close - 14 Aug 2017

Add a Comment

Login with GitHub to post a comment