Symfony 2 Config File Types - configuration

I generated a bundle and set it to use annotations for config files. But I find that in Resources/config/services.xml, its still XML? Perhaps it because I cant configure services using annotations? If so how can I make it use yml if thats the case? I could just add a YML file but I dont suppose it will be detected?

Your assumption that you can't define a service using Annotations is correct. You need to have either a services.xml or services.yml under Resources/config for the bundle.
Check out the answers to this question, it covers how to define a service using both xml, yml and through a config.yml import.
I've also written an answer here on the basics of defining a service.

Related

Is there any way to handle exceptions in karate? [duplicate]

In a similar use case as in Read Karate config from YAML I want to read my environment config for Karate from a YAML file. This works well with karate.read. My extended use case now would be the following:
read environment config of common environments from a YAML file which is in version control
have a file with custom environments not in version control and read from that file too
for all environments (based on a ID field) that are defined in both files the custom environment definition overwrites the common one
I now have to read two files but for the file with the custom environments I don't know if it will exist because the user might choose to not have any custom environments defined. Is there a way to check if the second file exists before attempting to read it? I have checked the documentation for the karate object but have not found anything like that.
If that wouldn't be possible, is there another way how my use case could be implemented?
Karate has a built-in way to use dev-env specifc config that may not exist: https://github.com/intuit/karate#environment-specific-config
That said, note that you can catch exceptions in JS, so that gives you some more options: https://stackoverflow.com/a/54554175/143475
try {
// read
} catch(e) {
// print e if needed and ignore
}

Erlang: How to include libraries

I'm writing a simple Erlang program that requests an URL and parses the response as JSON.
To do that, I need to use a Library called Jiffy. I downloaded and compiled it, and now i have a .beam file along with a .app file. My question is: How do I use it? How do I include this library in my program?. I cannot understand why I can't find an answer on the web for something that must be very crucial.
Erlang has an include syntax, but receives a .hrl file.
Thanks!
You don't need to include the file in your project. In Erlang, it is at run time that the code will try to find any function. So the module you are using must be in the search path of the VM which run your code at the point you need it, that's all.
For this you can add files to your path when you start erlang: erl -pa your/path/to/beam (it exists also -pz see erlang doc)
Note that it is also possible to modify the path from the application itself using code:add_path(Dir).
You should have a look to the OTP way to build applications in erlang documentation or Learn You Some Erlang, and also look at Rebar a tool that helps you to manage erlang application (for example starting with rebar or rebar wiki)
To add to Pascal's answer, yes Erlang will search for your files at runtime and you can add extra paths as command line arguments.
However, when you build a project of a scale that you are including other libraries, you should be building an Erlang application. This normally entails using rebar.
When using rebar, your app should have a deps/ directory. To include jiffy in your project, it is easiest to simply clone the repo into deps/jiffy. That is all that needs to be done for you to do something like jiffy:decode(Data) in your project.
Additionally, you can specify additional include files in your rebar.config file by adding extra lines {erl_opts, [{i, "./Some/path/to/file"}]}.. rebar will then look for file.so using that path.

How to configure mod_perl files in apache , i mean where to put them?

There lots of tutorials on the web on how to configure the mod_perl filters
but info i didn't understand and its like no where written , where to put them
and how to tell mod_perl/apache about there path /location .
i mean only the filters part not the ordinary perl files
Filters like any other handlers just need to be in the INC path. Apache looks at the #INC path for any defined filter/handler modules defined. If you have it elsewhere, you could add path of your filter's to #INC through startup file or conf file to let apache know where to look for them before defining them using directives.

Doctrine 2: Convert mapping to YAML with namespace?

I am using Doctrine 2, and a MySQL back end. I am running a CLI command to analyze the the schema and produce YML files. I am using the following CLI command.
php ./doctrine.php orm:convert-mapping --verbose --force --from-database yml tmp_yaml
I then do some processing on the YAML files, and then have Doctrine create entity files from them. However, we need the entities to be in a particular namespace. Right now I just process the resulting entity .php files, but that is a really bad way to do it.
How can I have Doctrine create YAML's with our namespace. If that is not possible, how can I have Doctrine create entities that are in our namespace?
Thanks!!! -Don!
In the docs they say to name the YAML file and the root element with the full name of the entity class, including the namespace (separated by . instead of \)
Be aware that class-names specified in the YAML files should be fully qualified.
That should be it.

How to specify schemalocation for an xsd in local folder, while importing it into a wsdl file

I have a XSD in local , and I need to import the same into a WSDL. I have couple of other xsds too which are already on the production namespace.
Now I have little clue as how to make this XSD that is only in my local to be made available in my WSDL file to test the webservice using soapUI.
So questions, what will be the namespace and how will i provide the schemalocation.
(I am a newbie to wsdl Namspaces, so plz dont mind this basic question. Googling simply does not tell me anything about the how to.)
For the ones that are in Prod its like this:
I found a way, added the schema file to the same folder as of the wsdl file, and stripped of the uri part of the schemaLocation value. It imported well into the soapUI.
But still got the other question, how to host the schema files on my localhost.