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

[eluser]Mareshal[/eluser]
I just cloned the CI from bitbucket, copied the example from archive into /system overwriting everything Smile

download my code from here:
Code:
http://dl.transfer.ro/em-transfer_RO-17mar-86edf3.rar
#22

[eluser]OverZealous[/eluser]
[quote author="TheJim" date="1268878525"]
To offer an alternative to what Phil said, I believe the problem is that you're loading the class via CI's Loader, which calls _assign_libraries. If you follow the DMZ way of not calling load->model and just do a "new Whatever()" you shouldn't run into that problem.[/quote]

Good call. I actually didn't know that CodeIgniter calls _assign_libraries on models.

I'll have to think about what to do. It's actually kinda bad to use Loader::model(), since DMZ specifically says don't do it.

I might rename _assign_libraries (like, _assign_libraries_private), then use the original method to throw an error when models get loaded manually. This will prevent DMZ models from being loaded by CI.

Or, I could just let CI load the model, but there's no telling if that would be a problem or not.

I'll think about it.
#23

[eluser]hidechron[/eluser]
Just updated to 1.7 and I apparently have that same error. Sad

ok found out why, I don't need to load models at all !

Not in autoload, neither in the controller. It work with magic.
#24

[eluser]Mareshal[/eluser]
OverZealous, did you download my archive?
#25

[eluser]OverZealous[/eluser]
@Mareshal
I don't know what to tell you. It's not DMZ — there's no parse errors with the source for the admin.php file. It hasn't been changed since 8/25/2009 (I can see it in the repository).

I just double-checked the ZIP, too, it's OK there.

Maybe that file is corrupted on your copy?
#26

[eluser]OverZealous[/eluser]
FOR ALL THOSE WITH THE _assign_libraries ERROR

Remove all the models from autoload, just as it says in the installation manual.

Double-checking your installation is the first step in the troubleshooting document.
#27

[eluser]Mareshal[/eluser]
I just tried everything from scratch, same error. I am using xampp with PHP 5.3.2
#28

[eluser]OverZealous[/eluser]
@Mareshal
Well, did you try to run the admin.php file through PHP lint (-l)?

Did you check to see if the file was corrupt?

Also, why are you using the CI from bitbucket? Are you sure it is an official version? The latest version of CI is 1.7.2. You might have issues with running a pre-release or dev version of CI.

I can't help you much more. You've basically said "I've installed it, it doesn't work." But it does work. The example app is my main testing ground for DMZ. I run it all the time. Is it configured correctly?

I think the example app still uses short tags, since I prefer them. Maybe you need to enable short tags.

I can't help beyond that. Feel free to update if you figure out what the problem is.
#29

[eluser]Mareshal[/eluser]
Don't know why and how but works. Short Tags were On, because when I install xampp I make my own config.

But I really don't get something. On this page: http://www.overzealous.com/dmz/pages/update.html

this query:
Code:
// Mark all users as new
$user = new User();
$success = $user->update('isnew', TRUE);

Produces this: UPDATE `users` SET `isnew` = TRUE

How does DMZ know which talbe to update? or where do you tell the script to update the table I want?

Or maybe I don't understand how datamappers work.

Edit: I think I understood now. Every table has a related model, where tables are declared. Am I right?
#30

[eluser]Jack Scott[/eluser]
Regarding my previous post:

My app's loading models using CI->load->model(), I guess that's my bad. CI's load->model() calls _assign_libraries() on the loaded model, which causes the fatal error.

My app's running under Expression Engine 2.0, which sits on top of CodeIgniter. I'm guessing EE uses an early version of CI version 2; it allows addons to be packaged into a third party directory and supports include paths for libraries and models which DataMapper's autoload() doesn't know about. That's why the app needed its models manually loaded through CI, DataMapper couldn't find 'em. I have a patch to autoload() that reads the CI include path, I'll post it if you like.

While debugging the patch, I noticed autoload() fires each time ExpressionEngine loads ones of its modules or plugins. I'm not sure if that's a good thing, it could cause a problem if a plugin and model share the same name.

is it worth considering letting CI load DataMapper models? I never noticed a problem with CI-loaded models under DataMapper 1.6.2 or earlier versions, and I've been working on this app for several months. Letting CI handle loading is less likely to trip up CI users new to DataMapper, and might save some problems in the future as CI grows. I like your idea of renaming _assign_libraries() to _assign_libraries_private(), that should allow models to autoload or let them load through CI.




Theme © iAndrew 2016 - Forum software by © MyBB