Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Building Large Scale PHP Applications

Featured Replies

Evening folks,

 

I have been using PHP for a number of years and have gradually built up my skills by learning things such as OOP to a pretty high standard. I am looking into building quite a large scale PHP application but am not sure where to start. I have all the skills, just not sure what design pattern to use.

 

I have built applications in the past but as they have gradually become larger and larger, they have become complicated and confusing due to the maze of links and files and have eventually become unmanageable.

 

If you were to build a large application for example an intranet system for 50+ users featuring bulletin boards, payment trackers, bulletins etc using OOP techniques, in what way would you lay out the code for it to be as logical and modulated as possible. I am planning on using .htaccess to run everything through an index.php file which will then route to the correct methods for the task.

 

I have looked into design patterns such as the MVC (Model-View-Controller) pattern but this seems far too complicated and pointless for what I am planning to build.

 

Any ideas appreciated.

 

Regards,

Dan

No no no!

 

I am a very advanced PHP / MySQL programmer.

 

Start with a Core class, don't extend it at all.

 

Call the class Main or Program. Embed all your constants in the Program class and use them like so:

 

Program::const_name

 

Also, your program class will instanciate all nessecary classes with a foreach loop using the "autoload" magic function.

 

Then, have a collection of classes that each do a seperate thing.

 

Have a good heirachy of files and if a file is to do something then use it as so, eg. /core/dosomething.php

 

You CAN use index.php and use the switch statement, however there are major security holes in doing it that way.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.