Worst Thing About XenForo?

zappaDPJ

Moderator
Joined
Aug 26, 2010
Messages
8,450
Well one thing that I can think of out the box is a more complex UI needed for all those extra options.
Complex in terms of code for sure but that shouldn't have any noticeable impact on performance. An adminCP is generally just a list of options which most devs fail spectacularly to organise. There's really no need for more options to complicate a UI.

Let take cpanel for example. For some it great while for others it bloated. Why? Because for some (like me) rather use the dns server that their domain provider provides. Another example is email, I rather use a 3rd party mail service for my email needs. Wile I can disable the services on the server, the options are still in the UI, wasting space in the UI.

Some of the servers I help maintain come with cPanel installed. I use it perhaps once a year. It's something I don't need but I still wouldn't call it bloat. In fact from what I've seen of it, it provides a level of functionality ideal for someone without too much technical knowledge who wants to maintain a site.

I'm still of the opinion that one man's bloat is another man's added functionality :)
 

Fillip H.

Developer
Joined
Mar 13, 2006
Messages
205
XenForo actually does dependency tracking between template hooks, template modifications, add-ons. It is why if you edit a single one of those at a time it all works out properly.

The issue is that they explicitly don't track changes on installing an add-on, and instead just force a complete recompile. I think they got burnt by some very early add-ons (either from XF or vB) which inserted and modified the database without going through the in-code channel resulting in an inconsistency.
Honestly, I think it would have been a much better idea to educate people via official documentation rather than cause untold amount of problems for literally every single admin who installs more than 5-10 addons.

DBTech plans to release more than 10 addons before we're done with XF, and we update our mods weekly, so we'll be asking customers to wait for 5+ minutes per mod every week even if they use no other addon provider.

To be honest, I think a better job could be done in terms of documentation for addon devs. Alerts, News, Stats... All of the things that use content types in XF are basically a case of "do a full file search for alert_handler_class and then trace the code back until you find out how to do it". While I've learned how to use those systems, I've still no idea how to use the Deferrer system.
 

Xon

Developer
Joined
Feb 15, 2015
Messages
311
Honestly, I think it would have been a much better idea to educate people via official documentation rather than cause untold amount of problems for literally every single admin who installs more than 5-10 addons.

DBTech plans to release more than 10 addons before we're done with XF, and we update our mods weekly, so we'll be asking customers to wait for 5+ minutes per mod every week even if they use no other addon provider.
I use a highly modified version of Add-on Install & Upgrade add-on which allows multiple add-ons to be installed at once, still too rough for a public release as I need to finish some stuff on it.

Hopefully in a month or two.

To be honest, I think a better job could be done in terms of documentation for addon devs. Alerts, News, Stats... All of the things that use content types in XF are basically a case of "do a full file search for alert_handler_class and then trace the code back until you find out how to do it".
The documentation is lacking due to the fact you insert extension classes basically anywhere. The content type stuff appears to have been tack-welded on quite late in the initial design, and then never documented at all.

Hell, unless you use an add-on there is no GUI to even see them despite how important they are to XF for a developer.

While I've learned how to use those systems, I've still no idea how to use the Deferrer system.
The deferred system is thankfully easy to use, and required if you want to change XenForo Options on install time rather than whatever you configure the defaults to be on the Option configuration.

You need to ensure you inherited from XenForo_Deferred_Abstract, and then use the FULL class name when calling XenForo_Application::defer with an array as the options. In your deferred class's run method, return false for a deferrer task to stop, or an array to be rescheduled at the next deferred execution time.
 

Fillip H.

Developer
Joined
Mar 13, 2006
Messages
205
I use a highly modified version of Add-on Install & Upgrade add-on which allows multiple add-ons to be installed at once, still too rough for a public release as I need to finish some stuff on it.

Hopefully in a month or two.
Will that be featuring custom installation to work around this reparse thing? If so that could be quite interesting, if nothing else to point customers to if they ever complain about long install times.

The documentation is lacking due to the fact you insert extension classes basically anywhere. The content type stuff appears to have been tack-welded on quite late in the initial design, and then never documented at all.

Hell, unless you use an add-on there is no GUI to even see them despite how important they are to XF for a developer.
Haha yeah, I did end up having to install that GUI addon. I also have my own DevTools that lets me export XML files into predefined directories with relative ease.

Since we're (somewhat) on the topic of convenience tools, my development setup would make grown men cry. I have a version control directory outside the web root with each product as a sub-directory and I wrote a Robo.li task file that reads special config files inside each of those subdirectories, and symlinks into vB3, vB4, vB5 and XF1 directories as needed. I then have post-commit hooks that export the new tag into a release directory that our eCommerce system reads from.

I dare you to outdo that level of convolutedness, haha :p

The deferred system is thankfully easy to use, and required if you want to change XenForo Options on install time rather than whatever you configure the defaults to be on the Option configuration.
That's one use case I hadn't considered. In terms of installers, I'd imagine it would be more frequently used as post-install tools. IIRC, vB3/vB4 had a constant you could define to override the default post-install redirect and replace it with a script of your own.

You need to ensure you inherited from XenForo_Deferred_Abstract, and then use the FULL class name when calling XenForo_Application::defer with an array as the options. In your deferred class's run method, return false for a deferrer task to stop, or an array to be rescheduled at the next deferred execution time.
That's pretty useful, thanks!

It's definitely something I'll have to look into soon.
 

Xon

Developer
Joined
Feb 15, 2015
Messages
311
Will that be featuring custom installation to work around this reparse thing? If so that could be quite interesting, if nothing else to point customers to if they ever complain about long install times.
I'm only at the stage of sketching stuff out, I haven't tried prototyping it up yet. I've got front-end work on the add-on installer to finish, and then my other projects.

I've got a few ideas, but it basically means writing my own version to apply add-on XML (templates/admin templates/phrases). Perhaps towards the end of the year if XF2 doesn't come out by then.

Since we're (somewhat) on the topic of convenience tools, my development setup would make grown men cry. I have a version control directory outside the web root with each product as a sub-directory and I wrote a Robo.li task file that reads special config files inside each of those subdirectories, and symlinks into vB3, vB4, vB5 and XF1 directories as needed. I then have post-commit hooks that export the new tag into a release directory that our eCommerce system reads from.

I dare you to outdo that level of convolutedness, haha :p
I do editing on a windows machine (notepad++, and browser tabs) and then have my dev environment a Linux VM.

I've got ~60 add-ons. Each are in thier own gitrepo, and use the pseudo-standard where all the files are packaged under a subfolder 'upload' where I just use winscp to watch a directory and copy any changed files to the VM I'm using. I then export the add-on XML file every so often if I make changes.

Yes, changing multiple add-ons at once is difficult in this system but I try not to have much in the way of overlap for each add-on. And if there is, that just means more instances of winscp to copy files, and more browser tabs to be open :p

It's definitely something I'll have to look into soon.
No problems :)
 

Danielx64

Developer
Joined
Nov 8, 2009
Messages
3,300
I've got ~60 add-ons. Each are in thier own gitrepo, and use the pseudo-standard where all the files are packaged under a subfolder 'upload' where I just use winscp to watch a directory and copy any changed files to the VM I'm using. I then export the add-on XML file every so often if I make changes.

Yes, changing multiple add-ons at once is difficult in this system but I try not to have much in the way of overlap for each add-on. And if there is, that just means more instances of winscp to copy files, and more browser tabs to be open :p
I went to having everything in a VM but I'm thinking of going back to my old setup. Does having to start a VM bother you?
 

Chris D

XenForo Developer
Joined
Aug 23, 2012
Messages
873
I use Vagrant for my dev environment and use winnfs or nfs (depending on whether I'm using Windows or Mac OS X) to share the files from the host to the VM. I don't really use Vagrant properly, but I found a fantastic image which I use called Scotch Box. https://box.scotch.io/. Just need to spin it up and off you go.

The main advantage is the flexibility of being able to install things natively in Linux in a consistent way regardless of whether I'm using Mac or Windows. If I want to use MariaDB? No problem. Upgrading to PHP 7.0 in beta stages was much simpler rather than waiting for the likes of WAMP/MAMP/Bitnami/Zend etc. to add support for it in their own stacks.

It's fairly straight forward to have a VM start when the OS does. I actually don't bother. PhpStorm has various controls that can start and stop and reload the machine:

upload_2016-5-11_12-23-45.png

I usually just go to the menu and hit Up when I start my day.
 

Danielx64

Developer
Joined
Nov 8, 2009
Messages
3,300
phpstorm user here too, does that only work with Vagrant?
I use Vagrant for my dev environment and use winnfs or nfs (depending on whether I'm using Windows or Mac OS X) to share the files from the host to the VM. I don't really use Vagrant properly, but I found a fantastic image which I use called Scotch Box. https://box.scotch.io/. Just need to spin it up and off you go.

The main advantage is the flexibility of being able to install things natively in Linux in a consistent way regardless of whether I'm using Mac or Windows. If I want to use MariaDB? No problem. Upgrading to PHP 7.0 in beta stages was much simpler rather than waiting for the likes of WAMP/MAMP/Bitnami/Zend etc. to add support for it in their own stacks.

It's fairly straight forward to have a VM start when the OS does. I actually don't bother. PhpStorm has various controls that can start and stop and reload the machine:

View attachment 41694

I usually just go to the menu and hit Up when I start my day.
 

Chris D

XenForo Developer
Joined
Aug 23, 2012
Messages
873
Those particular commands only work with Vagrant, but I believe you can configure PhpStorm to run various other command line tools and scripts. If your VM is inside Virtual Box there's a command line tool to manage its VMs. Hence if you just write a start up script (or indeed if you can get PhpStorm to run it) then you can just boot your VM that way.
 

Danielx64

Developer
Joined
Nov 8, 2009
Messages
3,300
Those particular commands only work with Vagrant, but I believe you can configure PhpStorm to run various other command line tools and scripts. If your VM is inside Virtual Box there's a command line tool to manage its VMs. Hence if you just write a start up script (or indeed if you can get PhpStorm to run it) then you can just boot your VM that way.
Thank-you for the heads up, I'm using VMware Workstation 12 Player so I will need to do some homework to see if I can start a VM from a script.
 

Fillip H.

Developer
Joined
Mar 13, 2006
Messages
205
I've got ~60 add-ons. Each are in thier own gitrepo, and use the pseudo-standard where all the files are packaged under a subfolder 'upload' where I just use winscp to watch a directory and copy any changed files to the VM I'm using. I then export the add-on XML file every so often if I make changes.
That's very interesting about using a program to watch a directory for changes.

Yes, changing multiple add-ons at once is difficult in this system but I try not to have much in the way of overlap for each add-on. And if there is, that just means more instances of winscp to copy files, and more browser tabs to be open :p
Semi-related, do you provide free / "Lite" versions for your mods? If so, would you be interested in my DevTools product?
What it does in terms of splitting Lite and Pro is that it lets you mark certain things as Pro only (templates, options, navigation entries, etc), and it'll also strip anything in between special template comments when you click Export Lite. It also lets you set directory paths for the Lite and Pro XML files so that it has a one-click solution for putting the XML files where they belong.

It's not exactly polished and it's got some quirks (you need to manually insert a new record in the xf_dbtech_devtools_product table before you can edit properties) which is why I haven't shared it on XF.com yet, but if you think this might help you then I'd be happy to DM you a copy :)

The main advantage is the flexibility of being able to install things natively in Linux in a consistent way regardless of whether I'm using Mac or Windows. If I want to use MariaDB? No problem. Upgrading to PHP 7.0 in beta stages was much simpler rather than waiting for the likes of WAMP/MAMP/Bitnami/Zend etc. to add support for it in their own stacks.
On a Mac you do have Homebrew, which is/was typically 0-3 days behind new PHP versions. brew install php70 and off we go :D

I dev exclusively on Mac for this reason, didn't want to have to set up a WM. Only problem was, Mac has the same problem with case sensitivity as Windows does; a file named fiLeNamE.php makes file_exists('filename.php') return true. You can't have both fiLeNamE.php and filename.php though. I worked around this by creating a new 20 GB partition with HFS+ Case Sensitive.

I've seen a lot of people use PHPStorm, if we exclude the VM integration, how would you say it compares to a more lightweight editor like Sublime Text 3?
 

Chris D

XenForo Developer
Joined
Aug 23, 2012
Messages
873
I used to pretty much homebrew anything but I often found that when things went wrong, they were more complicated to fix and troubleshoot than if they were in Ubuntu.

This was the primary attraction for using various ready made stacks. Though, sometimes they had problems too.

Moving everything to a VM has meant that problems have been easier to fix, but also if anything does go disastrously wrong I can pretty much just spin up a new machine in seconds.

It's more annoying on Windows than it is on Mac. I sometimes experience latency issues with winnfs on Windows, resulting in their being a second or two delay between saving a file and the changes taking effect. This is quite rare, though, and for the most part changes are synced instantly.

As for PhpStorm, I couldn't use anything else now. I felt like I tried all the major IDEs in the hunt for PhpStorm. nuSphere PhpEd was my second favourite. I only stopped using it because it's Windows only and I prefer to use the same apps regardless of which OS I'm in. I was never a fan of lighter weight editors. I use Atom for informal quick edits, but all my major work is in PhpStorm. I may have tried, for an hour, Sublime. I think the fact that I had to find and install various plugins to make it do IDE type stuff really put me off.

PhpStorm has some pretty cool features. I'm sure you've seen this kind of thing in XF and other frameworks many times:
PHP:
/* @var $pollModel XenForo_Model_Poll */
$pollModel = XenForo_Model::create('XenForo_Model_Poll');
It can be somewhat annoying having to type hint variables created via factory methods so they resolve correctly to the called object, instead of an abstract or base class.

In PhpStorm you can create a .phpstorm.meta.php file which can handle it for you:
PHP:
<?php

namespace PHPSTORM_META
{
   $STATIC_METHOD_TYPES = [
      XenForo_Model::create('') => [
         '' == '@'
        ]
    ]
}

That would now mean you can just do:
PHP:
$pollModel = XenForo_Model::create('XenForo_Model_Poll');

And $pollModel will now by type hinted correctly as XenForo_Model_Poll instead of XenForo_Model.

It's handy, but of course type hinting is mostly still going to be essential unless you really really hate anyone who dares not to use PhpStorm ;)

Aside from all of that, I use PhpStorm as my VCS clients too. XF uses SVN and I have a private GitHub repo for my own stuff. It's great not having a separate client for everything.

As with anything, I probably only use a fraction of what it can do, and I've only really mentioned a fraction of the things I use here. But it's all down to personal preference and I have to say PhpStorm is perfect for me. All of the XF team use PhpStorm, incidentally. Kier and Mike have preferred different IDEs over the years including Zend Studio, Eclipse and IIRC Mike used to have a penchant for good ol' Notepad back in the day... yikes!
 

we_are_borg

Tazmanian
Joined
Jan 25, 2011
Messages
5,964
Is PHPStorm a ide that a novice can use? I thought i could start with my education but there is no budget on my work to do do. I think i need to start with some development for Xenforo. I only need example code to learn to make a fully functional add-on thats beyond my skill set but add-ons that override setting of other addons that should keep me busy.
 

Digital Phoenix

Coffee Ninja
Joined
Sep 6, 2008
Messages
1,785
Is PHPStorm a ide that a novice can use? I thought i could start with my education but there is no budget on my work to do do. I think i need to start with some development for Xenforo. I only need example code to learn to make a fully functional add-on thats beyond my skill set but add-ons that override setting of other addons that should keep me busy.
Phpstorm is free I believe, but if you ever get the funds I'd suggest phpDesigner 8 it's only €29 for a single personal license that allows you to install on 2 devices.
 

Fillip H.

Developer
Joined
Mar 13, 2006
Messages
205
PhpStorm has some pretty cool features. I'm sure you've seen this kind of thing in XF and other frameworks many times:
PHP:
/* @var $pollModel XenForo_Model_Poll */
$pollModel = XenForo_Model::create('XenForo_Model_Poll');
It can be somewhat annoying having to type hint variables created via factory methods so they resolve correctly to the called object, instead of an abstract or base class.

In PhpStorm you can create a .phpstorm.meta.php file which can handle it for you:
PHP:
<?php

namespace PHPSTORM_META
{
   $STATIC_METHOD_TYPES = [
      XenForo_Model::create('') => [
         '' == '@'
        ]
    ]
}

That would now mean you can just do:
PHP:
$pollModel = XenForo_Model::create('XenForo_Model_Poll');

And $pollModel will now by type hinted correctly as XenForo_Model_Poll instead of XenForo_Model.

It's handy, but of course type hinting is mostly still going to be essential unless you really really hate anyone who dares not to use PhpStorm ;)
I have a confession to make; I've never taken advantage of any type hinting ever :p

If I need to look up a function I'll do a full folder search for function foo( or class XenForo_Foo - I'll readily admit this is probably because I haven't really used an IDE or its full capabilities before, but there you go :p

Aside from all of that, I use PhpStorm as my VCS clients too. XF uses SVN and I have a private GitHub repo for my own stuff. It's great not having a separate client for everything.

As with anything, I probably only use a fraction of what it can do, and I've only really mentioned a fraction of the things I use here. But it's all down to personal preference and I have to say PhpStorm is perfect for me. All of the XF team use PhpStorm, incidentally. Kier and Mike have preferred different IDEs over the years including Zend Studio, Eclipse and IIRC Mike used to have a penchant for good ol' Notepad back in the day... yikes!
Haha reminds me of Dreamweaver back when it was still Macromedia, them's were the times :p

I got so used to its syntax highlighting I would only switch to Sublime when I discovered a DW syntax highlighting schema file online.

Phpstorm is free I believe, but if you ever get the funds I'd suggest phpDesigner 8 it's only €29 for a single personal license that allows you to install on 2 devices.
I've just checked, PHPStorm is on a subscription basis.
  • £ 69.00 /1st year
  • £ 55.00 /2nd year
  • £ 41.00 /3rd yr onwards
That is way, way too rich for me sadly :(
 

Digital Phoenix

Coffee Ninja
Joined
Sep 6, 2008
Messages
1,785
I have a confession to make; I've never taken advantage of any type hinting ever :p

If I need to look up a function I'll do a full folder search for function foo( or class XenForo_Foo - I'll readily admit this is probably because I haven't really used an IDE or its full capabilities before, but there you go :p

Haha reminds me of Dreamweaver back when it was still Macromedia, them's were the times :p

I got so used to its syntax highlighting I would only switch to Sublime when I discovered a DW syntax highlighting schema file online.

I've just checked, PHPStorm is on a subscription basis.
  • £ 69.00 /1st year
  • £ 55.00 /2nd year
  • £ 41.00 /3rd yr onwards
That is way, way too rich for me sadly :(
Edit. My bad, was talking about phpDesigner. You should give it a try. Well worth the 29 euros
 

Chris D

XenForo Developer
Joined
Aug 23, 2012
Messages
873
Top