New Horizons Get Schooled Blog

Use a Mediator instead of a Command Bus for superior code (PHP)

Posted on 9/13/18 10:16 AM by Get Schooled in PHP

A Command Bus is like a carrier pigeon dispatching a message, which it then delivers to the Command Handler. Like many functions in code development, there are multiple ways to execute the same command— with some being preferable over others, depending on the context. In most situations, a Command Bus results in emulated procedures, overcomplicated code, and loss of discoverability.

A Mediator is a superior alternative. Both a Command Bus and a Mediator can be overtaxed with too many responsibilities, but the Mediator shows its data in clear sight and can be easily monitored. For example use: $mediator->wakeUp(); instead of $commandbus->dispatch(new wakeUpCommand());.

0 CommentsContinue Reading →

Split large SQL files for data that can be successfully uploaded (SQL Server)

Posted on 8/30/18 11:49 AM by Get Schooled in SQL Server, in PHP

Just like parents tell their children to take smaller bites when they eat so they don’t choke, by default, phpMyAdmin can’t swallow file sizes larger than 2mb. This can cause quite the headache when you need to import a long SQL file that ends up too big.

Rather than breaking up the SQL file manually and possibly loosing vital information, run a simple command line script to take care of the heavy lifting for you. Not only will it improve accuracy, but it will also be completed in less time.

0 CommentsContinue Reading →

Redirect “Page Not Found” misdirect with error handling (PHP)

Posted on 8/24/18 9:45 AM by Get Schooled in PHP

When you change the main server and the hostname, it’s almost guaranteed that bookmarks will break and URLS will take users to a “Page Not Found” (404) error page. When handling a significant volume of redirects, it may be faster to simply setup a line of error handling that takes care of redirecting users for you during the transition.

To put this into action, add this entry to your httpd.conf: ErrorDocument 404 /redir-404.php3. Then, on your DocumentRoot redir-404.php3 write: <?php $redir = getenv(“REDIRECT_URL”); header(“Location: http://web2.your-domain.com/$redir”); ?>. This will send users to the old server so they don’t face a 404 error page while you implement a long-term solution.

0 CommentsContinue Reading →

Creating Simple Horizontal Bar Graph in PHP

Posted on 1/28/11 10:00 AM by Get Schooled in Auto Bar Graph Generator, in Bar Graph, in Horizontal Bar Graph, in New Horizons Computer Learning Center, in PHP, in Statistics, in Tips & Tricks

Creating Simple Horizontal Bar Graph in PHP

0 CommentsContinue Reading →

Displaying all images in PHP

Posted on 1/5/11 3:00 PM by Get Schooled in Image MIME, in internet explorer, in Mozilla Firefox, in Opera, in Photos, in PHP, in Tips & Tricks

Displaying all images in PHP

0 CommentsContinue Reading →

Search by Topic

    Lists by Topic

    see all

    Knowledge Ninjas

    a web-based service that allows software application end users to access a subject matter expert in real-time via a chat interface to resolve questions or problems they encounter in their specific software.

     

    Subscribe