Note: This post was written while Laravel 4 was still in beta.
When you add a new class (controller) in Laravel 4 you will most probably get
ReflectionException: Class SomeClass does not exist
SomeClass is of course the name of your new class.
Why does this happen? The file/controller is there, the class is there – it works in Laravel 3 so why doesn’t it work in Laravel 4?
The reason for this is that because of the performance reasons Laravel 4 (beta) has a static list of all classes that need to be autoloaded. Since you added your new controller Laravel doesn’t know about it yet. Hopefully this will be automated in the future but right now what you need to do is open your command prompt and type this (on Windows):
If you get 'composer' is not recognized as an internal or external command error or Could not open input file: composer then use this version (also go to your project directory where composer.phar is located):
>php composer.phar dump-autoload
Composer will (re)generate autoload files and your new controller will work.
right mouse-click “My Computer” and select “Properties”
if on Windows 7 then click on “Advanced system settings”,
open “Advanced” tab and click “Environment Variables”,
highlight/click on the “Path” variable under “System variables” and click “Edit”,
add your specific path to front of “Variable value” field or at the end, separated by a semicolon from the existing entry. Do not add a space between ; and last entry.Also, do not add ; after the last entry
Let say, just for example, that the Git.exe is in C:\Users\something\somefolder\bin folder. So when you edit your path variable it should look like this (thanks to my super Photoshop skills you can see that we are on Advanced tab, that we are editing Path variable and that I excel at making watermarks):
A lot of people don’t know that there is an easy way to embed tweets on your site with all the formatting and styling so they look just like on twitter.com. In addition, tweet will also contain avatar, reply,favorite,follow and other buttons so it is also functional.
If you embed only one tweet per page then you can include this line after blockquote. If you embed several tweets then include this line only once, somewhere at the bottom of the page or inside meta tag.
In some cases the message “Briefly unavailable for scheduled maintenance. Check back in a minute” doesn’t disappear after you update your WordPress, despite the update being successful. Even worse – you are locked out of admin because both admin and your site display this message.
How to fix the WordPress maintenance mode problem? The solution is simple. Use your FTP program to connect to your server and delete the .maintenance file from your server (it is in the WordPress root directory, same as .htaccess). In most cases this will fix it. If the update did not finish then loginto admin and try to reinstall WordPress updates.
Every now and then I encounter a problem where several sites that I visit fail to displays CSS. It looks something like this (Gizmodo website):
The problem appears when something goes wrong while you are deleting browser cache,cookies etc. In my case it usually happens when I use CCleaner (free tool for cleaning your Windows PC) and I accidentally open Firefox (or other browser) while CCleaner is deleting the cache. Websites start to look like above screenshot and refreshing the page doesn’t help.
The solution is to refresh the page with CTRL + F5, which forces browser to redownload the entire site from internet and not from local cache. This solves problem only for that site so what I do is close all browsers and run CCleaner again.
Sitemaps are a very useful way to allow a webmaster to inform search engines about URLs on a website that are available for crawling. If you are using WordPress or some other CMS you can simply install a plugin (or maybe XML sitemap generation is already inbuilt module) and it will automatically create a sitemap for you. But sometimes you want to create a sitemap by yourself. There are several free services that allow you to create sitemaps for free, like xml-sitemaps.com , rorweb.com and so on. After you create a sitemap you should upload it to your website and submit to to Google,Yahoo etc.
That was a little sitemap introduction and now to the problem I encountered.I am not going to go into discussion if ROR sitemaps are better than Google/XML sitemaps or even needed (I don’t really use it but some people might find it useful). I am just describing solution to a possible problem you might encounter when making a ROR sitemap.
Google Webmaster Tools and ror.xml error
I built a ROR sitemap using xml-sitemaps.com site,uploaded to my site and added it in Google Webmaster Tools admin and Google showed me this error:
Missing XML tag
This required tag is missing. Please add it and resubmit.
Parent tag: channel
At first I thought that xml-sitemaps.com ROR generator is outdated so I used one at rorweb.com/rormap.htm but I got the same error. After searching the net I found the solution is very simple:
Open the ror.xml file in your text editor and find this (the beginning of the document,it might look a little different)
<title>ROR Sitemap for http://www.yoursite.com/</title>
and paste the description line between the title the link lines so it will look like this:
<title>ROR Sitemap for http://www.yoursite.com/</title>
<description>ROR Sitemap for http://www.yoursite.com/</description>
Save the file,reupload to your server and resubmit to Google Webmaster Tools (refresh the page) and the ‘Missing XML tag This required tag is missing. Please add it and resubmit’ error should disappear.
This problem only appears on certain keyboards and languages where left and right square brackets are placed on letters F and G. Even if you have similar problem with different keyboard or key binding /letters you can still use this solution.
I was using Sublime Text 2, which is really fantastic editor, on Windows 7 and encountered a weird problem. When I pressed AltGr+F Sublime Editor 2 didnt print “[” (left square bracket) – it opened Instant File Search tool instead.
The reason for this is that Windows sees AltGr as Ctrl+Alt, and therefore AltGr+F will be understood as Ctrl+Alt+F, which is a default keymap for Instant File Search tool.
To fix this you need to override the default Ctrl+Alt+F shortcut so it will insert the desired character by inputting that shortcut in user key-bindings.
1. Select “Preferences > Key Bindings – User” in Sublime Text 2 menu
2. Paste the following code there: