XenForo 2.0 Discussion

Status
Not open for further replies.
The max length of the title fields in the phrase tables was 75 so when you're programmatically creating phrases for something that needs a title that should contain a prefix, permission ID and a permission group ID then limiting those IDs to 25 each is reasonable.

There's room to increase them a bit now because the phrase title limit is 100. But we might not. I have to say that "annoying" is a strong word. Just use a shorter or abbreviated ID, it's quite an easy thing to workaround.
 
Really the move to 5.4 was a no brainer.

Although small, using the shorter array syntax is cool:
PHP:
$viewParams = [
    'forum' => $forum
];
vs.
PHP:
$viewParams = array(
    'forum' => $forum
);

Function array dereferencing has been useful:
PHP:
if ($this->getSomething()['thing'])
{
    // do stuff
}
vs.
PHP:
$something = $this->getSomething();
if ($something['thing'])
{
    // do stuff
}

But I think the main thing for us was being able to use '$this' inside closures:
PHP:
$f = function() use($key)
{
    $value = $this->get($key);
}
vs.
PHP:
$t = $this;
$f = function() use ($t, $key)
{
    $value = $t->get($key);
}

There's some nice stuff in 5.5, 5.6 and 7 but the above stuff was compelling enough itself to make the jump to 5.4.

Side note, my favourite thing about PHP 7 so far is the null coalesce operator:
PHP:
$value = $foo['bar']  ?? 'no value';
vs.
PHP:
$value = isset($foo['bar']) ? $foo['bar'] : 'no_value';

I think xenforo 2 will use now anonymous functions and the structure will like laravel 5.It would be great if we can see a code example from xenforo 2.
 
Certainly anonymous functions have their use cases in XF 2.0. Though my previous post demonstrated that - closures supporting $this in PHP 5.4 was a good reason for us to up the requirement from 5.3.

At this stage, although there's plenty of it, I feel that any code would likely only lead to more questions that we're not yet ready to give the answers to.

It's worth waiting for.
 
At this stage, although there's plenty of it, I feel that any code would likely only lead to more questions that we're not yet ready to give the answers to.
That said, if you can answer at this point, will SQL queries see huge changes? I'm working on an add-on which I did from scratch in Laravel 5 in hours, which is taking days in XenForo. I mean, I'm not experienced in Laravel either so part of the hours was flipping through their docs. Talking about docs, will we see some developer docs with XF2? If you haven't considered the idea already, grabbing Eloquent from Laravel 5 might be a neat idea. It's a nice ORM for database interaction. Lots of things in XF1 that make it longer to make something, and more confusing tbh. At times, puts me off a lot and I end up being too lazy to do some work.
 
We're not bringing in any database related libraries as it stands at the moment. Bearing in mind a fair amount of database interaction was previously driven by Zend Framework it's good to see these now being more flexible and in our own control. And this has enabled us to build a query builder object as mentioned by Mike here:

While you can still write SQL directly, most data access is done through a builder object. The builder can control what related data is fetched, what conditions are applied (including against related data) and the order of the results. This can be done in any order.

I can't really say too much more about this but I expect it will tick your boxes.

Of course you will be able to do things the old fashioned way and write queries and fetch data in the same way as before and there are even valid use cases for this, but for the most part queries can be done using the builder.
 
We all can't wait for it. For "just vB developers" -however- it will be an even much bigger step for sure. Which was asked for. ;)
 
Will it be possible in 2.0 to re-order custom field choices?

For example, in Showcase (or any other addon or part of XF that does this) I add a custom field with multiple pulldown options... and if I forget a choice and add it later there's no way to alphabetize the pulldown menu or check mark choices because it is stored in a multi dimensional array that is serialized.

Will this be a problem that is fixed in 2.0 by storing the choices in individual records?
 
hello guys . There is't any demo or screen shots ?
@Chris D
when your legendary project will release ? if you don't know just ( Guess ) ;) :D
Thanks a lot .. i wait for buy XF 2.0 :-*
 
Status
Not open for further replies.
Back
Top Bottom