I'm trying to integrate a legacy application in symfony fullstack.
Because of poor infrastructure I have to stick to symfony 2.8.
Everything works so far, but i think i maybe have a problem with sessions.
(I read the symfony articles about integrating legacy sessions and tried everything)
The Toolbar says "You are not authenticated".
Normally there is "Authenticated anonymously".
This is how it should look.
(Screen from a plain install of symfony2.8 in the exact same version i use)
What are possible reasons for that?
Thanks for your help.
Somehow the legacy application failed and directly rendered a response from within an event listener. I can't really explain it, but now it works.
Related
I've a slimframework v3 application that provide REST API for an Angular application.
I want to upgrade to v4, but there's quite a lot of changes and the upgrade page, while it mention what is changing, it's pretty dry on how to make those change and get a working application at the end.
For example, it says the new App() no longer takes the settings... ok... where does the settings go now ? Likely in the Dependency Container but this is changing too.
I fear that I will do a lot of code change and get a non working app and will spend ages on figuring out what's wrong.
So do you have any suggestion on how to proceed, step by step, to achieve a working upgrade from 3 to 4?
I've googled a bit, but I didn't find some walkthrough/tutorial on this subject.
I've managed to perform the upgrade.
It's way too long to document it here, so I've made a blog post here :
https://blog.mansonthomas.com/2019/11/upgrade-slimframework-v3-to-v4-how-i.html
I'll improve the article (readability & content)
I am developing project witch has console logic, restfull API, admin and client websites.
I have started building all of them in single ZF2 application. I am using Application module for client website and console logic, API module for API and Admin module for admin website. And then I have started writing unit tests I realized that then I am calling some part of my code every module is being loaded (for example when I am calling console script witch only works with emails via IMAP my api documentation tool swagger is printing warnings about no server name).
I think this should decrease app performance and changing one part can break another. And also all parts are really diferent(Console, Restfull, and html output. different plugins, vendors ect.).
And now I think how can I solve this problem. I would like to keep the structure:http://mysite/api for API, http://mysite/admin for admin, http://mysite/ for client site and php index.php action for console scripts.
How I should solve this problem? Should I split all those parts to separate ZF2 applications, or should I use same project but, some different autoloader. Or maybe there is some other good practices?
Don't rearchitect your whole application to fix a performance problem you think might exist. The module bootstrap overhead for ZF2 is quite low. If your modules really have no dependencies on each other at all, try benchmarking your application as a baseline, then try disabling one module to see what difference it makes. If it doesn't make much difference, I'd keep it as it is.
I've got a huge site that has been written (in a very bad way) in symfony 1.4
now, I've been asked to make some substantial changes to the navigation flow, add some features and so on..
considering the effort, I was wondering if it would be better to take the radical decision to port the entire website to symfony 2.0, but I'm not sure how hard that it could be.
Has anybody ever done this before?
Do you have any suggestion to make for patterns to follow, or tutorials or doc or whatever?
You may wrap your legacy project in a brand new sf2 project, by using this bundle. This way, you'll be able to migrate your project one piece at a time, and new functionalities may be developed with sf2 as soon as you get the wrapper to work.
You may be interested by this post about migrating
Here's how I would go about it:
You need to learn and study some things first:
HTTP fundamentals
PHP namespaces, which are heavily used
Symfony2 documentation
Symfony2 documentation
Symfony2 documentation
PHPUnit documentation
Then when you get the hang of Symfony2, you need to find out what to reuse from your old project:
Models, business logic?
Did you use Doctrine in symfony? If yes, look at how to port your entities to Doctrine2, and learn about the differences. If you used Propel, I would look at switching to Doctrine2 and not use the PropelBundle, atleast until you get used to Symfony2. You can find better documentation and sample code out there for Doctrine2.
You also need to convert your old helpers classes to Symfony2 services.
Views?
Symfony2 uses Twig as templating engine, but you could go with pure PHP.
Controllers?
This should feel somewhat similar to symfony. The flow of Symfony2 matches the HTTP flow, meaning you get a Request object and must reurn a Response object.
It really depends on how well structured our old project is. Symfony2 is an entirely different beast than 1.0-1.4. I would probably not call it a port, but a rewrite - however, if your old project is well structured you could probably reuse quite a bit.
Without actually seeing your code, it's impossible to give a good answer on how hard it would be. It's very much doable, but there is no easy route. Symfony2 is, IMHO, the way of the future for PHP projects and in the end you will get a project that is much easier to maintain and support.
I am in the process of planning a custom web application which will be sold (not SaaS) and so will be required to be installed on different servers. Do you think it would be a bad/good idea to go with Symfony2 or Zend Framework.
I have to choose 1 and can't go with any other framework as I only have extensive knowledge with both of these. Despite my experience with Symfony2, I would still appreciate another opinion.
My main concerns are ease of install on servers and source code protection. Sadly, it would seem ZF already has this going for it in that you don't need 5.3 like Symfony2, and we have Zend Guard.
Any advice is welcome! I am looking to nurture and grow this app and I really want to be sure the first step is the right one.
The Symfony2 download page still says:
Be warned that Symfony 2.0 is not
stable yet; use it with caution
(current version is Beta 1).
So I would wait just a but for Symfony2.
I'm not sure what you mean by source code protection but there is no point in encoding any part of any of the two frameworks since they are both open source (and you should see if their licenses actually do permit that!).
Zend Framework 2 is still in the oven and for the looks of it, Symfony2 will be out of beta way before ZF2. If you can't wait, then use the one that you are most comfortable with. Otherwise, wait for Symfony2 to come out of beta and then wait a little bit more until they iron out it's bugs.
Now, about bundling the framework in your application, you are probably going to need to write an installer of sorts. You could first look at the "sandbox" version of Symfony to see how they did that. It's basically an unzip-it-and-it-works kind of install. No need to set anything up. That could give you some pointers.
Whatever you do, you'll need to write a minimum specs script that users can download and run to check whether their system has everything ready to run your app (check configs, php modules, etc, etc). See SlideShowPro Director for an example of such scripts.
Subjective answer: I'd go with ZF because that's what I know better, but having said that, performance wise I've had better results with Symfony. Apparently ZF2 will have see huge speed improvements.
I would like to know about the compatibility between upcoming versions of KO3. I have heard that once 3.1 comes in, it won't be easy to simply upgrade to it from kohana 3.0 (Wordpress upgrade is pretty swift from 2 to version 3)
If I create my project in KO3 (currently using 3.0.6.2), what are the chances that my project will be easily upgradable to 3.1 or above versions without breaking anything ?
Please answer if you are a real pro on KO3 or part of the development team.. This is important.
Major versions (eg: 3.0 to 3.1) may change the API. Currently, the biggest API change will be splitting the Request class into Request and Response, as well as changes to Request that allow external routing. This also implies that the Remote class will be significantly modified to removed completely in favor of external requests and responses.
You can keep track of the changes scheduled for 3.1 by following the 3.1 roadmap.
I'd just like to point out that wordpress is an entirely different system, it's basically an application written on their own framework whereas kohana is just the framework and you supply the application.
If the wordpress core framework changes then they also change their application to account for those modifications. Sometimes plugins aren't compatible across upgrades so the plugin author has to release an update which makes it compatible. All of this is hidden from the front end users, they don't need to be aware of how it works in order to use it.
Kohana on the other hand has no gui or front end, you're getting nitty gritty with the code. If an interface changes then you'll have to adapt your implementation to suit, there's no way around that.
And as antpaw said, unit tests are always useful for making sure things work as expected! For more info see the unittest repo
it highly depends on the features your have used. give it a try and watch your logs or even better: you run unittests. http://github.com/kohana/core/compare/3.1...master if i picked the right repository. this will help you to see the difference betwenn ko3.1 and ko3.0.7