?
avatar infograf768
infograf768
19 Feb 2017

In com_localise, we use $github = new JGithub($options); to compare core release language files with a language we translate.
I see that the library is no more in 4.0 and there is a deprecate notice
* @deprecated 4.0 Use thejoomla/githubpackage via Composer instead
That is Tibetan for me. :)

Could someone explain to me what I can do precisely to replace new JGithub()

avatar infograf768 infograf768 - open - 19 Feb 2017
avatar joomla-cms-bot joomla-cms-bot - change - 19 Feb 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 19 Feb 2017
avatar yvesh
yvesh - comment - 19 Feb 2017

@infograf768 see https://github.com/joomla-framework/github-api

use Joomla\Github\Github;

$github = new Github;
avatar infograf768
infograf768 - comment - 20 Feb 2017

Alas, I get
Class 'Joomla\Github\Github' not found

avatar yvesh
yvesh - comment - 20 Feb 2017

@infograf768 in 4.0 ;)

avatar infograf768
infograf768 - comment - 20 Feb 2017

yes, in 4.0

avatar infograf768
infograf768 - comment - 20 Feb 2017

I suggest to add back the github library into 4.0.

avatar mbabker
mbabker - comment - 20 Feb 2017

Core doesn't use it (or any of the other social libraries being dropped from the main distribution) and including it in extensions is easy once you grasp the concept of Composer.

avatar infograf768
infograf768 - comment - 21 Feb 2017

I guess my issue is that I do not grasp it at all. ;)

I would need a full tutorial explaining what I should do in the case of com_localise.

My tools are Eclipse (with com_localise as a project in my workspace) and Text editors.


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

avatar infograf768
infograf768 - comment - 21 Feb 2017

Only 'tuto' available is

https://docs.joomla.org/J3.x:Using_Composer_with_Joomla
Which honestly does not help at all


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

avatar Bakual
Bakual - comment - 21 Feb 2017

I always find it strange myself if there is no package to download for a specific library.
I once tried to install composer but didn't get it to work myself. Composer is a great thing for people who use it regulary, but it's a nightmare for people who only do coding occassionally, which there are many in our Joomla sphere.

I'm not sure if it is possible to just download the package from https://github.com/joomla-framework/github-api/releases and include it manually. Maybe a production ready package could be created and put there instead of just the repo-zip there is.
The only dependency I see is the Http package which should be available in Joomla.

avatar yvesh
yvesh - comment - 21 Feb 2017

Step by step tutorial (when you want i make a youtube video):

Step 1:

Get Composer for Mac OS and install it globally:

https://yvesh.gitbooks.io/mac-os-joomla-development-setup/content/composer.html

Step 2:

Open the Mac OS Terminal:

Type in composer and make sure you see the help screen.

Step 3:

Navigate to your Joomla 4.x installation cd path/to/joomla/root

Step 4:

Type in

composer require joomla/github:dev-master

--

And yes the documentation needs updating, will work on that before Google Summer of Code starts in the next weeks.

avatar mbabker
mbabker - comment - 21 Feb 2017

There isn't a concept of "downloadable production ready packages" when it comes to the Composer ecosystem. Even if there were, in many cases you would need to build a package specific to an environment so you really couldn't have a one size fits all solution.

avatar Bakual
Bakual - comment - 21 Feb 2017

I know at least some of the packages which are available in Composer can also be downloaded and used without it. Sure, you need to take care of the dependancies manually (obviously) then but in this case here it wouldn't be needed.
Maybe "production ready" was the wrong term.

avatar mbabker
mbabker - comment - 21 Feb 2017

The things Composer takes care of that you would have to do if you cloned any of our Framework repos' src/ directories (same applies to any package basically, but narrowing scope for the sake of making it easier to explain):

  • Downloading declared dependencies at correct versions
  • Setting up an autoloader to ensure the files get included

The first one is easy to duplicate. Traverse the dependency chain and download all the necessary pieces. The second one you can either write your own autoloader or have a Bootstrap file to require_once all the files.

I'm lazy, so I let a tool do all that for me ?

avatar Bakual
Bakual - comment - 21 Feb 2017

Indeed, the autoloader will be tricky.
Yves doc however is useless for an extension like com_localise. How would that be done for an extension? Eg how will you do this for patchtester (4.0 compatible version), assuming it will use this package?
That would help the usecase of JMS.

avatar mbabker
mbabker - comment - 21 Feb 2017

I don't use JGithub or the Framework's GitHub package because that code lacks some of the flexibility I need.

Nonetheless, I do have a Composer integration in patchtester to use its autoloader versus JLoader and how that is all set up would work just fine for com_localise in theory.

avatar infograf768
infograf768 - comment - 21 Feb 2017

hmm, looks like I am in bad shape...

avatar Bakual
Bakual - comment - 21 Feb 2017

@infograf768 I may have a look when 3.7 is released and I get some free time to look at 4.0. With the example of com_patchtester I may be able to figure out how to do it for com_localise.

avatar franz-wohlkoenig franz-wohlkoenig - change - 30 Mar 2017
Category com_languages
avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Apr 2017
Priority Medium Low
Status New Discussion
avatar brianteeman
brianteeman - comment - 25 Dec 2017

Closed as not a core issue

avatar brianteeman brianteeman - change - 25 Dec 2017
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-12-25 15:04:09
Closed_By brianteeman
avatar brianteeman brianteeman - close - 25 Dec 2017
avatar Bakual
Bakual - comment - 25 Dec 2017

For reference, this is how we solved it for com_localise: joomla-projects/com_localise#322

Add a Comment

Login with GitHub to post a comment