akeeba / fof

Rapid Application Development framework for Joomla!™ 3 and 4
0 stars 0 forks source link

Install instructions in readme #693

Closed eddyparkinson closed 3 years ago

eddyparkinson commented 3 years ago

I am struggling to find install instructions - would be handy if the readme had install instructions.

Looks like the wiki download link is outdated https://github.com/photodude/FOF3-Basic I think it should link to https://www.akeeba.com/download.html

A google search brings up these old instructions for FoF Version 2.5.4 https://www.butterfly.com.au/blog/website-development/fof-rapid-application-development-framework-for-joomla

nikosdion commented 3 years ago

The link you posted is not a download link in our Wiki, it's a link to a third party tutorial about getting started with FOF 3. It's not a download link by any means. He links to our site where you can find the download page. As you said, the latest published version of FOF 3 can always be found at https://www.akeeba.com/download.html

If you want to distribute FOF 3 with your extension please DO NOT include it directly in your package's XML file. It won't work properly. We have migrated FOF 3 to a files package so that we can tell Joomla to not downgrade FOF i.e. prevent it from installing an older version on top of a new one. You will need to use this installation script making sure that you include the latest published FOF 3 version named exactly as lib_fof30.zip in your package's ZIP file.

eddyparkinson commented 3 years ago

Thanks for the update - I have it running now with the timesheet example.

example FOF component An up to date example of a component would also help. com_timesheet produces "Array to string conversion" warnings with the sort in http://doc.joomladev.eu/api33/FrameworkOnFramework/utils/FOFUtilsArray.html#sortObjects

prevent it from installing an older version on top of a new one

this was fine - looks well documented - even Joomla installer gave an warning not to delete the old version.

nikosdion commented 3 years ago

Wait, are you using FOF 3 or FOF 2?

FOF 3 is using PHP namespaces (FOF30\*), it was first released in 2015 and is actively maintained.

FOF 2 is not using PHP namespaces, it uses prefixed class (FOF*), it was released in 2012 and we stopped maintaining it in June 2016.

The FOFUtilsArray class belongs to FOF 2. So you seem to be using FOF 2 after all.

If you are using FOF 2 for your extension:

eddyparkinson commented 3 years ago

FOF 3 or FOF 2?

Maybe https://github.com/tuum/com_timesheet uses fof 2

Version I am using

libraries/f0f libraries/fof libraries/fof30

all exist in my joomla install.

example FOF component

I did not find any up-to-date examples of FOF components when I looked around - an up-to-date example would be handy. As I said above.

nikosdion commented 3 years ago

Looking at your GitHub profile I get the idea that you are a JavaScript developer, not a PHP or Joomla developer. So I'll try to explain things which are kinda obvious to backend developers since you're very likely unfamiliar with the code organisation and tooling we tend to use. I've been on the opposite side, trying to figure out frontend tooling and code and nobody was willing to explain anything to me which was rather frustrating.

If you look at the repository you linked me to, it's using FOF 2. There are several dead giveaways:

So, the component is using FOF 2. In fact, it is using the fork I had made with classes prefixed with F0F (F-zero-F) and installed in libraries/f0f. I have already explained why. That's something you couldn't have possibly known.

I already said before that FOF 2 is end of life since 2016. In fact, I have made it quite obvious to anyone looking in this repository. The 2.x branch greets you with a very in-your-face message that it's EOL since June 2016. I had to add this in 2017 after people kept asking me to support newer PHP versions in a framework version I had stopped working on for 2 years and marked end of life a year prior.

Further to that, I have already told you that the best example of a real world, FOF powered component is Akeeba Subscriptions. The same information can be found at the top of the very first page (home) of the documentation Wiki :) The Akeeba Subs repo has several branches using different versions of FOF. After all, it's in continuous development since 2011. The 4.x branch is based on FOF 2. Yes, the code there dates back to 2015 – but you're talking about a version of the framework that went EOL shortly after. Newer branches (6.x and development) use FOF 3.

The problem is that Akeeba Subscriptions is a real world, complex component and may be overwhelming to dive into. A more realistic, simple component using FOF 3 is Contact Us.

Another straightforward FOF 3 component is Akeeba DataCompliance. The complicated stuff handling third party / core Joomla data is in the plugins. It's OK if they are not easy to understand. The front- and backend are far more straightforward.

A further example is Akeeba Release System. The caveat is that this component started out as a core Joomla MVC one. It got converted to FOF but I didn't change the database schema. As a result the names of the database fields are not what FOF expects and I had to tell the Models about that. I think that serves as a good example of how versatile FOF is, especially when you are converting legacy code.

My final example would be Akeeba Engage, a comments component. This is much more advanced. The front-end part of the component is not rendered on its own component pages but on Joomla's com_content pages by using a content plugin. This is a good example of how you can use FOF to extend Joomla's core articles component (com_content) beyond what is possible with custom fields, without expending too much effort. Start to finish, the comments component took me a month and that includes a false start about the data model – I had to do some benchmarking with real-world-shaped data to discover a performance bottleneck in the original implementation.

I do have a word of caution. Writing your own components is very rewarding as it is frustrating to get started. There is a very steep learning curve and there's a very steep implementation curve. I would recommend starting off by forking an existing component, such as Contact Us, and implement small features you come up with. This will get you a good lay of the land, so to speak. Once you're comfortable modifying code you can start writing your own. Start simple and keep adding to your code base. Good luck and have fun!