Discussion:
[mantisbt-dev] Frameworks
Elier Delgado
2014-12-13 03:15:44 UTC
Permalink
Hello all,

First at all, I want to thank you for your great contribution. You can feel
good because many people are thankful for having Mantis.
I was happy to introduced it in several places :)

I recently had to go through the code debugging an issue and I was
wondering if you ever have think on porting progressively Mantis into any
framework?

Regards, Elier
Damien Regad
2014-12-14 21:21:38 UTC
Permalink
Post by Elier Delgado
I recently had to go through the code debugging an issue and I was
wondering if you ever have think on porting progressively Mantis into
any framework?
Not that I know of.

D
Elier Delgado
2014-12-20 18:56:17 UTC
Permalink
Re: [mantisbt-dev] Frameworks
Post by Elier Delgado
I recently had to go through the code debugging an issue and I was
wondering if you ever have think on porting progressively Mantis into
any framework?
Not that I know of.
D
Thanks Damien,

I did some tests with symfony2 and I was able to generate several CRUD in a
few hours. I used a very nice bootstrap theme, so the UI is different but
great, mobile friendly etc.
Here what I have working so far:
- User CRUD, login, logout
- Project CRUD
- Tag CRUD
- Custom fields CRUD

I think it is an interesting result that can help to revamp the system with
an affordable effort.
It could create the base to make more easy and standard to developers add
new features.

With a good and popular framework, Mantis could become the open source
equivalent to JIRA.

What the community think?

Regards, Elier
Hello all,
First at all, I want to thank you for your great contribution. You can
feel good because many people are thankful for having Mantis.
I was happy to introduced it in several places :)
I recently had to go through the code debugging an issue and I was
wondering if you ever have think on porting progressively Mantis into any
framework?
Regards, Elier
Thomas Koch
2014-12-28 08:11:24 UTC
Permalink
Post by Elier Delgado
I did some tests with symfony2 and I was able to generate several CRUD in a
few hours
We've ported a legacy PHP non-MVC application to Symfony last year step by

step without downtime. Our strategy was:

a) Move all files in the standard Symfony folders app/,src/, web/
b) autogenerate Symfony Routes for all PHP files that were formerly
entered
directly:

$collection = new RouteCollection();

$finder = (new Finder())->in($this->dir)->files()->name('*.php');
foreach($finder as $phpFile) {
$collection->add(
$this->buildNameFor($phpFile),
$this->buildRouteFor($phpFile)
);
}
return $collection;

c) Add a default controller for all legacy PHP files:

class LegacyRoutesController extends Controller {

private static $redirect = null;

public function defaultAction($_route, $_legacyPath)
{
ob_start();
$ret = require $_legacyPath;
$out = ob_get_contents();
ob_end_clean();

if($ret instanceof Response) return $ret;

if(self::$redirect) return $this->redirect(self::$redirect);

return new Response($out);
}

d) The old PHP files now have access to $this and thus can use Symfony
services like template engine (twig), form handlers, request, response
objects, database (doctrine), email (swiftmailer)

e) Replace old PHP files with MVC controllers step by step

...

z) (Port to Java Spring...)
Elier Delgado
2015-01-23 02:12:45 UTC
Permalink
Hello Thomas, thanks for sharing.

I have made public what I did so anyone can contribute.
What you did can be very useful.

https://github.com/elier/mantis5

Thanks, Elier
Post by Thomas Koch
Post by Elier Delgado
I did some tests with symfony2 and I was able to generate several CRUD in a
few hours
We've ported a legacy PHP non-MVC application to Symfony last year step by
a) Move all files in the standard Symfony folders app/,src/, web/
b) autogenerate Symfony Routes for all PHP files that were formerly
entered
$collection = new RouteCollection();
$finder = (new Finder())->in($this->dir)->files()->name('*.php');
foreach($finder as $phpFile) {
$collection->add(
$this->buildNameFor($phpFile),
$this->buildRouteFor($phpFile)
);
}
return $collection;
class LegacyRoutesController extends Controller {
private static $redirect = null;
public function defaultAction($_route, $_legacyPath)
{
ob_start();
$ret = require $_legacyPath;
$out = ob_get_contents();
ob_end_clean();
if($ret instanceof Response) return $ret;
if(self::$redirect) return $this->redirect(self::$redirect);
return new Response($out);
}
d) The old PHP files now have access to $this and thus can use Symfony
services like template engine (twig), form handlers, request, response
objects, database (doctrine), email (swiftmailer)
e) Replace old PHP files with MVC controllers step by step
...
z) (Port to Java Spring...)
Thomas Koch
2015-01-23 08:42:56 UTC
Permalink
Post by Elier Delgado
Hello Thomas, thanks for sharing.
I have made public what I did so anyone can contribute.
What you did can be very useful.
https://github.com/elier/mantis5
Thanks, Elier
http://www.ben-morris.com/why-refactoring-code-is-almost-always-better-than-rewriting-it

http://www.joelonsoftware.com/articles/fog0000000069.html

Hi Elier,

it's nice that you're interested in a symfony-based Mantis. So am I.

However I'm afraid that developing a second Mantis in parallel will certainly
not be succesful. (And I wouldn't do it in PHP, in that case...)

But there would be a lot of potential in a gradual refactoring of
Mantis towards a Symfony based architecture. This requires
an agreement of all core devs.

Developing in parallel means:

- Confusion of users
- additional effort to maintain two code bases
- less users for the new system -> less bug reports / feedback
- no continuous refactoring and compatibility testing of the many
and useful mantis plugins and 3rd-party integrations
(The biggest plus of Mantis nowadays is its maturity, plugins and
integrations. - Not its clean code base...)

Regards,

Thomas Koch

Damien Regad
2014-12-29 22:58:20 UTC
Permalink
Although it's not exactly what you're referring to, I just thought I'd
mention that we do have plans to revamp the Mantis UI using bootstrap,
see https://github.com/mantisbt/mantisbt/pull/272
Continue reading on narkive:
Loading...