CakePHP v2.x - More then one set of config files - cakephp

I have "inherited" legacy CakePHP application which should be now deployed to multiply clients. I have search through the documentation for the version 2.x, but I was unable to find the following:
How can I easily store the different Config files for different clients? The reason is simple, each client will have different database details, different email setup ...
Should I have a default folder and for the other make a duplicate folder named Config_another_client_name folder and inside have a copy of those files? Does anyone have a better idea?

Related

Customize React app build for different Firebase projects (environments)

I'm building a web app using React with a Firebase backend.
I want to be able to deploy my app on different environments (staging, prod). To do this, I have added my app to 2 different Firebase projects, one for each environment.
What I want to be able to do is to deploy slightly different cloud functions depending on which environment I am deploying to. I want to automate all this for CI/CD.
Is there a way to specify different functions/ folders for each Firebase project, or is my only option to have a script that moves the correct cloud functions code to the functions/ folder on deploy? Similarly, how can I have different Firestore rules for each environment?
Thanks for the help.
Your option, as clarified in the official documentation here, is to add the following lines into your firebase.json file to specify different paths.
"functions": {
"source": "another-folder"
}
Since the firebase.json is individual for each project, with this lines, you should be able to set a different folder for each one of them, so they reference different files for your functions.
Regarding Firestore rules, due to the fact that they are in separate projects, you can access the Firestore Console and configure the security rules there. Each project will have their only set of rules for you to configure. You can get more information on how to structure them in this article here.
Let me know if the information helped you!

Share sqlite database between app and extension

I have followed this tutorial and added my database. I did target both my app and my extension. From my app I can SELECT, INSERT, DELETE and UPDATE to the database. I want both my app and extension to share the same database. So I add information in my app and then show that information in the extension.
As it works now (I have tested) the app has one instance of the database and the extension has one instance. I have only added one db. Anyone got a clue why I have two instances of my database and why I canĀ“t access the data added from the app in the extension?
Apps and their extensions are separate processes, so iOS sandboxing normally means they can't touch each other's files. The page you reference doesn't appear to address this in any way.
If you want to use the same SQLite file in both your app and the extension, you need to configure the "app groups" entitlement for both of them. That sets up a new directory that both of them can access, and you put your SQLite file there. You find this directory by using the containerURLForSecurityApplicationGroupIdentifier: method on NSFileManager.
It's not clear to me whether the GitHub project you're using will make use of app groups. There's no other way to share your SQLite file, though. If that project doesn't use app groups, you'll need to either fix it so that it does or stop using it.

CakePHP: Manage development and production environment

I'm using cake php with an svn repository and i want to manage my app using
a development and production environment.
Is there a better way to do this than make 2 domain, 2 databases and merge files modified
from development to production?
Thanks
you can create two svn repositories ...one for development purpose another for production.
And while doing that you can have the same database for both of them or it can be different (that actually depends upon your personal requirement) and you can have a different domain for the two..you can manage the domains by defining the absolute urls in core.php of cakephp and similarly manage the database connection with database.php and can make different database.php and core.php for respective environments. Once you are done with the development phase you can export the whole code into production environment and can change your core and database files

How to access logback.xml from external folder

I'm using logback API for logging in my project but requirement is there will be single logback.xml configuration file for two project and logback.xml should be access from outside of project.
I have placed logback.xml in my project class path and this is working fine. Can any body suggest me how can I access logging configuration file from external folder?
You might find section of the Logback FAQ helpful: Is it possible for multiple JEE applications to share the same configuration file but without stepping on each other's toes?
In short, you can use any configuration file you want (provided that your Java application can access it) using JoranConfigurator.doConfigure("/path/to/your/config/file.xml"). HTH!

Can two apps have same .xap file name?

I have developed a paid app for WP7. Now, I am creating free version by slightly modifying it. Can both the apps have same .xap file ? Will it not create any issue for the users who have both the versions ? How to modify the name if required ?
The xap name isn't important, as each app is deployed to a different folder on the phone. Just make sure that both apps have different icons and different names or they'll fail the certification.
They can have same XAP name or assembly name or namespace, but make sure the ProductID is different when testing and debugging. Otherwise you'll overwrite the first app when deploying but the second app.
By defining two different ProductIDs you are able to deploy them side by side and test them as two different apps.

Resources