Come on ...
Friday, June 5, 2015
Wednesday, April 29, 2015
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
Recently tried upgrading PHP version from 5.2 to 5.5 and one of our package program ECSHOP thrown bunches of errors and warning. Yes, our company's shared hosting PHP version is seriously outdated, still mainly using PHP5.2, due to the lack-of-update ECSHOP program ... (yes we still have huge number of ECSHOP clients with us).
First thing I saw ECSHOP running on PHP5.5 is the following warning message :
Immediately went Google to run a brief search, find out that it is the /e is causing the warning. And to resolve it, had to change to use preg_replace_callback function instead.
Opening the script, found the problem script as :
And change it to :
This issue affects all preg_ functions, and it's not too difficult to migrate actually.
Please be aware to to use $this directly inside the created function, your PHP version must be version 5.5 and above.
First thing I saw ECSHOP running on PHP5.5 is the following warning message :
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/name/domains/domain.com/ public_html/includes/cls_template.php on line 300
Immediately went Google to run a brief search, find out that it is the /e is causing the warning. And to resolve it, had to change to use preg_replace_callback function instead.
Opening the script, found the problem script as :
return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);
And change it to :
return preg_replace_callback('/{([^\}\{\n]*)}/',
function($matches) {
return $this->select($matches[1]);
}, $source);
This issue affects all preg_ functions, and it's not too difficult to migrate actually.
- Change the function to preg_ function to preg_<func>_callback.
- The first parameter (regex expression) remain the same, only remove the e identifier from the regex.
- Second parameter changed to use function($matches) {}, then inside the function will be what originally used in the old deprecated function (remove the quotes!).
- Inside the function, find all respective arguments (i.e. \\1, \\2), and replace them in the new function with $matches[<index>]. The <index> would be follow what were used originally (i.e. \\1, \\2).
- Third parameter just remain the same.
Please be aware to to use $this directly inside the created function, your PHP version must be version 5.5 and above.
Saturday, April 25, 2015
Back to life ...
It's been quite a few years since I last posted a blog post... almost 3 years.
Well, I'm kind of a lazy person, not really into the mood of writing blog.
Previously most of my blog post are related to iPhones/iOS/Jailbreaking stuffs, well, from now on I guess I'll not so much towards that, as I've stopped jailbreaking my devices since iOS6. Of course I'm still an iOS user, an iPhone and an iPad. Just love it.
That it for now. I'll update more once I have time or I have anything to share here. Probably programming stuffs. Who knows?
Monday, July 2, 2012
Dropbox - Your life's work, wherever you are
![]() |
| With Dropbox, you can access your files from almost anywhere! |
Dropbox is a free service that lets you bring all
your photos, docs, and videos anywhere. This means that any file you
save to your Dropbox will automatically save to all your computers, phones and even the Dropbox website.
Dropbox also makes it super easy to share with others, whether you're a student or professional, parent or grandparent. Even if you accidentally spill a latte on your laptop, have no fear! You can relax knowing that Dropbox always has you covered, and none of your stuff will ever be lost.
No more waiting and join Dropbox today at http://db.tt/TpHo0M2!
Download links:
Dropbox also makes it super easy to share with others, whether you're a student or professional, parent or grandparent. Even if you accidentally spill a latte on your laptop, have no fear! You can relax knowing that Dropbox always has you covered, and none of your stuff will ever be lost.
No more waiting and join Dropbox today at http://db.tt/TpHo0M2!
Download links:
Thursday, May 31, 2012
Step-by-step restore iOS5.0.1 WITH SHSH
Had just restored my iPhone 4 GSM to iOS5.0.1 two days ago. Was confusing what to do to restore to iOS 5.0.1 which Apple had stopped signing (and they had implemented new APTicket method for restoring process), luckily I found this FAQ and it provides complete step-by-step guide to restore. Just to share here in case anyone needs it.
Source: http://www.jailbreakqa.com/questions/32462/frequently-asked-questions#94647
To successfully restore to iOS 5.0.1, you must have iOS 5.0.1 SHSH blobs saved for this device in your computer (what are SHSH blobs and why are they necessary?). If your device was previously jailbroken, Cydia may have been able to automatically save iOS 5.0.1 SHSH blobs for your device. You can try retrieving SHSH from Cydia's servers by running TinyUmbrella, plugging your device into your computer, clicking the "Advanced" tab, checking "Request SHSH from Cydia", noting where the SHSH will be saved in "Save SHSH Folder", unchecking "Set Host File to Cydia on Exit", and then clicking "Save SHSH" at top right. Verify that your 5.0.1 SHSH blobs are saved (in the General tab) and close TinyUmbrella before proceeding. (If you're interested in restoring to a non-latest version of iOS other than 5.0.1, mentally replace 5.0.1 with your desired iOS version number and follow the same instructions.)
Source: http://www.jailbreakqa.com/questions/32462/frequently-asked-questions#94647
How do I restore (downgrade/upgrade) my device to iOS 5.0.1 or other non-latest iOS versions?
Since Apple has introduced an APTicket/APNonce check for restores to iOS 5, the TinyUmbrella TSS Server procedure does not work anymore when restoring to any version of iOS 5.x (you can still use that procedure for restoring to iOS 4.x if you want, but the following stitching procedure should work too). Instead, you need to create and restore to a custom IPSW (custom firmware file) with stitched SHSH blobs. (If you're lucky enough to have an old-bootrom iPhone 3GS, you don't need SHSH blobs and can go through this process without doing the stitching steps.)To successfully restore to iOS 5.0.1, you must have iOS 5.0.1 SHSH blobs saved for this device in your computer (what are SHSH blobs and why are they necessary?). If your device was previously jailbroken, Cydia may have been able to automatically save iOS 5.0.1 SHSH blobs for your device. You can try retrieving SHSH from Cydia's servers by running TinyUmbrella, plugging your device into your computer, clicking the "Advanced" tab, checking "Request SHSH from Cydia", noting where the SHSH will be saved in "Save SHSH Folder", unchecking "Set Host File to Cydia on Exit", and then clicking "Save SHSH" at top right. Verify that your 5.0.1 SHSH blobs are saved (in the General tab) and close TinyUmbrella before proceeding. (If you're interested in restoring to a non-latest version of iOS other than 5.0.1, mentally replace 5.0.1 with your desired iOS version number and follow the same instructions.)
Friday, January 13, 2012
Disable Java auto update in Windows 7
After you installed Java Runtime Environment (JRE) in Windows 7, it shows up in Control Panel > Programs. Clicking on it will open up the Java Control Panel. We are able to disable the auto update function in Java by un-check the "Check for Updates Automatically" in Updates tab. However, in Windows 7, there was a problem for disabling auto update. The settings will not be saved, meaning to say the next time you open up the Java Control Panel, the auto update is enabled again. It is due to lack of administrative right in Windows 7 environment.
| Java Control Panel - Update tab |
Labels:
auto update,
disable,
java,
windows,
windows 7
Monday, November 21, 2011
Mailinator - Your Temporary Email Solution
Have ever been asked for an email when trying to download something?
Have ever been required to sign up for something?
I did. And I hate to give out my email address to those unknown websites. Where you'll eventually ended up receiving tons of spam emails everyday!
Now with Mailinator, problem is solved!
Have ever been required to sign up for something?
I did. And I hate to give out my email address to those unknown websites. Where you'll eventually ended up receiving tons of spam emails everyday!
Now with Mailinator, problem is solved!
Wednesday, November 16, 2011
Jailbreak/Unlock/iOS information
Repost from: Dev-Team Blog by dhlizard
Miscellaneous
1) There is no jailbreak (yet) for A5
processor devices (iPad2 & iPhone 4S). It is being worked on. It
will be released when it is complete, and tested.
2) There is
no untethered jailbreak for iOS5 yet (except for old bootrom 3GS which
will always be untethered when Redsn0w is used)
3) Ultrasn0w is not (yet) compatible with 5.0.1
Friday, November 11, 2011
Network bug in iOS5?
After few weeks updated to iOS5.0, some weird things start to happen on my iPhone. The cellular network became unstable, and once the network is lost, it became forever No Service. Open Settings app and perform manual search for carrier, it will search forever and never get any result. The only solution to this is to restart the device.
Thursday, October 13, 2011
WhatsApp for iOS free now
WhatsApp Messenger is a cross-platform smartphone messenger currently
available for iPhone, Android, BlackBerry and Nokia phones. The
application utilizes push notifications to instantly get messages from
friends, colleagues and family. Switch from SMS to exchange messages,
pictures, audio notes and video messages with WhatsApp users at no cost.
All features are included without the need for extra in-application
purchases.
iOS 5.0 released
The long awaited iOS 5.0 had finally been officially released.
Update your iTunes to latest version (10.5), connect your iDevice, hit Help > Check for Updates and you're good to go!
Update your iTunes to latest version (10.5), connect your iDevice, hit Help > Check for Updates and you're good to go!
In case the download in iTunes is not stable, you may use below direct download links. All links are directly from Apple download server.
Thursday, October 6, 2011
Sunday, September 25, 2011
Remove delay in LAN games under Windows 7
I find it weird when last time playing Warcraft III LAN game with my housemate, we both feel a bit of delay on the client side (joining one). After doing some search on web, we found that by modifying a bit of registry, the strange delay was removed. This only happens under Windows 7.
- Open up Registry Editor, navigate to HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\
- Look for a subkey name similar to this: {E3CF3EE3-AE61-4A50-8121-2A6CF502EF0F}
- Inside the subkey, there is a value DhcpIPAddress, check if it is the IP Address given by your router. If so, add 2 new DWORD (32-bit) keys with value as follows:
TcpAskFrequency 1
TCPNoDelay 1 - Restart your PC.
Monday, September 19, 2011
Set up Hotmail on iPhone
Here are the steps to setup Hotmail to sync and push to your iPhone (this works on the iPad too):
- Launch Settings
- Tap on “Mail, Contacts, Calendars”
- Tap onto “Add Account”
- Select “Microsoft Exchange”
- Enter your full Hotmail email address into both the Email and Username fields
- Leave Domain blank
- Enter your password
- Enter your prefer Description
- Tap onto “Next”
- Now you must enter the server, use “m.hotmail.com” for the Server name then tap onto “Next”
- The iPhone will now verify that your Hotmail information is entered correctly, the next screen you’ll be able to enable Mail, Contacts, and Calendars
Sunday, September 18, 2011
Cydia error: running sub-process /usr/bin/dpkg returned an error code (2)
In certain cases when you installing apps on Cydia you might get following error:
To fix it, follow these steps:
Error: running sub-process /usr/bin/dpkg returned an error code (2)This error message appears to be related to some file corruption in your Cydia.
To fix it, follow these steps:
- Navigate to /var/lib/dpkg/ directory.
- Rename "available" to "available-bak".
- Rename "status" to "status-bak".
- Rename "available-old" to "available".
- Rename "status-old" to "status".
- Start Cydia and allow it to load everything it needs. Try to install or remove some apps to verify the error is fixed.
Labels:
Cydia,
error,
fix,
iPhone,
sub-process
Remove Cydia apps update notification
- Using iFile, navigate to /private/var/lib/dpkg/
- Make a backup of file "status"
- Open the file "status" using iFile Text Viewer
- Find the package that Cydia is asking you to update.
- Change the version number to the new version number of to a higher number (hit the Edit button in the iFile Text Viewer).
- Save the changes and restart Cydia then you can see the notification is removed.
Saturday, September 17, 2011
Celeste on iPhone 4 iOS 4.3.3
This tutorial will guide you how to install and use Celeste on iPhone 4 iOS 4.3.3.
Added:
After performed above steps, you'll notice an update notification of BTstack in Cydia. DO NOT UPDATE IT. If you would like to remove the notification, simply follow steps here. Just search for "btstack" in step 4 and change "0.3-434" to "0.4-434" in step 5.
Updated 20 Sept 2011:
Someone mentioned above method works for his iPod 3rd Generation on iOS 4.2.1. If your iDevice succeeded in sending/receiving via bluetooth after above method, please leave a comment and state your iDevice/iOS version. Thanks :)
- Add source "www.sinfuliphonerepo.com" in Cydia.
- Search for "Celeste Bluetooth File Sharing" in sinfuliphone repo.
- Download and install all required dependencies as well as the application itself.
- Reboot your device. (You may need to reboot twice for the crack to activated).
- Download BTstack 0.3-434 and put into your iPhone (Download password: "http://hqqqq.blogspot.com").
- Install it using iFile.
- Reboot your device and done.
Added:
After performed above steps, you'll notice an update notification of BTstack in Cydia. DO NOT UPDATE IT. If you would like to remove the notification, simply follow steps here. Just search for "btstack" in step 4 and change "0.3-434" to "0.4-434" in step 5.
Updated 20 Sept 2011:
Someone mentioned above method works for his iPod 3rd Generation on iOS 4.2.1. If your iDevice succeeded in sending/receiving via bluetooth after above method, please leave a comment and state your iDevice/iOS version. Thanks :)
Wednesday, September 14, 2011
New blogger app on Apple App Store
Google had launched a blogger app which allow bloggers to write blog entries to their connected blogger account right from their iDevices. Just browse through app store and search for "Blogger" to download it for free.
Thursday, August 11, 2011
Repair Windows unable to show hidden files
In some cases, Windows will not be able to show hidden files upon request. In Windows Explorer > Tools > Folder Options... > View Tab > Advanced settings, check on Show hidden files and folders and hit Apply. But after these steps the hidden files are still not shown, and the next time you go in to the same setting, you'll see the setting is set to Do not show hidden files and folders. This is probably caused by your Windows registry being modified by certain virus.
Here are the way to manually fix this problem and re-enable the showing of hidden files in Windows system.
Now, restart your computer and everything should be working fine.
Alternatively, you can open up notepad, copy-paste following code and save as .reg file and run it.
Download: Re-Enable Hidden Folder.zip
Here are the way to manually fix this problem and re-enable the showing of hidden files in Windows system.
- Go to Start > Run > type in regedit.
- Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL
- Delete the key CheckedValue in the right hand window.
- Create a new DWORD Value named CheckedValue.
- Double click on it and set the value data to 1.
Now, restart your computer and everything should be working fine.
Alternatively, you can open up notepad, copy-paste following code and save as .reg file and run it.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL]
"CheckedValue"=dword:1
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL]
"CheckedValue"=dword:1
Download: Re-Enable Hidden Folder.zip
Labels:
fix,
hidden files,
registry,
repair,
windows
Monday, August 8, 2011
Autorun virus disinfection tool
I believe most of you heard or seen the name "jwgkvsq.vmx" before. It's one of the very famous/popular autorun virus infected in your windows, infect and copy itself into any flash drives/harddisk you plug into your computer. I had publish a tutorial on Disable autorun in Windows previously. In this post, I'm going to share a useful tool made by BitDefender for disinfection of this virus from your computer and flash drives.
There are two version of this tool; graphical version and console version. Both are working fine, and graphical version are recommended for most users. In fact, you may only need to use the console version in the case that graphical version does not work. Just double click on the executable to run the program, click on start and the program will perform its' tasks.
Notice that if the tool detects that your system is infected, it will prompt you to allow it perform disinfection steps. Your windows explorer will be terminated in the process, and the windows theme will became abnormal after the process. A normal reboot is recommended after the process.
Download link: BitDefender Autorun Virus Removal.rar
There are two version of this tool; graphical version and console version. Both are working fine, and graphical version are recommended for most users. In fact, you may only need to use the console version in the case that graphical version does not work. Just double click on the executable to run the program, click on start and the program will perform its' tasks.
Notice that if the tool detects that your system is infected, it will prompt you to allow it perform disinfection steps. Your windows explorer will be terminated in the process, and the windows theme will became abnormal after the process. A normal reboot is recommended after the process.
Download link: BitDefender Autorun Virus Removal.rar
Subscribe to:
Posts (Atom)



