Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7985881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:41:08+00:00 2026-06-04T11:41:08+00:00

I want to use a central CI setup for multiple sites. The way I

  • 0

I want to use a central CI setup for multiple sites. The way I handle this is I created a package called MPACK and added it to autoload in the config file of each site.

Folder Structure:

/main

/system (CI 2 System folder)

/MPACK

/site1

/application

site2

/application

Inside this MPACK I have share libraries, models, helpers, etc.

However, I would like to have an extended MY_Form_Validation that would be common to ALL sites. Adding the class file to /MPACK/libraries fails. Adding it to /site1/application works fine, as expected.

Is there any way to do this extending inside MPACK?

Thank you for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:41:09+00:00Added an answer on June 4, 2026 at 11:41 am

    Please try this:

    // Placed your MY_Form_validation.php under MPACK/libraries
    $this->load->add_package_path('/path/to/MPACK');
    $this->load->library('form_validation');
    

    You can get more information from CodeIgniter User Guide – Loader Class. 🙂

    You can also autoload your package in /application/config/autoload.php : $autoload['packages'] = array('/path/to/MPACK');

    EDIT: turn out that the above solution doesn’t work, because Loader always look for APPPATH & BASEPATH first, and I not sure modifying this core class won’t break something. Here is another solution in theory:

    You should have your MPACK form validation lib, and sites’ form validation lib should be symlinks to the MPACK one:

    /site1/application/MY_Form_validation.php -> /MPACK/libraries/MY_Form_validation.php
    

    If you just use everything from MPACK, nothing specifically for /site1 or /site2, just make a folder link:

    /site1/application/libraries/ -> /MPACK/application/libraries/
    

    Hope this help =)

    You can read more here: http://codeigniter.com/wiki/Multiple_Applications_via_Symlinks/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just want to prerender different images for fast access. I use grand central
I want to start use git-svn for a projects which uses a central SVN
I want to use YAML to communicate some data across multiple languages. (Think of
I want to use HTTP Digest Authentication with a central database that stores usernames
I want to use my Linux home server as a central repo for having
I am setting up a central mercurial server, and want to host multiple repositories.
I have a server with ssh, that I want to use as a central
I want use groovy findAll with my param to filtering closure filterClosure = {
i want use some data from a website with web service. i have a
I want use JQuery mobile for the front-end of my mobile application, but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.