This is my last post for my Ubuntu 20.10 install. Below is my notes for installing all of the programming-related apps and tools that I like to have available.
Category: PHP
Troubleshooting PHP Slim Routing
The Slim PHP framework is a great place to start up a back end for a website. I’m sure I haven’t mastered it yet, but there’s good documentation, and it seems to go pretty fast. My big issue this time was trying to figure out why it wouldn’t route correctly. Here’s my notes for figuring it out…
Troubleshooting PHP Composer Class Autoloading
I had some issues with using the Composer autoloading in PHP. So, here’s my notes….
More Polymer 1.0 Lessons
I’ve done some more work with Polymer 1.0, so I have some more to share with what I have learned. Specifically, what I was working on was making my home page mobile friendly and also working on a quick program with my son to track license plate states on our road trip.
Playing with Polymer 1.0
At the Google I/O conference, they announced the release of Polymer 1.0. I’ve been wanting to get into Polymer for a while now, and that was the one nudge that I needed. I decided to take a stab at redesigning my website’s home page with Polymer.
Here’s what I have learned…
Great Links: Web Encryption without SSL
I have been working on getting data transfer encrypted for parts of my website, and I think I have a solution! Rather than encrypt all of the site with an expensive SSL certificate, I am just going to encrypt the AJAX calls.
Here are the resources that I am using:
- On the Javascript side — pidCrypt
- On the PHP side — Stevish’s PHP Encryption
- jQuery plugin for pidCrypt
Do you have any experience with this or anything similar? Comments are welcome!
Update: I am still trying to get it working… Check out my question here.
Update: Here’s a nice link to help with generating the key: madboa.com: OpenSSL Command-Line HOWTO — How do I generate an RSA key?
Update: I haven’t been able to get pidCrypt to work. I found another tool that looks very good called jCryption, but I can’t make it work because my host doesn’t provide the bcMath library. I found a couple more helpful pages here and here.
Sitemaps
I have been working with Google’s Webmaster Tools, and one of the things that it requires is a sitemap. It took me some tweaking to get it right, but here is what I learned.
First, I had to hand craft a sitemap php file for the main, parent site. The first thing that I struggled with was how to get the content type and XML heading in a php file. The solution was the header() command and to use the echo command.
Here is the heading of my sitemap page:
<?php header("Content-Type: text/xml"); echo '<' . '?' . 'xml version="1.0" encoding="UTF-8" ' . '?' . '>' ?>
The next hurdle was to determine how to include the last modified field. I found the filemtime() command could read the last time the file was changed. Then, the date() command using the DATE_W3C format puts it in the correct format that the sitemap expects.
Here is what an entry looks like.
<url> <loc>http://digitaleagle.net</loc> <lastmod><? echo date (DATE_W3C, filemtime('index.html')) ?></lastmod> <priority>0.4</priority> <changefreq>monthly</changefreq> </url>
Finally, I found a plugin that would generate the sitemap for the WordPress blogs. The plugin is called: “Google XML Sitemaps”:
This plugin adds a new settings page where you can configure different options regarding the sitemap:
I didn’t need to mess with any of the settings. I should have blogged this as I was doing it, but if I remember right, I had to visit this page the first time to generate the sitemap. From there, it takes over.
At the top of the settings, you can see stats such as when it last generated the XML. You can also force it to rebuild the sitemap.