Integrating an Orchard module that depends on NHibernate 3.x - nhibernate

We have an existing site that we would like to convert to an Orchard module. The module will need to continue to use it's own database and data access.
Is it possible to use a different version of NHibernate (3.2) to that of the Orchard Framework and what extension points can be used to hook into Begin/End requests so that ISessions can be managed?

Sorry, no, that is not possible. Or at least very very very difficult. Probably not worth it.

Related

Piranha CMS How To Extend

I've just started looking at Piranah as a way to jump start a personal project. It looks great, but I would like to extend some of the models. For example, have an physical address field for every bog post.
What is the best way to add that, without causing issues when upgrading later?
Given that you’re using the latest version of Piranha for .NET Core the content types are very flexible and you can extend them in many ways through the framework. You can find good documentation on this here:
http://piranhacms.org/docs/basics/how-to-setup-content
If you’re using the legacy version of Piranha (2.x) you can read about it here.
http://legacy.piranhacms.org/docs/extend/page-post-types
The content model of the latest version of Piranha is far more flexible.
Best regards

how to convert yii 1 application to version 2

We have website which built in yii 1.1 version, now we would like to convert it to version 2. But we already have a lots of functionality and we do not have much time to do everything by scratch in yii 2. please do suggest.
I don't think there is a fast way of converting or migrating from Yii 1.1 to Yii2. They are similar in some ways but different enough.
I would recommend you first read most of The Definitive Guide to Yii 2.0, which includes Upgrading from Version 1.1.
In my opinion the best you can do is try to replicate the same modules and their functionality one at a time, trying to reuse as much code as you can from the 1.1 version. A few things that i think would be important are:
Create the new Yii2 models using Gii and adapt methods from your Yii 1.1 models. Edit and add validation rules as needed. There are many rules that might not have been available in Yii 1.1, however it can also be true the other way around.
Generate Yii2 modules with Gii. Just need these to create a better project structure. If you didn't use modules on Yii 1.1 i would recommend doing so for Yii2.
Generate Yii2 CRUDs with Gii inside the corresponding modules. This will help generate the controller, actions, views and search model needed for basic CRUD functionality. After that, you will need to edit the views and controller to fit your needs, which you can use your 1.1 code for reference.
Install needed extensions and widgets using composer. Many extensions from Yii 1.1 have updated versions for Yii2, but for those that do not you will have to find substitutes, which shouldn't be too difficult, although you will most likely have to read the documentation for both familiar and new extensions.
In the end you will need to spend time to have a Yii2 version of your website, there is no easy and fast way to jump
You don't need to convert your application completely you can use both at same time please have a look to
http://www.yiiframework.com/doc-2.0/guide-tutorial-yii-integration.html

Another instance of symfony2 for API

I'm developing medium/large project and currently I will have to write API for it.
Project is currently on 2.2.11 because it don't need to be on the newest version and because of many installed modules it's hard to not crash something or module integrity can be broken.
I have found symfony rest edition https://github.com/gimler/symfony-rest-edition which looks pretty nice. The question is, installing another instance of symfony2 (with DB from my project) only for API is good practise? Or doing it in my current symfony instance is better option?
It's not bad, many instances can be plugged to the same DB.
As you will share entities between those 2 instances, you should isolate them in a bundle that is embedded by the 2 instances, and versioned apart each instance. So that entities and repositories are shared and synchronized between the 2 projects.
You should check out dependencies of the symfony-rest-edition and try requiring them in your project. It's quite possible that you can get most of the components in one project, without having to duplicate code or adding deployment stages.
For example, the master branch of FOSRestBundle supports Symfony ~2.2, see composer.json.
And globally, having duplicate code is not good. It's better to have everything in one project rather than dividing it. What if you'd have to change an entity or introduce new business logic? You'd have to make the change in two projects instead of one, or subdividing the codebase.

Can modules(extensions) be modified in Yii?

I am new to Yii framework, and just came across extensions provided by Yii. But I am confused whether we can modify the extension which are provided by Yii.
For example I am using Yii-user module, Now if I want to change the registration form provided by this module, So can I directly change it(by changing the files) ?
If - Yes: Will there be any problem while upgrading Yii version ?
If - No: How can be change it(May be from our custom file) ?
Yii-user module is provided by the community not an official yii extension, yes you can modified by replace it with another view file, if you mean a class the best way to modifie it is by extend it and override the methods you want to change.
Hope it helps
Yii is designed to build custom solutions, you should feel free to modify anything that is part of the generated 'site' including extensions and everything in the protected folder. However, conforming to the psyche and standards of coding used in Yii is certainly a good practice to benefit fully from the framework and you can only get into a habit of doing that after developing and re-developing with Yii over a period of time.
Upgrading Yii version updates files in the framework directory only so its safe to make changes in your site part.
You cannot upgrade that individual extension if you modify them directly(as now you have your own custom version). extending an extension as suggested by Cherif is a good option if you want to keep upgrade-ability for the extensions (protected/extensions).

Sitefinity 4 custom modules: OpenAccess necessary or not

With Sitefinity 4, is it a must to use OpenAccess, is it recommended, or is it just an alternative option?
OpenAccess is the ORM used by Sitefinity, so it is certainly recommended and encouraged. However, if you are developing your own modules, user controls, etc and want to use your own data source you're free to do so. Check out this example on building a simple hello world module for Sitefinity 4 that doesn't use openaccess at all.
I hope this is helpful!