Welcome Guest, Not a member yet? Register   Sign In
DMZ 1.7.1 (DataMapper OverZealous Edition)

[eluser]OverZealous[/eluser]
Important News Regarding DataMapper OverZealous Edition

Hello everyone,

As many of you might have noticed, I have not updated DMZ in quite some time (late March, in fact). This has been mostly due to the fact that since then, I have been working full time at a new job, in a different state. I really have not had a lot of time, and even if I did, I have been working off a small laptop.

Moving On...
In the last couple of weeks, I have started learning about Groovy and Grails, a dynamic scripting language built on top of the Java Virtual Machine, and a rapid web application development platform, respectively. In reading about these tools, I have found excitement in developing that I have not had in some time.

This platform provides nearly all of the rapid-development potential of CodeIgniter, as well as the ability to write well-defined, strongly-typed code when needed. It also has a large library of plugins, and many features that require a lot of hand-work to enable in CI. Maybe most importantly, it has a very powerful ORM built-in, one that not only does everything that DMZ does, and more gracefully, but is significantly more flexible and can even build and update your database on-the-fly, based on the models. There are so many features in Grails/GORM I always wanted to add to DMZ, but I never really found the time.

Many of my frustrations with CodeIgniter, such as the numerous bugs in the ActiveRecord library, poorly designed Session library, lack of built-in GET support, and various other issues, seem to be resolved in the Grails setup. This is probably because it is backed by frameworks that have been around for a while now, such as J2EE, Spring, and Hibernate.

For many of you, this may not be very interesting. Because I run my own servers, I have the ability to install Java and a servlet engine as needed. However, if you rely on a shared hosting plan, you will most likely not be able to use Java. In fact, this was the very reason I started working with PHP and CodeIgniter in the first place. (On that note: SliceHost is a great, low-cost way to get your own servers running.)

DMZ Can Live On!
What does this mean for DMZ? In short, I'm looking to hand the reins over to someone else. I haven't used or worked on the library since late May. It's already going stale, with numerous outstanding bugs that I have no plans to correct.

Because DMZ is 100% open source, you don't have to contact me if you don't want. However, I have extra materials and tools that I can pass on to anyone who'd like to make DMZ their own.

Please be aware that this is a large library, with a lot of complex code underneath. It requires a pretty strong understanding of PHP's magic functions (__get, __call), database design and management, and memory usage. It also requires a bit of dedication, since the relatively small community around DMZ is highly active.

I really hope someone comes forward, and is willing to let DMZ live on. (When I stopped working on the HTMLForm library I asked for a volunteer, but no one offered, and it has effectively died out for that reason.)

-----

So, please, if you are interested, I'll happily ZIP up all of the content I have for DMZ, and send it over. I'll eventually be replacing the current DMZ URL with links to anyone who would like to host the manual and downloads. (Please note, the current downloads are hard-coded in the manual to my website. If you do decide to host it, a search-and-replace will probably be in order.) If no one comes forward, I'll upload the latest version to the CodeIgniter wiki, so it can still be downloaded.

Thank You,

[eluser]someoneinomaha[/eluser]
Sorry to hear this, Phil, but I completely understand.

Thanks for all the hard work you put into the library. Hopefully someone will be willing to take it on for you. I wish I had the time/php experience to do it.

[eluser]tdktank59[/eluser]
[quote author="OverZealous" date="1286769474"]
So, please, if you are interested, I'll happily ZIP up all of the content I have for DMZ, and send it over. I'll eventually be replacing the current DMZ URL with links to anyone who would like to host the manual and downloads. (Please note, the current downloads are hard-coded in the manual to my website. If you do decide to host it, a search-and-replace will probably be in order.) If no one comes forward, I'll upload the latest version to the CodeIgniter wiki, so it can still be downloaded.

Thank You,[/quote]

Not sure if ill have the time, but I plan to dive into some projects revolving around DMZ. I would be more than happy to host it, maybe get it going in a open svn where people can add their fixes as they find it.

I know there is a huge learning curve to maintaining this library so it may take some time.

Maybe there will be someone else that is more familiar or has the time. I can at least hold it out until that time happens.

Let me know

[eluser]alaminx[/eluser]
how do I use firephp in the model ???

[eluser]The Hamburgler[/eluser]
Oh noes!

Thanks for all your work Phil, I have been using DMZ on a number of sites for the last year. I must admit, I thought the lack of recent updates was due to the fact that its was so stable!

I've been using DMZ in a CI CMS i've been developing and it works like a champ. I'm working on documentation right now so i can Open Source it. Pretty busy getting married at the mo so might not happen to soon!

I set up a GitHub repo for DMZ a while back http://github.com/th3hamburgler/Datamapper-DMZ If anyone has any fixes we can use this repo. Get in touch with a DM or through GitHub if anyone has any.

I'm not looking to take complete responsibility for DMZ as I can't commit the time. An open Repo of some kind seems to make the most sense to keep this project going.

[eluser]tdktank59[/eluser]
[quote author="The Hamburgler" date="1286983069"]I'm not looking to take complete responsibility for DMZ as I can't commit the time. An open Repo of some kind seems to make the most sense to keep this project going.[/quote]

I agree, we could setup some "leaders" but have an open project would be pretty cool.

[eluser]WanWizard[/eluser]
I wonder if that's going to work, given the complexity of DMZ, and the importance it has in an application.

I think it needs the same strict rules that are applied to CI when it comes to modifications and additions, stability is paramount for an ORM solution.

[eluser]defeed[/eluser]
Hello, I'm quite new to CI and MVC in general, so I'd be very thankful if anyone could show me how to do one thing with DataMapper. When I read the DM manual, everything seemed quite clear for me, but I kinda stuck after that when it came to many-to-many table relationships.

Basically I want to make a simple movie catalog, which lists all movies, movies by certain criteria and shows movie details.

The problem is that I use many-to-many relationship and I don't know how to output data from movie's related tables, like genres, directors and actors. To make it simple, let's just use movies and genres tables. Movie can have many genres, and genre can belong to many movies. I've setup the database, so there is 'movie' table, 'genre' table and the join table with 'id', 'genre_id' and 'movie_id' fields.
The 'movie' model looks like this:
Code:
class Movie extends DataMapper {

    var $has_many = array('genre');

    function __construct()
    {
        parent::__construct();
    }
}

And this is 'genre' model:
Code:
class Genre extends DataMapper {

    var $has_many = array("movie");

    function __construct()
    {
        parent::__construct();
    }
}

So, my question is how to correctly fetch movie information and all it's genres in a controller and to pass this data to a view?

[eluser]WanWizard[/eluser]
Starting from a movie, something like
Code:
// get movie with ID 1, then get all genres
$movies = new Movie();
$movies->get_by_id( 1 );
$movies->genre->get();

// add it to the data array for the view
$data['movie'] = $movies;

// load the view
$this->load->view('myview', $data);

Then, in the view, something like
Code:
<b>Movie title: &lt;?php  echo $movie->title ?&gt;</b><br />
<b>Genres:<b/><br />
&lt;?php foreach( $movie->genre as $genre ) {
   echo $genre->name;
}?&gt;

[eluser]defeed[/eluser]
Oh, that was very simple, thank you!




Theme © iAndrew 2016 - Forum software by © MyBB