Any Step By Step Guides to Updating Smarty PHP Framework? - php

Trying to fathom out how to update smarty php framework from 3.11 to current 3.21
Can anyone suggest where to find a detailed guide for a dummy or list step by step here?
Ive searched just about everywhere.
Yes i understand 3.22 arrives shortly (2 weeks) and will come as standard set for HHVM this being why i want to resolve any issues now in the current update before tackling any when 3.22 arrives.
Thanks

Updating Smarty from version 3.xx to 3.yy is usually not very difficult, its nothing like the big upgrade from 2.xx (but they've written a guide for that....). Just replace your Smarty installation directory with the one from of the newer installation.
Just for safety reasons, I usually do it like this in my development enviroments.
Directory structure:
./Smarty/ <- Symlink to ./Smarty-3.1.12/
./Smarty-3.1.12/
./Smarty-3.1.13/
Your php-scripts include Smarty like this:
require('./Smarty/libs/Smarty.class.php');
For an update just copy the newer version into a new folder and change the symlink to show to the new folder.
rm Smarty
ln -s Smarty-3.1.13 Smarty
If you run into issues, just switch the symlink back to the old installation until solving the issues.
You might have to empty your /templates_c/-directory, too, in some cases.

Related

Symfony 3.4: How to get a list of all Deprecated warnings?

I have quite a big project in Symfony 3.4 and I wish to update to Symfony 4.
And I get a lot of deprecation warnings. Which is ok I need to fix those, but I cant check each route for my site... there is too many.
Is there a way to get all the depreciation for Symfony 3.4 in my project?
I use the sensiolabs-de/deprecation-detector first to find a lot of them but you never cover them all with that tool.
After that, you can go trough the .md files in your Symfony project, they are located at
vendor/symfony/symfony/UPGRADE-3.0.md
vendor/symfony/symfony/UPGRADE-3.1.md
vendor/symfony/symfony/UPGRADE-3.2.md
vendor/symfony/symfony/UPGRADE-3.3.md
vendor/symfony/symfony/UPGRADE-3.4.md
vendor/symfony/symfony/UPGRADE-4.0.md
Or you can read them online https://github.com/symfony/symfony/tree/3.4
Start with the first one (3.0). Take your time and read carefully.
Make use of a good tool to search your Symfony project (PHPStorm, Netbeans, Sublime, ...)
Everything should be in there, good luck!
When you have a good IDE (like PHPStorm) you can use its code inspection tool. I just inspected the src code of a legacy project in PHPStorm and got this as result:
So still a lot of work to do ;)
may be this will help you to get all deprications:
composer global require sensiolabs-de/deprecation-detector
$ deprecation-detector check src/ vendor/
$ deprecation-detector check src/ composer.lock
You can look here for more information:
https://github.com/sensiolabs-de/deprecation-detector
This is how you scan your files for deprecated code:
$ git clone git#github.com:sensiolabs-de/deprecation-detector.git
$ cd deprecation-detector
$ composer install
$ ./bin/deprecation-detector check /path/to/your-project/src /path/to/your-project/vendor
Source Paving the way for Symfony 3 with the "Deprecation Detector" tool
In addition to previous tips:
Deprecation notices are triggered whenever you end up using a deprecated feature. When visiting your application in the dev environment in your browser, these notices are shown in the web dev toolbar. All these deprecation warnings are also logged in your log files (ex: local/var/logs/dev.log).
I suggest to test all the features of you application and then retrieve the depreciation notices from the log file to get an "exhaustive" list.

Accidentally added all zend framework files to the commit, how to remove them

SOS! SOS!
After a good day of work and testing out everything, I committed my work. Except, this time, instead of
git commit -u
I used
git commit -A
because I was fed up of the untracked files alert I was getting about some of the zend files like doctrine, composer etc. And boom! the project has stopped loading.
I tried going back in my log, hoping that a previous commit should work, but nothing is working.
My question is:
1. How to remove the zend files from the commit
2. How to clean this mess?
Please help!
The world is beautiful again.
Sharing the stack of mistakes I did, so that it may help someone someday:
Committed zend framework files with the project files. Specially the vendor ones. NEVER do that. .gitignore them
After committing, when I moved to a previous branch, the project started throwing 500, because it was not able to find all the zend files. (git was trying to reset the files to the previous stage and I presume there was a mismatch in the zend framework files)
I added another blunder to this sequence by doing a php composer.phar install in the zend folder, expecting that the missing files will be regenerated.
Solution:
1. Did a soft reset: git reset --soft HEAD~3 to go back to a stable commit
2. Removed all zend files
3. Recommitted the desired files
4. This is when I started getting badmethodcall from zend/navigation/navigation. This was because composer install, loaded zendframework folder in the vendor folder in addition to ZF2 folder. There should be only one shared library folder in the vendor folder. Now, why was zendframework taking precedence over ZF2 with regard to rendering the menu - I have no clue. But I deleted the zendframework, and butterflies started singing.
Thanks to anyone who tried to help me.

How can I get a Zend Framework project to run on IIS?

I am trying to get the Zend Framework (ver 9 Studio) to deploy and actually run on my local IIS server.
I have created a very simple little app using the built-in wizard. It works fine if I run it on the Apache server that comes with Zend. But I tried to copy the files over and run it on IIS, and I get errors.
It appears that it is missing the links to the libraries. I've tried manually isolating and grabbing the missing libraries and putting them into the /library folder. This is a good start but I still get other errors down the road.
I found a tutorial out there that comes with an example of a Zend Project that runs in IIS. But, it pretty much has the same problems as the project I created. More missing libraries. The tutorial includes some neat new tricks like a web.config that is supposed to replace the need for the .htaccess that Apache uses.
That's how far I've made it. This is all very frustrating. Does anyone have a simple example like that tutorial promised? If not, just some good information would be helpful.
you need the rewrite module, Rob Allen has a little tutorial to help. The biggest problem is usually the rewrite module, because you have to install it seperately.

Migrating Cake 1.3 to Cake 2.0

I read over the guide here: http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html which describes the changes to Cake for version 2.0, but it doesn't explicitly say how to make the upgrade.
I also saw this: http://book.cakephp.org/2.0/en/console-and-shells/upgrade-shell.html#upgrade-shell which I figured would give a little more instruction.
So far this is what I've done to the existing version (1.3) on my server.
Went and grabbed the zipped copy of 2.0 from the repo here: https://github.com/cakephp/cakephp/tree/2.0
Added the new index.php file into my webroot
Noticed that the new cake core folder exists one level within the parent directory lib so it's (webroot)/lib/Cake instead of (webroot)/cake. So now in my webroot I have my old '/cakecore, and now a folder called/libwhich contains the new core (2.0) and my old '/app folder as well as the old '/vendors` folder.
I ran from inside /lib/Cake/Console this command: ./Console/cake upgrade all which scrolled a bunch of stuff like:
Done updating
/home/bob_cobb/public_html/mydomain.com/lib/Cake/TestSuite/CakeTestSuite.php
This didn't change anything in my original /app folder as all controllers are still underscored and lowercase.
What am I missing here? I renamed my old /cake core folder and the site stopped working, so it's obviously still relying on that. Should I just scrap everything and start over (delete 1.3 completely while saving all my old files and just re-create them with a fresh version of 2.0)?
Any advice on how to get this migration process going would help greatly. I expect a few things to not work anymore, but I just need a push in the right direction. Thanks.
If you use the core one you might need to do more than just run the upgrade shell to make that happen.
I use an enhanced version which should convert everything with a single click.
See "Upgrade using the upgrade shell" #
http://www.dereuromark.de/2011/10/31/freshly-baked-cake2-0-tips/
But most importantly you should always run your scripts from the app dir
app2.0dir>..\lib\Cake\Console\cake Upgrade ...
This way it will find the correct paths

Upgrading Zend Framework - Steps & Guidance

The site I maintain is currently using Zend Framework 1.8.0, which is over 2 years old. I'd like to upgrade to 1.11.11 and am having some trouble finding basic guidelines for how to pull this off smoothly. Is it as simple as overwriting the library/Zend folder with the latest files?
Here are my steps I plan on taking. Am I missing anything?
Download latest Zend Framework code.
SSH into the server and copy library/Zend to /path/to/webapp/library and call the folder something like Zend-1.11.
Put up "Site is down for maintenance page" on our site.
cd /path/to/webapp and then make a backup copy of current Zend version, e.g. cp -R Zend Zend-old
mv Zend-1.11 Zend
Remove "Site is down for maintenance page"
At this point, the /library/Zend folder would have the latest Zend Framework code and I'd have "Zend-old" to switch back to in case anything goes wrong.
Is this the typical way to upgrade?
Things to do before updating Zend Framework:
Read the change log from your current version to the latest version that you are downloading.
While doing so, make sure all your current code will work without any bugs, even minor. Usually all updates are backward compatible. (But sometimes, if there are any major changes around a particular module, you will have a little rework in your code)
If the new version of ZF has a new feature that you can use for your site, modify your site to use it.
Update the framework in your development environment first (by pointing your lib path to the new framework files) and then make sure all parts of your site works the same and all your tests are passing.
Then update your production site with the new version using the same way mentioned in the question.
I went through a much more extreme upgrade going from Zend 0.70 to 1.11 a few months back. What I did was qualify the new library folder with a version number and use the application.ini setting to switch between the 2 for testing.
so
includePaths.library = APPLICATION_PATH "/../library"
would become
includePaths.library = APPLICATION_PATH "/../library1.11"
I found having both entries and just moving a comment was a lot faster for testing. Good luck with your upgrade!
You might also take a look at the ZF-tool.
It is not only the Zend lib that might be replaced with a newer version.
If you replace the Zend lib you beteer type things like zf show version.

Categories