Integrate Symfony2 to a Drupal 5 system - drupal

We have a 5 years old system built by Drupal 5. It is not a small system (about 50K lines of code), and most of the functionality has nothing to do with 'content management'.
For this reason, we're thinking about integrating Symfony2 to our current system. The ideal is to keep using the current code for current functionality while developing new features with Symfony2. Slowly we'll move more and more pieces of code from Drupal to Symfony.
My question is how do you suggest implementing this? I though about the following approaches:
Create a module in Drupal. This module will contain the Symfony files and will load the class loader of Symfony. Someone has done this before? are there some critical things I should be aware of?
Create a separate installation of Symfony and hopefully create a different vhost record which point to certain pages in the website. As far as I know I can configure vhost to be a sub-host of my current host (e.g. mysymfony.mydrupal.com). But I can't configure it to point to a specific path in the same domain (mydrupal.com/mysymfony.php). is this true? In this approach the performance would be better for those pages that use Symfony, since it won't need the Drupal bootstrap.
Any other suggestions?
Thanks!

Be aware that you'll likely have to upgrade your PHP version on the machine running Drupal if you'd like to run Symfony2 on the same machine (anything under 5.3.8 and the configurator will object). You may also want to hold out for a bit if you want to stick with Drupal - Drupal 8 is integrating Symfony2 components. Also, there exists (in beta form anyhow), a content management framework for Symfony2.
Regarding vhosts, you are correct - you point a vhost to a directory, not a file. You could however create a rewrite rule to redirect to a specific page, if you wanted (check out the .htaccess file included in the web/ directory in a Symfony distribution - by default it redirects requests to app.php).

Because I'm new here I can't have more than two links in a post. I was also going to say:
I would start rewriting core functionality (users, permissions, etc) if none of the existing bundles meet your needs. As well as searching github, you could try knpbundles.com to find bundles that solve similar problems.

Related

Building a website for a hotel - is WordPress the best idea?

I'm researching to see if building a full website for a hotel be a good idea to do on WordPress.
I read that wordpress is okay but there are better options.
I want to design and code my own front end look to the website, but have the backend on a stable platform that can take all the reservations seamlessly.
My main concern is to be able to have a backup of all the files and easily switch to another server in case something goes wrong.
I can host the website on my server or host with the service you suggest that comes with the platform all together.
Any ideas and/or suggestions are greatly appreciated!
There are other options, no doubt, but yes, it can and is really possible to build it using WordPress as CMS.
If you want to design and code your own theme, you'll need to study the WordPress Theme Structure and, since you'll build it by yourself, you'll also need to develop plugins to create custom post types (aka CPT) to make the hotel management easier on the WP back-end.
About the theme structure, files, child themes and everything, I'd recommend you to read https://codex.wordpress.org/Theme_Development
About the plugins development: https://developer.wordpress.org/plugins/
About Custom Post Types: https://developer.wordpress.org/plugins/post-types/registering-custom-post-types/
About the backup: it's super easy and you can even make a full backup using free plugins via back-end. But if the site goes down you can easily do it via FTP downloading only wp-content folder and the database. It's really simple to migrate from one WordPress to another, or from host to host.
About the hosting, you'll need to use a server if you want to build this project. There's a difference between wordpress.com and wordpress.org
The .com is simpler, you are not able to build everything you want. The .org is the open source project, which you get the files, upload to your server and connect to database (MariaDB or MySQL). Most hosts offer automatic installation for WordPress and, from there, you can change whatever you want and need.
Note: many developers create CPTs INSIDE the theme's code, but this is not recommended by WP as you can see in We recommend that you put custom post types in a plugin rather than a theme. This ensures that user content remains portable even if they change their theme.
WP is not really hard, after 1 week studying you'll see yourself getting over most difficulties. Even if it takes longer, don't give up. There's a huge community to help you with WP questions.
Hope it helps and I'm sorry my bad writing, I'm not an english native speaker.
C ya

Integrate an existing Symfony2 application with Drupal 7?

The future development of my symfony2 project
( which is actually more or less a static website with an authentification system )
would be to provide authentified users a CMS to easily edit text and images / import files / create pages / give acces to their pages as the website grows and evolves.
I have been thinking implementing my project with Drupal would be way forward .
how can i proceed ?
Is doing the reverse better?
what are other options?
I am not sure what you mean by 'the reverse', but there is a Symfony module available for D7. I would suggest setting up a Drupal test bed and seeing about integrating your site into drupal.
It is my understanding that Symfony2 has gone into core in D8, but D8 is probably a long way from initial release.

Managing Multiple Wordpress Sites

Not sure if this is the right place to ask, sorry if its not. I build a lot of Wordpress sites. My problem is, the number of them is getting big and harder to update them all when new releases come out.
I have written an app that will download the latest Wordpress release, and manually ftp the new files to all the clients, but this takes forever... need a new way.
I wanted to restructure this while I can or start a new process at least. Whats the best way to manage multiple Wordpress sites and keep them all updated? Some people have said 1 DB and modded config, others I have seen said to keep all installs separate and use plugins to automatically upgrade, but I don't know whats best to do. Ideas? Thanks :)
If these were all sites you managed on your own server, I'd recommend using a Multisite installation rather than separate instances of WordPress. This way you only have one set of themes, one set of plug-ins, and one copy of WordPress to maintain.
If these sites are on different servers (i.e. you're maintaining sites for clients remotely), I'd recommend you look in to a beta account with WP Remote. This is a service specifically built to allow you to remotely monitor and update multiple WordPress installations. It might be the best solution for you because it allows you to use the one-click update rather than manually downloading/FTP-ing the new files.
You can use this free self hosted app http://infinitewp.com
No limitation in number of sites being managed. You can update WP/plugin/themes, do backups, one click login to your WordPress admin panel.
EAMann is right, especially with the new Multi Site features in Wordpress 3.0, there is no better way to manage multiple sites under one umbrella. Being a developer myself, I know the pain of having to login to all those different accounts!
The way to set it up is create a "master domain name" that you will log into. Place this in your WP Config:
define('WP_ALLOW_MULTISITE', true);
Then login to your admin panel, navigate to TOOLS>Network.
After you've set everything up, copy/paste what it tells you to your HTAccess and WP Config file.
The next step, especially if you are putting clients on this network, is they will want their own domain name, not AIBot.com/theirname right? Thats where Domain Mapping comes in:
http://ottopress.com/2010/wordpress-3-0-multisite-domain-mapping-tutorial/
Check that out and good luck!
What you need is www.managewp.com it can do all of that for you plus a ton of other excellent features.

Hints and advice when moving a drupal site to another domain?

I want to move a drupal site to another domain and am looking for best practices, gotchas, hint, tips, etc to make sure I get through it smoothly.
Links and comments are appreciated.
You might want to give a try to the Backup And Migrate module.
There is also this handbook page that gives instructions on how to backup your drupal site.
It took me 1-2 hours. I do not have a step-by-step guide (I wish I had written everything down), but it entails updating the configuration files, updating the database (some tables have domain references, but I don't recall which - it could be that this was just for my image references in the Gallery2 database), and doing a cursory search of the content for full domain references in anchor links.
I migrated a Drupal 6 site with about 40 plug-ins, including Gallery2 and Google Maps integration, and I did not run into any major road blocks.
If you (and the authors of the contrib modules you used) did a good job by not putting absolute URL's in the code, it should be dead easy (I do it routinely when migrating the development site to a live production one, for its launch).
Of course I assume that you are doing things sensibly, and for example are not migrating a site from an apache/mySQL server to a nginx/postgres one, maybe also adding the need to prefix your DB tables in the process.
If this is the case, then you simply have to copy your entire file tree and export/reimport your DB.
If you are migrating between two similar architectures then chances are you will only have to change a few things in the settings.php file. The file is well documented. The only two things that I normally have to change are:
DB user/pass
cookies domain
In the file there are also additional configuration options like the possibility to choose the base URL manually in case of problems.
Don't forget to flush the cache once you log in the new migrated site for the first time.
EDIT: Just came to my mind: if you use any, you will also have to update your developer keys to third party API's (for example if you use google maps or google analytics) as these are domain specific.
HTH!
Basically, what mac said (+1)
In addition, I often need to adjust the .htaccess files a bit concerning the rewrite rules. For smaller sites on shared hosting environments, I usually place the drupal installations in subfolders within the document root (e.g. to allow for staging, etc.), 'hiding' the subfolder via URL rewriting. So for every 'move' of a site, I need to fix those rules.
The biggest culprit for me are sites that use modules that have to store absolute URLs in order to do their job (e.g. securepages). For those you should disable them prior to moving the site, adjusting their settings before reenabling.
If you are not sure if some of the modules you use store absolute URLs, it might pay of to extract your database dump locally and search the resulting file for occurrences of 'http://', 'https://' and the likes, as well as for your 'old' domain name (you'll need to exclude the watchdog and cache tables for this).

Drupal: xmlsitemap file is not generated

I have chosen XMLSiteMap module from the most popular usage statistics on Drupal site,
so I assume the module is not too buggy. But the map file is absent.
I've installed this module on my Windows machine into drupal/sites/default/modules.
I've activated all the submodules of XMLSiteMap in admin menu.
Per docs, I've also run cron.php manually to create sitemap.xml in drupal/sites/default/files - but it's just not present there even when second re-install.
How can I force to create sitemap.xml?
(also tried with and w/o clean URLs - still no help).
Also, if there any good reliable alternative for this module?
Are you sure you've installed it properly? Please check the Status report (admin/logs/status in Drupal 5, admin/reports/status in Drupal 6) to ensure that you've got everything right.
It's possible that you haven't set the permissions of sites/default/files properly yet for example.
I'm not sure if this will help you, but if you are looking for an actual created sitemap.xml file rather than navigating to it in the browser I don't believe one is created by the module. I think the module creates a menu callback to create the sitemap file, so a request for sitemap.xml is handled by Drupal's menu system, rather than creating an actual file. There will however be a cached version in sites/default/files/xmlsitemap.
Apologies if this is an oversimplification of the question asked.
I have not had any problems with the reliability of the module myself.
Also make sure you have the latest version installed, it just came out yesterday:
http://drupal.org/project/xmlsitemap
Also, see this issue, seems related to your problem:
http://drupal.org/node/458546
I'd probably recommend trying the 6.x-2.x branch which I've been rewriting to kind of solve all the annoying bugs and architectural problems of the 6.x-1.x branch. It's currently incomplete, but it works for nodes and menu items currently. Taxonomy terms and user profiles will be added soon.
You can find the link to it on the project page. Sorry I can't link since I'm a new user. :)
Running the CRON worked for me:
/admin/reports/status/run-cron

Resources