DMZ 1.7.1 (DataMapper OverZealous Edition) |
[eluser]Frank Liu[/eluser]
[quote author="OverZealous" date="1269045695"][quote author="Frank Liu" date="1269039113"]DMZ's main library file contains spl_auto_load function, which is not supported until PHP 5.1.2. So you may want to change server requirement to reflect this? Anyway, can I just remove the spl_auto_load statement and find another way to load the files? Do you have a recommended way to deal with this problem? I am using php 5.0.0.[/quote] I did not realize that (I've thankfully never had to deal with PHP older than 5.2, because I use the JSON functions a lot!) I'll take your suggestion and bump the requirements up to 5.1.2. As for a work-around, all the spl function is doing is loading the models in as they are needed. I know I "broke" the ability to load models via CI (which will be remedied with 1.7.1), but you can temporarily fix that by removing the private in front of the _assign_libraries function in the main library. It's near the bottom. Another option is to write your own helper or library, or even extension to DMZ that allows you to load the models in as needed. Sorry to hear about your work environment! ![]() This is just to provide a small closure on this matter. So if you are using an older version of PHP that does not support spl_autoload_register, then you can do the following: In any of your config files, say config/autoload.php, append the following: Code: function __autoload($class_name) { Next comment out the line that uses the spl_autoload_register function in your libraries/datamapper.php file. This hack works for me.
[eluser]OverZealous[/eluser]
@Frank Liu Wow, that's great! Thanks for the research. I added a link back to your post on the System Requirements page so that others can find this if they need to. Hopefully you will be able to upgrade your PHP soon, though!
[eluser]PoetaWD[/eluser]
Hey Phill, I have something to show you that I cant send in this forum. Is there a email where I can send you a message ? Thanks
[eluser]OverZealous[/eluser]
@Poetawd It's on the troubleshooting page of the manual, in the first gray box. (I don't want to publish it on a public forum, obviously.)
[eluser]OverZealous[/eluser]
Code Theft I feel the need to write this. I've been contacted by several individuals—in just the last few weeks—who have felt the need to share their pride in copying source code from proprietary and non-free applications. This is an incredibly misinformed view of the world. Rationalizing this by saying you are just learning, or something similar, does not take away from the fact that: 1) It is completely unnecessary. There is a huge wealth of legally free software, with 100% visible source code to look at. 2) It damages the entire software industry. I assume that the majority of people who use CodeIgniter are in the software industry. When you take from someone else's hard work, and redistribute it against their will, you are stealing from that person or company. 3) You don't learn by doing things right the first time. You learn by making mistakes. This is the point of going to class, of practicing, of any skilled trade. I don't know how to write code because I saw it written correctly once before—I know how to write code correctly because I've written a lot of messed up crap that I had to rewrite many times. 4) The saddest thing is when you do this, and then brag about it to a person who writes software for a living, that's like going to an independent film director and bragging about how you download all your favorite movies from bittorrent. That's really nice. Why don't you spit in their face, too? Please, if you are trying to learn something, look at the open-source community. Don't steal closed-source code. Just because you can decrypt PHP and JavaScript, doesn't mean you should. And don't steal FOSS code either! Attribute it, follow the licenses as provided, and be respectful of other software developers. As this isn't the correct forum to discuss this, if you have a response to this message, we can continue the discussion here.
[eluser]Frank Liu[/eluser]
So more Oracle woes... turns out whenever one tries to do a $o->save() that uses an insert, datamapper needs the following: Quote:// around line 1700 in libraries/datamapper.php Since the oci8 driver does not support this (Oracle doesn't support auto incrementing keys), this would raise an error. To fix this put this around the same area: Quote:$query = $this->db->query("select {$this->table}_SQ.NEXTVAL ID FROM DUAL"); Note that here we assume, for each table that one creates, there's a corresponding sequence with the name ($table_name}_SQ. In addition, make sure that your oci8_result.php also contain the following code: Quote:function field_data() Generally, to make sure oci8 works properly, one really needs to change the driver to convert field names to lowercased. I wrote a separate thread in this forum somewhere else that contain some of those fixes. Anyway, did I mention I hate Oracle?
[eluser]OverZealous[/eluser]
@Frank Liu Wow. I love PostgreSQL more every day ;-P I'm glad you solved these problems. I'm pretty sure there's no way to integrate this into DMZ in a non-problematic manner. :-S If you don't mind posting the link to the other thread, though, I'll add a link to it to the DMZ docs. Edit: Corrected poorly written sentence.
[eluser]Frank Liu[/eluser]
[quote author="OverZealous" date="1269417217"]@Frank Liu Wow. I love PostgreSQL more every day ;-P I'm glad you solved these problems. I'm pretty sure there's no way to integrate this into DMZ in a non-problematic manner. :-S If you don't mind posting the link to the other thread, though, I'll add a link to it to the DMZ docs. Edit: Corrected poorly written sentence.[/quote] Here's the link to the other thread. But these are just hacks; one should be careful about using them. Too bad I don't know CI well enough to write a library. And it seems that CI is written in a way that is difficult to extend the database drivers.
[eluser]OverZealous[/eluser]
[quote author="Frank Liu" date="1269419184"]And it seems that CI is written in a way that is difficult to extend the database drivers.[/quote] That is, sadly, the biggest problem I have with CI. If I could override them, I could easily fix all of my issues with _protect_identifiers. I rather hate editing the core CI files directly. One thing: if you are only modifying the Oracle drivers (and not CI_DB, CI_DB_driver, or CI_DB_activerecord), you could try to copy the oracle drivers and give them a new name. At least this way, upgrading CI wouldn't override your customizations. It's probably not worth the renaming effort, though.
[eluser]Frank Liu[/eluser]
[quote author="OverZealous" date="1269419763"][quote author="Frank Liu" date="1269419184"]And it seems that CI is written in a way that is difficult to extend the database drivers.[/quote] That is, sadly, the biggest problem I have with CI. If I could override them, I could easily fix all of my issues with _protect_identifiers. I rather hate editing the core CI files directly. One thing: if you are only modifying the Oracle drivers (and not CI_DB, CI_DB_driver, or CI_DB_activerecord), you could try to copy the oracle drivers and give them a new name. At least this way, upgrading CI wouldn't override your customizations. It's probably not worth the renaming effort, though.[/quote] The problem is as far as I know, you do have to change the DB_active_rec.php file. The update and insert query executes a compiled string. This is not enough to properly deal with clob objects. |
Welcome Guest, Not a member yet? Register Sign In |