Flourish PHP Unframework
This is an archived copy of the forum for reference purposes


posted by mattsah 7 years ago

Hey all. I've started work in a pretty major rewrite of Flourish. If anyone is interested in helping let me know, or if you just want to follow the progress checkout the GitHub page http://www.github.com/dotink/flourishToo.

Even though flourish 1.0 never got out of Beta, I think given the amount of time and the maturity of it we can take a lot of what we learned from it and start something pretty fresh. Here's a few core ideas behind the project:

1) Keep the API reminiscent of original Flourish 2) Make everything much more object oriented (see the README on the github site) 3) Make things more modular (split out various database support, add support for grammar translations) 4) Break ties to anything less than PHP 5.3

A few examples of where these principles have already been put into place are on the Text class and URL classes. Here's some examples:

$url = new URL();                           // constructs a new URL object from the existing URL
$url = $url->modify(['scheme' => 'https']); // Would replace current scheme with https

$url->redirect('?q=test');                  // would redirect the user to the URL appended with ?q=test

You can see that $url being object oriented acts more like a timestamp, where if you modify it you're returned a new object with the modifications.

Text consumed Grammar, and can be extended to support grammars for different languages:

$text = new Text('This is a long string that will be modified');
$text = $text->underscorize()

It also supports custom domains for compose() which can be used/passed to your callback and used with, say, gettext for easier modularization of translations.

$translation = $text->compose('forums');

You can work with multi-values...

$text        = new Text($items);
$joined_text = $text->pluralize()->join(',', 'or');

$text = $text->inflectOnQuantity('item', '%d items');

Anyway, there's some other ideas I had for objectification in the README. There's probably a few classes I'll do away with and allow others to build as soemthing separate... there's also going to be some different exceptions as well as some likely removed... and more! Follow on github and feel free to open issues there for general discussion.

I like the idea. The fluency of the code examples are very appealing.

Will definitely check it out.

posted by mblarsen 7 years ago

Great job! I'm using the old Flourish on production, and will use Flourish Too in my next project!

Thank's a lot!

But... The original Flourish project are dead? Have anyone working on possible future version?

posted by lucas.snta 7 years ago

Just to clarify, FlourishToo is a project by an engineer (Matt) who works at the company I was previously employed with. I don't currently have any involvement in the project.

Flourish is not dead yet, however I have had less time to work on it in the past year due to getting myself involved with the Sublime Text community. The work that has been done recently was focused around getting the project moved to GitHub (https://github.com/flourishlib) and revising the website (http://new.flourishlib.com) in order to migrate off of the old hosting platform.

The remaining pieces before the cut over involve me completing the automated test harness for GitHub commits, and migrating the current Trac-based forum content to a new forum written in PHP that integrates with GitHub.

I am hoping to be able to spend some time on these soon, but I am still a little overloaded with lingering side-projects and the ever present Sublime Text work, so I don't have a firm date.

posted by wbond 7 years ago

I understand perfectly, including I think that Flourish need more support from community, and this project is very unknown to many PHP developers around the world!

I love Flourish, I was searching for a "little framework" without MVC implementation and founded this excellent libraly, that is perfect for my projects.

I will try to spread Brazilian PHP developers about this excellent Framework, and create some articles to get some possible's contributors.

Thank's a lot!

Sorry for my bad english!

posted by lucas.snta 7 years ago

Apologies if I was not clear that this is not something that is "official" to Flourish. It's mostly to support my moving forward with my framework which has come to rely on Flourish as its core. Although I have issues with PHP namespacing, wanting to keep up with the community, I decided it was time to embrace namespacing, but also I'm trying to remove static dependencies, which standard Flourish adds a lot of.

That said, I do not suggest anyone use FlourishToo at the moment for their next project unless they wish to dedicate a large portion of their next project's time to developing FlourishToo itself :P.

Not all classes have been ported/refactored at the moment, and unless you're using Flourish for pretty basic stuff avoiding completely the ORM and ActiveRecord, it probably wouldn't be much use and would just cause confusion/problems. Furthermore, although the API is reminiscent of normal Flourish, obviously the move away from static stuff changes the fundamental principles of the API. Method names and arguments are often similar or exactly the same, but there is no API or even overall usage documentation on what I've written yet.

That being said. I encourage anyone interested in contributing to fork it on github and offer pull requests if they believe they understand the intentions of the project. The work of "modernizing" and "objectifying" Flourish is not terribly demanding mentally, but it's tedious.

posted by mattsah 7 years ago