2 Ways To Find Current Directory in PHP Without Regular Expressions
2 minutes - Mar 27, 2015There comes a time when you need to find the current directory in PHP, test to see if it is the directory that you expect it is, and take an action based on the test results. Obviously, the easiest way to get the current working directory in PHP is getcwd(). However, parsing the output of this function can provide some interesting challenges. While it is trivial to do this sort of search with a Regular Expression, I tend to look for a solution that is easier to understand its functionality without reaching for the reference books.
Another Micro-Optimization Provides Useless Results
2 minutes - Mar 26, 2015One of the things to remember about performance optimizations performed in isolation is that their results are rarely representative of real-world performance results. This article outlines the “findings” of the students at a couple of Canadian universities, and comes to the conclusion that string concatenation in memory is slower than writing the same total number of bytes to disk, one after the other. String concatenation is a slow and CPU-heavy operation.
Verify Magento User Access to Admin Functionality
2 minutes - Mar 25, 2015When working with Magento, there will inevitably come a time where you need to manually check to see if the currently logged-in user has access to a specific piece of functionality as defined in the ACL settings. Personally, I have come across this situation more often when creating my own custom modules and their custom permissions, but they can be used to check the permissions of any module. As is so often the case, Alan Storm has documented the exact solution for this scenario.
Laravel Removed The QuickStart For Version 5
2 minutes - Mar 24, 2015To start out, I want to be clear that what follows should not be interpreted to be a criticism of the software framework that those that work on Laravel publish, nor an indictment of open-source software as a whole. Rather, it is a look at how some projects, open or closed source make it harder than it should be for new users/developers to utilize their terrific products. It seems experts conveniently “forget” the tips and tricks and tribulations it takes to learn a new technology, covering it all with, “It’s just so easy”.
Google To Begin Rewarding Mobile-Friendly Websites
One minute - Mar 20, 2015Google recently announced that beginning April 21, 2015, they would start slightly rewarding websites that are mobile-friendly at the expense of sites that are not. There are several things that Google looks at to determine whether or not a site is easy for a user on a mobile device to view and navigate. Some of the things that Google looks for include the following: Fonts that are big enough to be legible Users don’t have to scroll left and right to see content Links are big enough and have enough space around them to be clickable with a touch of a finger.
Run Multiple Python mod_wsgi Websites With Apache On Windows
One minute - Mar 19, 2015Yes, this sounds completely crazy, but there is a semi-valid need to do this, unfortunately. However, when you need to run multiple Python websites on Apache on Windows via mod_wsgi, it quickly becomes apparent that using the typical <VirtualHost> configuration options do not work as expected. When you try to do it with a <VirtualHost> configuration, you will be unable to setup a separate WSGIPythonPath configuration setting per virtual host, as that configuration directive is not allowed within a <VirtualHost> node.
Top 5 Reasons To Test Your Website Across Browsers
2 minutes - Mar 18, 2015I would hope that those of you taking the time to read this posting would have some idea of why you should perform some level of testing of the software and websites you create. However, I am keenly aware that some management types don’t always understand the importance of testing until an untested “feature” appears in the wild, frustrating all that run across it. Ensure Cross Browser Compatibility- Unless you develop a website for internal usage only, where you are able to successfully restrict users to a specific version of a specific browser, Cross Browser Compatibility ensures your site functions well for the greatest number of users.
When Is Enough CSS Enough?
Google Code Shutting Down
2 minutes - Mar 16, 2015Google just recently announced that they are going to begin the process of shutting down their Google Code project hosting service. In the blog post announcing that they were shuttering the service, they let it slip that even Google had quit using Google Code for their project hosting, instead transitioning thousands of their projects to GitHub. Google seemingly blames the fact that GitHub and BitBucket handle project hosting better than Google does as the main reason that they are discontinuing the service.
Never Explicitly Trust Software Because It Is Open-Source
3 minutes - Mar 13, 2015One of the major ideas behind open source projects is that allowing anyone that wants to view the source code of a project to be able to do so should make bugs and security weaknesses easy to find. While this did not work so well with OpenSSL and its various bugs that have been exposed recently, I do have an example where it worked extremely well. Magento is an eCommerce platform that has two separate editions.