In SQL, wildcard characters can be used in "LIKE" expressions; the percent sign (%) matches zero or more characters, and underscore (_) a single character. Sometimes users are not familiar with these or they are using different ones like (*) and (+) similar to regular expressions. My colleages do so and then i decided to add this feature by extending CbCriteria. Especially adding a new parameter $wildcard_chars to the method addSearchCondition to replace them if needed with standard SQL characters:
One of the common tasks the web application might be required to perform, especially the app using some kind of a CMS, is to save the history of data changes. Your client for sure will want the answer to this simple question - If I mess this up or delete by accident can we bring it back? Well, DB backup is one thing and quick recovery is another - let's talk about latter one.
For one of my projects I needed an interactive console command in Yii 1, i.e. the one that is gathering all information from user in an interactive mode (a serie of questions and answers displayed directly in the console), ignoring command-line arguments at all.
This article is helpful only if you have the following situation:
A web app which uses facebook login to login its users and if a user is logged out from his/her facebook account through another browser tab, then your app dont know that he is logged out out or not from his facebook account and he/she will remain as logged in your web application.Its ok if you have no problem with this situation.But if you want to forcefully logout the user from your application if he is logged out from his facebook account means you can try this example.This example uses periodic ajax calls to facebook's graph api to check whether the user is logged in or not.
In many cases developers of one project use their own local environments for coding. There may be a common test platform and, of course, production. All these environments usually have different DB credentials and directory structures (first of all, path to YII framework directory). Another feature is debugging. It's convenient to turn it on for local environments, eventually - on the test server and never (generally speaking) - on the production.