How to use Event commands Symfony standalone in my Project? - symfony-3.4

I have a simple project, and i need implement the Event Symfony 3.4 standalone, however i don't understanding, how to implement it?
Sorry, for my bad english, i'm still learning...

I used php-DI to pass the required dependencies, and I made the abstractions necessary to build the dependencies that Symfony / Events defines.

Related

Is it possible to integrate Webpack/VueJS with the Odoo Framework (v12)?

I'd like to integrate VueJS through WebPack in one of my custom Odoo modules, and have it start up automatically when I launch Odoo-bin.
Does anyone have a solution?
Is it even possible?
I know you can include VueJS as a simple .JS file in the module's template, but that means I can't use the .vue components supported by WebPack.
I also read that Odoo has its own JS framework, but I couldn't find good tutorials/documentation for it.
EDIT: To anyone that might be wondering how I solved this, here's what I did:
I initialized a package.json file in the root of my Odoo folder using npm init. I added a start script to the package that launches webpack and bundles all vue components in myAddons folder (where I store my custom modules), then launches Odoo through the python odoo-bin ... command. All that's left is to use npm start to start it all up.
This way, the vue components get bundled into single JS files, that I then add to the templates of my modules. This has a small inconvenient in that the first bundle has to be done manually in order to know which JS files need to be imported to the templates. Also, i'm still trying to figure out how to bundle the components of every single module separately. Will update this once I find a proper way to do it. ...Hopefully.
By default, odoo frontend part is heavily built upon backbone, jquery, underscore. If you want to use any other JS library, you have to make sure the compatibility in between them. The odoo backend parts of JS functionalities are written under web module can be found in odoo/addons/web/static/src/js directory in odoo community codes. The ecommerce/website part is under website* modules.
Along with the fact that the Odoo JS API documentation is basically non-existent (as of the time I am posting this) .. I would add the fact that its going to be like working with a moving target compared to calling Odoo's JSON-RPC API directly since their JSON-RPC API changes very little over different versions of Odoo.
Moreover, making JSON-RPC API calls with Axios is extremely simple. So just go directly to the server's JSON-RPC API from your Vue project.
This is what I am doing with at odooinvue.org which is basically a Vue project that uses Odoo in the back-end. That project is designed specifically as a resource for Vue developers that are trying to use Odoo in the back-end but have difficulty because they are new to Odoo development.
I suggest trying #StartupGuy's odooinvue, which is really nice.
With Odoo 14 they created a new modern frontend framework: Owl framework.
I have not tried it myself.

Ionic2 client + Meteor server, which approach is better?

I want to have Meteor as a server and Ionic2 as a client. I currently have a headache with authentifiacation. It seems that there are two different approaches:
First is use of Meteor server and Meteor client with ionic-angular library. This approach described here
https://angular-meteor.com/tutorials/socially/angular2/ionic2
I guess the advantage of this method is use of Meteor native architecture, on the other hand I guess we're using Ionic2 just like a subframework and maybe loosing some stuff from native Ionic2.
The second is using separate Meteor server ('client' folder deleted completely) and native Ionic2. This approach described here
https://angular-meteor.com/tutorials/whatsapp2/ionic/authentication
This option is vice versa: use of native Ionic2, but it has to use libraries like meteor-client-side, accounts-base-client-side, accounts-password-client-side etc, which I'm not sure are native for Meteor.
The first approach looks better, because there is a ready-to-use UI component for authentification. But I wonder what issues I would have, when I come to the step of completing my applications for different types of devices.
Thank you in advance for your help.
These approaches are essentially the same for the authentication itself.
What you are pointing out is more about what mobile platform to choose to develop and run mobile projects.
In the first case, you use Meteor's built-in Cordova platform to run the app and Meteor's compiler and bundler plugins (like TypeScript package or Meteor core packages for Babel and UglifyJS etc) to develop the app. In the second case, you develop and run the app solely on Ionic 2 CLI.
But from the app logic point of view these approaches are absolutely same: you import the same Ionic 2 components and use the same Meteor packages with the only difference in the second case is that these packages are now NPMs not Atmosphere ones (essentially though they contain the same scripts since these NPMs are built from Atmosphere packages).
The reason why What’sApp clone is built in that way that differs from the Socially’s one is simply described in the README of
the What’sApp repo (see https://github.com/Urigo/Ionic2CLI-Meteor-WhatsApp). If to repeat: since Ionic is a one of the best Web frameworks that specializes solely in building mobile apps, it’s reasonable to guess that it’ll be (and likely it is) much more powerful in building them than Meteor itself. From that point of view the second approach seems more future-proof, I would say. You could think even of building your project in some way that will allow you to substitute Meteor easily with some another framework if you decide to use it at some point in the future.
If you are though concerned about using those NPMs mentioned in the second case (e.g., if the process of building them doesn’t look transparent to you), you could try this project https://github.com/Urigo/meteor-client-bundler to bundle Atmosphere packages you need into separate scripts and use them after.

How to go about integrating Foundation framework (for front-end) into Yii framework (for back-end)

I want to integrate the Foundation (5) front-end framework with the Yii (1.1) PHP framework for developing a web application.
Since i am new to both of them and learning to use it as i move along with the development, I am unaware as to how will i be able to use both of them for the same project.
Logically speaking i understand that the Foundation 5 directory has to put into the Yii project directory structure. But i am not sure as to which directory to use in Yii project for that.
I tried researching on the web, but since i am new i am not able to understand which is the right way to go about achieving what i intent to.
Step by step instructions to do it would be appreciated. Thanks in advance.
First you have to realize that Foundation is just a collection of html, css and javascript. So you use it like every other html, css javascript in Yii.
Then if you are learning do not create something yourself for now. Use something that somebody else has done: http://bootstrap3.pascal-brewing.de/ Here are instructions for using twitter bootstrap (another kind of Foundation) in Yii. With examples and everything. Start using it, be happy that you manage to do stuff right away... study the code when you get stuck, understand what happens in there.
http://yiifoundation.2amigos.us/
They have done a good work in packaging it as an extension for yii.

How to make JOGL OSGI bundles with native libraries loaded correctly?

I've been trying for days: http://forum.jogamp.org/JOGL-with-OSGi-td3773888.html#a4029139
This library has native dependencies embedded in jars.
http://search.maven.org/#artifactdetails|org.jogamp.jogl|jogl-all|2.0-rc11|jar
http://search.maven.org/#artifactdetails|org.jogamp.gluegen|gluegen-rt|2.0-rc11|jar
Can you provide detailed instructions to make osgified versions of this?
It would be nice if you can use bnd http://www.aqute.biz/Bnd/Bnd or bndtools http://bndtools.org/ in the process.
I've tried to make a gigantic bundle with everything embedded, but I cannot make karaf to find native libraries: I keep getting the error "no gluegen-rt in java.library.path"
I tried to make a fragment bundle but cannot make the pieces to match... Tried with bnd, tried with eclipse. Need help from more experienced people.
I have been trying to use that with Apache Karaf, so it would be excellent if you can make that work with Karaf 2.3.1
If you know how to do it with Eclipse RCP 4.2 then please help!
First of all this isn't a Karaf specific issue, you might want to start with a unit test first, using pax exam. For your issue you need to make sure the native libs don't have dependencies to each other.
You might be interested in the following links.
http://robertvarttinen.blogspot.de/2008/12/bundle-nativecode-in-osgi-manifest.html
http://holistictendencies.wordpress.com/2011/03/28/bundle-nativecode-using-platform-specific-dlls-from-osgi/
Load DLL (using JNA) inside an OSGi bundle

Ninject and MonoDroid

Anyone had any luck getting Ninject to work on MonoDroid? i've tried the 2.0 and 4.0 mono builds from their website and also tried the .net versions.
With the Mono builds i'm getting a MissingMethodException in the instantiation of my StandardKernel
I am experimenting with Ninject on a combined WP7/Monotouch/Mono for Android project and Ninject works surprisingly good.
I used the latest sources, which contain a project file Ninject.WP7.csproj which seems to be outdated. It contains a lot of DefineConstants. I created new WP7/Monotouch/Mono for Android solutions with these constants and everything compiled and works!
Constants used:
SILVERLIGHT,SILVERLIGHT_40,NO_LCG,NO_ASSEMBLY_SCANNING,NO_WEB,NO_PARTIAL_TRUST,NO_SKIP_VISIBILITY,NO_EXCEPTION_SERIALIZATION,NO_DEBUG_SYMBOLS
not sure if they are all needed, but the SILVERLIGHT one is important because Monotouch/Mono for Android implement a large part of the Silverlight api.
Of course you cannot create Android Activities with Ninject. I use it mainly for constructor injection, to create .Net objects like a ViewManager, view models using a repository, etc., the usual things you do with dependency injection.
I haven't tried to get Ninject working, but I'd be very surprised if it just worked out of the box. If there's a Silverlight build of Ninject you may have more luck with that, but there are no guarantees. The "best" way to get support for it in Mono for Android would be to build the code against the Mono for Android profile as a class library.
That said, there are other options out there for doing service location in your apps. I have a blog post up here that talks about using TinyIoC and Funq for service location.