Firstly, let me thank all of you volunteers who are in this forum, this is such an amazing and underrated framework!
I've got an architecture question which has been bugging me for a small while here.
Recently, I have been working on a huge (work) project which uses the N-Tier architecture, and I am now confused on its DTO and DAO aspect within CI.
For those unfamiliar with the ntier architecture, here is a quick summary of both those terms.
A DTO, which stands for Data Transfer Object, is what should be returned by the models.
It does not contain accès to the database, as this logic is in the DAO.
A DAO, which stands for Data Access Object, which is whatever method you use to access your data.
In my case, I'm trying to port my user login to such an architecture, with typed data.
In CodeIgniter, I would call my users model and use a method such as getUserFromId($id), where the model would act as DAO and return a DTO.
As I'm working towards having a lot of abstraction, here is how I currently planned on structuring my folders:
As you can see, this doesn't seem very clean.
It feels wrong to have the DTO folder inside the Models folders, yet I can't seem to find a better place.
In a usual project, I would have both a DTO and DAO folder but there does not seem to be such a predefined folder in CI.
Perhaps I should create it, but I preferred asking here first
Update: While writing this post, I've had a quick look in newmythmedia's blog and it seem Entities would solve my problems.
Leaving this question up if I'm mistaken
On an unrelated note, here are few other questions not worthy of a post themselves I'd like to ask:
- Are there any medium-big open-sourced projects using CI?
I'd like to navigate into the architecture of decently-sized projects for inspiration.
- CI4: While I only had a quick glance over the proposed changes, would you recommend waiting for CI4 until making an architecture revamp (which would take few months) or waiting until it is out before attempting this change?
Hi, this is my fist time in the forum, sorry for my bad english. I have been using Codeigniter for last 4 years and have make a lot of libraries for my own, so i want to share some service i publish today.
-Crypt any of your php files inside codeigniter.
-Protect with time limit the application. (Make trials for your clients)
-Protect copy or use in others domains (Just run inside licensed domain)
-Inject a variable inside every page $GLOBALS['license'] with all info.
-Make some limits for users, like how much users will be in the app. (just inject variable)
Code is not obfuscated, it get really crypted with AES 256. is not hacker proof, but is the best tool i have found.. (And it's mine!)
1.- Create a key.php file, this is the key for running software in anyplace.
2.- Get your KeyID, this is needed for crypting files, must be saved only for you.
3.- Get the CIDecrypter.php Library into library folder of Codeigniter.
4.- Crypt your PHP files! and have fun!
vor längere Zeit habe ich mal eine dt. Forum eingerichtet, was mangels Nachfrage wieder eingestellt wurde. Die Idee für einen dt. Support für CI schlummer nach wie vor in mir, daher möchte ich auf diesem Weg nachfragen, wieviele deutsche Anwender CI verwenden. Jeder der sich angesprochen fühlt, kann gerne einfach einen Beitrag mit
+1-1 ( privat und beruflich)
+1-0 ( nur privat)
i was searching for hours to find a solution to generate usable 404 errors in CI, but i think this section is not well integrated in CI:
When extending the CI Exception class, there is no way to get the instance with "get_instance()" because as what i've seen, CI isn't loading the core before the Exception controller.
I need some basic functions to generate my 404 error pages, so this behavious is completely useless for me as it only handles static output.
If i use the method with 404_override in the config file, it works well, i can use the whole CI core functions but it is also not thought to end because sometimes i need to call show_404() manually which shows the ugly default error from the CI Exception class which leads to the problems above.
So there are 2 ways of integrating, but none of them is really usable.
Sounds like a joke to me...
Has anyone solved this problem without modifying the core?