elkuku / EasyCreator

EasyCreator helps creating extensions for the Joomla! CMS
http://extensions.joomla.org/extensions/miscellaneous/development/5908
50 stars 23 forks source link

Just unable to create the class list for the Joomla API. #38

Closed Bodge-IT closed 6 years ago

Bodge-IT commented 9 years ago

Doesn't matter what I put in the field for the 'local API copy', when I click Create Class List, I get: Joomla libs NOT FOUND

e.g. I have /libraries folder (copied from 3.4.1 installation) in D:\Workspace\Joomla\3.4.1

I set 'Local API copy' to: D:\Workspace\Joomla\3.4.1 D:\Workspace\Joomla\3.4.1\libraries D:\Workspace\Joomla\3.4.1\libraries\joomla

Still get the same issue.

Bodge-IT commented 9 years ago

Could do with a pointer from you guys that have this working?

Bodge-IT commented 9 years ago

Great community support.

HermanPeeren commented 9 years ago

Probably not many people actively use EasyCreator at the moment. Happily it is open source, so such a bug is easily found.

The error is raised in https://github.com/elkuku/EasyCreator/blob/master/admin/helpers/jmethodlister.php#L53

object.php has been moved and so are some of the other files in line #74-81. So the right locations must be provided and/or maybe a switch like you see in line #88vv to include those files when you still want to use EC with older Joomla-versions.

I'll make a Pull Request for this, but am a bit under stress for some deadlines. Maybe you can do it yourself with those hints. Anyhow: have a nice day!

Bodge-IT commented 9 years ago

I made my way through those changes Herman and finally got this: Lines 74 to 81 now look like this: require_once JPATH_LIBRARIES.DS.'joomla'.DS.'object'.DS.'object.php'; require_once JPATH_LIBRARIES.DS.'legacy'.DS.'base'.DS.'observer.php'; require_once JPATH_LIBRARIES.DS.'legacy'.DS.'base'.DS.'observable.php'; require_once JPATH_LIBRARIES.DS.'joomla'.DS.'event'.DS.'event.php'; require_once JPATH_LIBRARIES.DS.'joomla'.DS.'document'.DS.'renderer.php'; // require_once JPATH_LIBRARIES.DS.'joomla'.DS.'registry'.DS.'registry.php'; // Couldn’t find registry.php anywhere.

Now I get: Unsupported Joomla! version: 3.4

Progress I guess.

From: HermanPeeren [mailto:notifications@github.com] Sent: 31 May 2015 18:35 To: elkuku/EasyCreator Cc: Gary Barclay Subject: Re: [EasyCreator] Just unable to create the class list for the Joomla API. (#38)

Probably not many people actively use EasyCreator at the moment. Happily it is open source, so such a bug is easily found.

The error is raised in https://github.com/elkuku/EasyCreator/blob/master/admin/helpers/jmethodlister.php#L53

object.php has been moved and so are some of the other files in line #74-81. So the right locations must be provided and/or maybe a switch like you see in line #88vv to include those files when you still want to use EC with older Joomla-versions.

I'll make a Pull Request for this, but am a bit under stress for some deadlines. Maybe you can do it yourself with those hints. Anyhow: have a nice day!

— Reply to this email directly or view it on GitHubhttps://github.com/elkuku/EasyCreator/issues/38#issuecomment-107226342.

Bodge-IT commented 9 years ago

Hi Herman, So I added my own 3.4 case: case '3.4': include_once JPATH_LIBRARIES.DS.'joomla'.DS.'database'.DS.'database.php'; include_once JPATH_LIBRARIES.DS.'joomla'.DS.'database'.DS.'query.php';

    include_once JPATH_LIBRARIES.DS.'joomla'.DS.'base'.DS.'adapterinstance.php';
    include_once JPATH_LIBRARIES.DS.'joomla'.DS.'form'.DS.'helper.php';
    include_once JPATH_LIBRARIES.DS.'joomla'.DS.'form'.DS.'field.php';
    include_once JPATH_LIBRARIES.DS.'joomla'.DS.'updater'.DS.'updateadapter.php';
    include_once JPATH_LIBRARIES.DS.'joomla'.DS.'log'.DS.'log.php';
    include_once JPATH_LIBRARIES.DS.'joomla'.DS.'log'.DS.'entry.php';
    include_once JPATH_LIBRARIES.DS.'joomla'.DS.'date'.DS.'date.php';

// include_once JPATH_LIBRARIES.DS.'joomla'.DS.'application'.DS.'cli.php'; // include_once JPATH_LIBRARIES.DS.'joomla'.DS.'application'.DS.'daemon.php'; // include_once JPATH_LIBRARIES.DS.'joomla'.DS.'string'.DS.'string.php'; include_once JPATH_LIBRARIES.DS.'joomla'.DS.'github'.DS.'object.php';

    include_once JPATH_LIBRARIES.DS.'joomla'.DS.'http'.DS.'http.php';

    $prevIncluded = $prevIncluded + array('JDatabase', 'JDatabaseQuery', 'JAdapterInstance', 'JFormField'
        , 'JUpdateAdapter', 'JLog', 'JLogEntry', 'JDate', 'JGithubObject', 'JHttp');

    break;

I then had to alter path n 204: require_once JPATH_LIBRARIES.DS.'legacy'.DS.'request'.DS.'request.php';

Then I get fatal error: Fatal error: Class 'Joomla\Application\AbstractApplication' not found in D:\wamp\www\apps\easycreator\libraries\joomla\application\base.php on line 20

I can pick and scrape my way through errors but now 291 just says Include_once $file so I guess it’s running through tonnes of files.

I can’t see where it’s even calling application/base.php

So a bit more progress but not as much as I’d hoped.

From: HermanPeeren [mailto:notifications@github.com] Sent: 31 May 2015 18:35 To: elkuku/EasyCreator Cc: Gary Barclay Subject: Re: [EasyCreator] Just unable to create the class list for the Joomla API. (#38)

Probably not many people actively use EasyCreator at the moment. Happily it is open source, so such a bug is easily found.

The error is raised in https://github.com/elkuku/EasyCreator/blob/master/admin/helpers/jmethodlister.php#L53

object.php has been moved and so are some of the other files in line #74-81. So the right locations must be provided and/or maybe a switch like you see in line #88vv to include those files when you still want to use EC with older Joomla-versions.

I'll make a Pull Request for this, but am a bit under stress for some deadlines. Maybe you can do it yourself with those hints. Anyhow: have a nice day!

— Reply to this email directly or view it on GitHubhttps://github.com/elkuku/EasyCreator/issues/38#issuecomment-107226342.

hgh-esn commented 9 years ago

Hi,

Please change .DS to .‘/‘ (or .’\’ - I’m not shure) and see what happens.

The .DS variable isn’t supported anymore by PHP

regards

Hans-Günter Heiserholt

Von: Gary Barclay [mailto:notifications@github.com] Gesendet: Montag, 1. Juni 2015 17:30 An: elkuku/EasyCreator Betreff: Re: [EasyCreator] Just unable to create the class list for the Joomla API. (#38)

I made my way through those changes Herman and finally got this: Lines 74 to 81 now look like this: require_once JPATH_LIBRARIES.DS.'joomla'.DS.'object'.DS.'object.php'; require_once JPATH_LIBRARIES.DS.'legacy'.DS.'base'.DS.'observer.php'; require_once JPATH_LIBRARIES.DS.'legacy'.DS.'base'.DS.'observable.php'; require_once JPATH_LIBRARIES.DS.'joomla'.DS.'event'.DS.'event.php'; require_once JPATH_LIBRARIES.DS.'joomla'.DS.'document'.DS.'renderer.php'; // require_once JPATH_LIBRARIES.DS.'joomla'.DS.'registry'.DS.'registry.php'; // Couldn’t find registry.php anywhere.

Now I get: Unsupported Joomla! version: 3.4

Progress I guess.

From: HermanPeeren [mailto:notifications@github.com] Sent: 31 May 2015 18:35 To: elkuku/EasyCreator Cc: Gary Barclay Subject: Re: [EasyCreator] Just unable to create the class list for the Joomla API. (#38)

Probably not many people actively use EasyCreator at the moment. Happily it is open source, so such a bug is easily found.

The error is raised in https://github.com/elkuku/EasyCreator/blob/master/admin/helpers/jmethodlister.php#L53

object.php has been moved and so are some of the other files in line #74-81. So the right locations must be provided and/or maybe a switch like you see in line #88vv to include those files when you still want to use EC with older Joomla-versions.

I'll make a Pull Request for this, but am a bit under stress for some deadlines. Maybe you can do it yourself with those hints. Anyhow: have a nice day!

— Reply to this email directly or view it on GitHubhttps://github.com/elkuku/EasyCreator/issues/38#issuecomment-107226342.

— Reply to this email directly or view it on GitHub https://github.com/elkuku/EasyCreator/issues/38#issuecomment-107584873 . https://github.com/notifications/beacon/AFDeDpXHrjFRIthXbyotlGTAiWwDf25Sks5oPHIBgaJpZM4EEW5A.gif

HermanPeeren commented 9 years ago

DS as constant is not supported by Joomla itself anymore, but is defined in EasyCreator. So it is not a bug here. It is not necessary anymore, because PHP would provide the right directory separator; you can just use '/' (the forward, not the backward slash). In short: you can use '/' instead of DS, but it won't solve (nor create) any problem.

More generally speaking: DS was solving a problem that has been solved by PHP and probably there are more solutions in this legacy code of EasyCreator (EC) that don't solve any current problem in Joomla anymore. I guess some of those problems with versioning and including files are no problems anymore (with current autoloading).

A lesson of this could be: if we want to work on a next version of EasyCreator, maybe we should drop support for older versions. If you would ever need an older version, you could go back to an older version of EC. That would make some of the problems you are facing now (detecting what version and including files) obsolete. And EC more maintainable and useful.

HermanPeeren commented 9 years ago

About the fatal error you reported: this jmethodlister.php-file is a PHP-script that is called directly, not as part of a Joomla-component. That is why all kinds of files are included: because it doesn't have those Joomla-files loaded like a Joomla extension would have. But then, when it tries to instantiate a ReflectionClass of those classes it suddenly cannot find the parent class of JApplication Daemon and JApplicationCli: because in the latest Joomla version those base-classes have been replaced byJoomla\Application\AbstractApplication (= the namespaced equivalent from the Joomla Framework), while we didn't define any autoloading of those files nor did we include them.

A short term fix could be to include that new file in which Joomla\Application\AbstractApplication is defined: it was put into Joomla 3.4 using composer and is at libraries/vendors/joomla/application/src/AbstractApplication.php. And maybe some more of those newly used files from the Joomla Framework.

A more solid solution is to use the current autoloader from Joomla. It will save a lot of "includes".

IMHO we need a major refactoring of EC to keep it useful. On the other hand: this is only for listing those methods of Joomla-classes, which is AFAIK not a core feature of EC (I could be wrong here); at first glance it looks to me EC can function without that class-methods-listing. If true, we could disable this listing and put that feature in the fridge, while concentrating on core features of EC (that is: to generate Joomla extensions). Just some thoughts, without really diving deep into it.

Bodge-IT commented 9 years ago

Wish I understood some more of that. I think you're right about the refactoring and dropping of support of old versions.

Out of interest would that also allow us to leverage the features of composer in EasyCreator?

I've tried a commit with what I have done...not sure if it's appropriate if it doesn't fix anything.

Bodge-IT commented 9 years ago

In order to help me understand where some of the issues are, I'm trying to set up a testing environment as per Joomla bug fix requirements but its a lot to get your head around.

HermanPeeren commented 9 years ago

I think it is a very good investment of your time if you set up a good environment. I'd start with an IDE (can be Eclipse or NetBeans, which are free, but I recommend PHPstorm, which is more than worth the fee). Keep believing in it, you will learn! Cheers!

You can only commit in your own repositories and you can put in there whatever you want. If you want to contribute to this Github-repo, then you'll have to do a Pull Request (PR). But that is normally not done when it is not solving a problem.

Sorry I'm so busy now, but I'm very interested in improving EC. I'll make some time for it soon. I'll first study what we have now and then make a plan what the best way would be to proceed IMHO. I'd like to do it thoroughly.

Maybe Nicolai ("Elkuku") himself has some ideas about some refactoring too.

elkuku commented 6 years ago

Sorry but this feature isn't supported anymore. Please refer to api.joomla.org instead :wink: