Archive for category Programming
GoDaddy Alternatives | Boycott GoDaddy
Posted by Randy in Internet, Networking, Web Development on December 23, 2011
Due to its support of SOPA, many people are calling for a boycott on GoDaddy. At first GoDaddy was laughing because of the planned boycott. After about 24 hours, their tone changed and they proclaimed that they were no longer supporting the legislation. Many people are looking for alternatives to Godaddy.
I searched for a bit and found that about the best deal in town is namecheap.com. There is a transfer fee for moving domains over to them, but you get a free year of registration with the transfer. So for around $7 bucks you can transfer and renew a .com. If you have a few months left before it’s time to renew your .com, you can still transfer the domain and get a free year along with the remaining time of your current registration.
Check out their deals. Let’s show GoDaddy that we do not like their support of this unconstitutional legislation.
PHP Video Tutorials
Posted by Randy in Web Development, Windows on December 23, 2011
I just started a new website devoted to teaching people how to develop websites. The site is PHP Video Tutorials. So far I have about 20 videos uploaded. There are nine in the first series which teaches basic HTML and CSS. The second video series goes into PHP and MySQL. I think these videos will be very helpful to anyone who wants to get into web development.
The Best PHP Framework
Posted by Randy in Web Development on November 10, 2011
I searched for the best PHP framework for a while. I tried CakePHP, Zend, Yii, Symfony, and Codeigniter. Some of them frustrated me to the point that I was ready to write my own mini-framework. I think the problem with some of them, at least from my perspective, is that they try to do too much. Some were just poorly documented. Sure, you can find all the information you need to find about all the features, but they don’t make it very easy. For this post, I want to compare two of the most recent frameworks I’ve worked with, Codeigniter and Symfony.
I use Codeigniter for all of my personal projects these days. Recently, I had to use Symfony for some other work I was doing. I can see positive and negative aspects of each system at this point, and this is an overview of their main differences.
First, I’ll talk about Symfony. It includes two ORMs, Doctrine and Propel. I was using Doctrine. It relies heavily on the ORM as it should, but I found utilizing an ORM to be overly complex. This may be due to my own ignorance, but when using an ORM, you have to get into a different mindset. Most people would view the ORM as a feature. For me, it was unwanted. Symfony is a great framework and is used by many people. My distaste for it should not be a deciding factor in choosing your own framework.
However, I would like to point out other things about Symfony that I didn’t like. First of all, the directory structure is overly complex, especially when your job is to maintain code that is already in place. You may find yourself looking at a page and going through 10 different files trying to find where the code is located. Symfony has a ton of plugins, many of which have auto-generated forms and templates. There are times that you won’t find the code that generates the form and from what I saw, your only option is to override the plugin’s actions and templates. If the code you’re maintaining doesn’t override the plugin, you will have to check cache files for the auto-generated PHP and then implement this in the override.
While we are talking about caching, I’ll point out that this is a good feature and it’s implemented by default in Symfony. During the development maintenance of a site, however, it gets on my nerves. So, you’ll spend a lot of time clearing your cache from the command line. Symfony depends on command line usage. While I like using a command line in most cases, I don’t want to be jumping back and forth between my IDE, command line, and web browser so much. Since Symfony auto-generates a ton of code for you through the use of the command line, I can see the advantage, but I prefer the Codeigniter way.
So, let me talk about Codeigniter and why I prefer it to all other frameworks I’ve tried.
First of all, it stays out of your way. It arranges your site into three folders, as I think it should, models, views, and controllers. You can then arrange your files in sub-directories under these main folders as you wish. So if you have a user system on your site, you can put all your views for that section under views/user.
While I’m on the subject of views, let me touch on Symfony’s templates and layouts. It’s actually a good system and cuts back on the amount of code one has to write, but it depends on yaml config files in various locations. I liked the idea, but hated the implementation. I much prefer having the view source where I can easily find it. In Codeigniter, I get all my data ready to send to a view, then load that view. In this view, I can load other views as needed. So if my page has a top navigation menu, I can just load that menu from within my view. This templating system works best for me, and I don’t have to search through config files at various locations to find out where the HTML is located.
Finally, documentation is much better in Codeigniter. If you want to know how a library or helper works, their documentation makes it simple to understand. Symfony’s documentation is terrible in comparison. There’s a reference but it’s just not that good. Plus much of the documentation you’ll need is actually on the Doctrine site.
Symfony has many features that Codeigniter doesn’t. Codeigniter is much easier to use, has the best documentation, and is much easier to maintain. These three things are why I prefer Codeigniter. Maintainability and ease of use are the two main reasons to implement a Framework anyway. Without these two things, one would be much better off using straight OOP PHP.
The Best PHP Framework?
Posted by Randy in Applications, Internet, Programming, Web Development on November 3, 2010
I’ve been really interested in using a PHP framework. One thing holding me back is deciding which one to work with. It seems that every time I start looking at frameworks, I end up deciding to just code everything manually. The major contenders seem to be Yii, Zend, Symfony, CakePHP, and CodeIgnitor. However, I have no idea which one I’m going to use. It’s hard to decide without learning the ins and outs of each one and making a good decision based on that knowledge.
My latest attempt was with the Zend framework. I was getting into it and realized that most of the documentation for setting it up bases the setup from a virtual host in Apache. This would be fine, but it actually makes development and deployment overly complicated for me. My development environment is a Linux machine that is my main desktop. My production server is my own dedicated server with CPanel. Zend doesn’t work very well with this setup from what I can tell.
I want my site to transfer easily between the two environments. I like them to be self-contained as well. I want to throw the framework into a lib folder or link to it in some way. I don’t like that the forward-facing web site is in the “public” folder. I want the root of the website to be the forward-facing public website.
I would really like to use Zend because it has a lot of good extensions for utilizing various web services.
I’d like to hear from others. Which framework would you recommend and why?
Browser Extensions For Developers and Internet Marketers
Posted by Randy in Internet, Programming, SEO, Web Development on May 3, 2010
I’m on the fence when it comes to my favorite browser. I’ve recently started using chrome much more, due to some bad performance issues in Firefox. Firefox on my 64-bit Windows 7 installed sits and eats memory. I’ve seen it use nearly 2gb of RAM. This was after it had been open on the computer for a few days, and a restart of the browser fixed the issue. However, I’m not sure why this leak is there. The last time I can remember truly liking Firefox completely was back in the version 1.5 days, and even then there was supposedly a huge memory leak. Back then I didn’t notice a memory leak, but these days I do.
It could be that Firefox utilize memory different, and it may be the new way Windows 7 display memory usage. I still see sluggishness. Thus, my move to Chrome. There area a few different things that could have caused the slowness, such as the added extensions in Firefox. After installing about seven extensions in Chrome, however, I see no performance hit. So, I still suspect that there is an issue with the browser itself. Even with all of these woes, it is still better than using IE. I hate that browser. I don’t necessarily hate using it, but it is difficult to write web sites that work well in it along with all other browser. It’s the odd ball which never works the way I want.
For web development, Javascript is necessary for client-side scripting. However, Javascript is difficult to debug. Luckily, we have the Firebug extension for Firefox. This is the uber-extension for web developers. I’ve used it quite a lot, so much so that it has become a necessity. I probably couldn’t write Javascript without it. There are also other features to this extension, like being able to examine the DOM and such. Internet Explorer has a similar tool set but it’s slow and hard to utilize. I would dare say that there are some IE users who installed Firefox just so they can use Firebug. One setback here is that IE’s Javascript engine has certain nuances that do not readily show up in Firebug. So, while you can debug a majority of javascript errors with Firebug, it will miss certain IE javascript issues.
The next must-have extension for web development is the Firefox Web Developer extension. It gives you a host of options to example page elements and CSS rules within the page itself. This plugin along with Firebug have saved me TONS of time, while working on websites.
SEO is important to not only marketers but web site developers as well. Getting a site online is one thing. Getting it to show up in search results is another. A couple of excellent extensions for examining the search engine optimization of a site are the Firefox SearchStatus extension and the Chrome SEO extension for Chrome. The Chrome SEO extension is great for getting a brief synapsis of your site’s backlinks, pagerank, and indexed pages at various search engines. Neither of these offer a lot of advice for SEO, you’ll need a company that offers Drupal SEO services for that, but they do show some stats to get your started.
These are only a few of the extensions available for Firefox and Chrome. There are many others. They are a good reason to switch from IE. PLEASE DO!
Resetting WordPress Passwords Manually
Posted by Randy in Open Source, SQL, technology, Web Development on January 10, 2010
I’ve had to do this for my wife and her mom both, so I thought I would share this with anyone who needs to reset a WordPress password. I personally love WordPress. You can build any type of site with it, not just a blog. If you have created a WordPress site but haven’t visited the admin dashboard in a while, you may have forgotten your password. I thought that WordPress would email you a lost password, but maybe they didn’t put in their correct email address. It could have also been the installation script they used through cPanel. Whichever the case, they couldn’t get into their dashboard and they needed their passwords sent to them.
There’s a very easy way to reset that password through SQL. Whether you are using phpmyadmin or some other SQL client to access your databases, you’ll want to use the following SQL statement to reset your password:
1 | UPDATE `wp_users` SET `user_pass`=md5('password1') WHERE `ID`=1; |
You can change password1 to whatever you want. I’m amazed that WordPress passwords aren’t stored with more encryption than a simple MD5 hash. It’s secure enough, don’t get me wrong. I’m just surprised that the WordPress developers didn’t opt for more.
Oh well, I hope that helps someone in a pinch.