Welcome Guest, Not a member yet? Register   Sign In
Help needed with Modular Extensions
#1

[eluser]Unknown[/eluser]
Hello,

I just returned back to a company I used to work at years ago and am taking over the website. I'm currently working on upgrading their CI framework from 1.7.1 to the current version 2.1.2.

It seems to me the best way (since I have some time to work on this) is to probably start with a fresh new install at this point since there is so much other architecture (non-CI related site architecture, that is) that really needs to be changed/updated throughout.

Also, the site is currently making use of an older version of Wiredesignz Modular Extensions contribution (version 5.2.01 copyright 2009-02-25) for HMVC. However, it appears that there has been a lot of customization done (so it seems) from the base ME installation. It was worked on by a team of developers, but I am inheriting this site as the sole developer working on it at this time, so I need to ask for a little direction to get me on the right track here.

Basically, the site is for a real estate company and for each portfolio sale they do, a new directory is added at the top level of the application and is named with the sale number and acts sort of as a standalone CI application but sharing the core framework. So, when clients view sales, they go to www.companyname.com/1234 (etc...you get the idea).

A really basic example of how our structure currently exists in CI version 1.7.1:

Code:
- /1234
-- /application
--- /config
--- /controllers
--- /errors
--- /helpers
--- /hooks
--- /language
--- /libraries
--- /models
--- /views
- /5678
-- /application
--- /config
--- /controllers
--- /errors
--- /helpers
--- /hooks
--- /language
--- /libraries
--- /models
--- /views
- /9999
-- /application
--- /config
--- /controllers
--- /errors
--- /helpers
--- /hooks
--- /language
--- /libraries
--- /models
--- /views
- /application
-- /config
-- /controllers
-- /errors
-- /helpers
-- /hooks
-- /language
-- /libraries
-- /models
-- /views
- /css
- /images
- /js
- /system

NOTE: The /application folder was intentionally broken out from the /system folder where it normally lives in a default v1.7.x installation of CI which, of course, isn't necessary in with v2.x.x.

The priority for finding/loading/extending class files needs to be done in the following manner:

1. First, look in the custom sale folder directory. Find/load/extend functionality from the CI core (in /system).

2. If the called class does not exist in step 1, look for it in the top level /application directory next. Find/load/extend functionality from the CI core (in /system).

3. If the called class does not exist in step 2, look directly in the CI core /system directory for the original classes and load those.

I've been learning the newer installation of Modular Extensions and it seems that I'm required to add many sub folders for the modules to work (i.e. /modules or custom name/welcome/controllers/welcome.php and so on for all the controllers, models and views).

Does anyone know or have suggestions on the best approach I should take to go about adjusting the default installation of Modular Extensions with a new CI 2.1.2 installation to get it working more like the previous setup as listed above so that I can add more custom top level directories (like the folders named with sale numbers) and have the modular set up look for and load class files in the priority outlined above?

I'm trying to translate a lot of the customization that was done from the development team that worked on the previous set up but both the versions of CI as well as Modular Extensions at that time differ in structure and syntax (given the 3 year difference and changes in CI and PHP) that I'm having a hard time getting it translated over. I don't necessarily feel like I need to approach it 100% the same as the previous team did so I'm open to considering different approaches as they apply to best practice with current versions of CI, ME and PHP. The main requirement here is getting CI to find/load/extend class files in the priorty that I had listed above.

Many many thanks in advance!! I apologize for the very long post but I've spent the last 3 weeks trying to get this working on my own with no success so I felt it was now time to seek some assistance. I'm sure some clarification of what I've attempted to outline above will be required, so please do not hesitate to ask.

Thanks again!
Tony
#2

[eluser]solid9[/eluser]
Are you trying to convert it into HMVC ?
I don't think MVC has a module, only in HMVC.
#3

[eluser]Unknown[/eluser]
Hi solid9,

Sorry for the delay in response. I didn't receive a notification that someone had responded. So I just checked the post in the forums now and saw your response. My apologies.

To answer your question: yes. The original site was based in CI 1.7.1 which is MVC. I believe the developers who had originally customized it used an earlier version of the rather popular Modular Extensions contribution from wiredesignz. I found the Modules.php file and also did some poking around and debugging to makes sure it was actually getting used in that set up (and not just sitting there as a file they attempted to use once but abandoned it).

I'm trying to update the site's version of CI to 2.1.2 (well, now 2.1.3 is released, so I'll need to update some core files). With a lot of changes to the core files...directory changes, code location, etc...I'm having a difficult time updating the customizations that were initially made by the other development team. Their customizations seem to be adding additional class finding logic to automatically find and load any classes/sub-classes (with "MY_" prefix) being called in the following order and cascading down:

- First check the current sub-application directory (that is not the main CI application directory or the system directory. If found, load that one. If not move to #2...

- Second, look for the class in the main CI application directory. If found, load it. If not, move to #3...

- Last, look in the CI system directory. If the class being called in #1 and #2 wasn't found there, it should definitely be in the system folder (or throw an error and display error message).

Not sure if my explanation is confusing...please let me know if it is and I'll do my best to clarify.

Thank you!

Best,
Tony




Theme © iAndrew 2016 - Forum software by © MyBB