How should I connect to my php framework to use methods written in the framework, in a framework agnostic environment?

My company runs 2 websites, a public facing website for clients, and an employee intranet. The intranet is used as a backend for employees to edit and maintain various parts of the public website. Both are written in PHP. The intranet is years older, and was designed using an inhouse framework. We have recently created a new public website, and because of the opportunity to “start from scratch” with it, we designed it using a PHP framework (Kohana). We knew from the beginning that there would be implementation issues with getting the intranet to interact with the public site, and vice-versa. We are now at that point.

There are a few different ways we have been able to make things work: For direct data manipulation, both use mysql, so the query builder in Kohana can manipulate the same data as the straight mysqli queries of the intranet. But beyond that, when the public site needs to use certain auditing methods written on the intranet framework, or when the intranet needs to send an automatic email written in Kohana, or use any number of other methods and functions, we have

1- Included one framework within the other, to have access to both. Problems with this are:

a. Both rely on object buffering to prepare output, and are constantly starting and ending buffers at odd times.

b. Conflicting class names being autoloaded

c. autoloaders overwriting each other

d. errors designed to be handled in one way are being handled improperly by the other framework’s error handler.

e. any number of other incompatibility issues

We have gotten around these on a case by case basis, but it has been a nightmare

2- Using a remote API. We have written webservice methods on each server, and the other framework makes a cURL request of the other server. Problems with this are:

a. The added work of protecting the API and authenticating requests

b. the need to write service methods

c. The overhead of having to make http requests instead of loading files locally

3- Using a local api. Similar to the above, except the framework is included on the same server, and the api methods are written in shell scripts which output data to be read by the calling script via shell_exec.
This alleviates the need for authentication, but it seems like an ugly, hacky way of doing things

We don’t want to rewrite the intranet using a proper framework. It would take an incredible amount of time that we do not have. Is there a better way to do this, or at least a more “standard” or “conventional” way of dealing with this problem? Or are we stuck hacking away at it like we currently have been?

firstly for multiple classes with the same name, I would suggest that you use namespaces to clear out what class in which namespace is supposed to handle it.

most frameworks error handlers can be overwritten to achieve custom error handling , I’m using Yii and at least that is supporting it.

and also you can use the old frameworks working parts and include them in your new framework and reuse your code.

I would suggest expanding on 2. You can secure your endpoints by IP whitelisting.

There is not much overhead involved in making HTTP requests. Worry about other bottlenecks like inefficient SQL and file I/O.

Having two incompatible systems talk to one another requires an agreed upon API. This is a fundamental fact. Sandboxing one inside the other is just going to give you the runaround.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật