Is there a known tutorial that shows how to create a plugin system for symfony2?
Something like the big cms' have, a folder in the root directory where you can place your plugins.
Google just made a fool with me because the symfony1 bundles were called "plugins".
I imagine plugins to be just bundles, but not in the src but in the new plugins one.
They should be registered at runtime.
I believe you can use Event Dispatcher from Symfony to achive want you want. The below link might help you.
http://symfony.com/doc/master/components/event_dispatcher/introduction.html
I don't have any guide to explain how to use this for plugin system as I am personally looking for it.
Related
I apologize if this has been asked before, but after doing some research, I could not find any resources answering this specific question of mine.
I'm trying to use the Redux framework in my WordPress theme. I used the builder to get started, which is linked to on the plugin page. I customized my framework there and chose the option of "embed only" (Embed Only: TGM is not used and Redux is embedded within the theme/plugin). I also exported as a custom theme, which uses Underscores. As a result, I now have admin directory inside of my theme, with an "options-init.php" file in it. I've been modifying this file to add my options. Is this right? In the documentation it mentions to look for a sample-config.php file, and to copy that and modify it, but I can't find that anywhere. I want to make sure I'm doing this right before I get too far and find an issue.
Also, how do I make sure the framework stays up to date with the latest security patches? Is it a better idea to install it as a plugin rather than embed it in the theme itself?
Lead dev of Redux Framework here. It is very much a better idea to run Redux via a plugin if you want your users to have security updates.
Another option is to embed redux, but to use TGM to suggest for users to install the plugin. This way your theme is not dependent on Redux, but the moment they install the plugin, that version of Redux will take over.
It's up to you, but the plugin is the way to go.
I am new to Wordpress. but I know Joomla very well. I was trying to create a plugin which have front-end and back-end maintenance section. I completed my back-end section and I am on the way to front-end section. But I struck with some doubts. My doubts are, I found two method to implement a front-end page. One is copying the php page to template directory and assign the template in the add page section. another is create short code in plugin and add some tag inside the page section.
My doubt is which one is the correct way to do this in Wordpress?
In Joomla this is done by a component which have different views and controllers very easy to manage!
Please help me.
There's a 3rd, more code way - use filters, hooks, etc. You can actually create your own views and controllers in your plugin's folder, just learn how to use your own code in different page lifecycle stages.
Tom McFarlin's tutorials are great for learning this (proper) way of developing custom functionality with WordPress. Check them here:
http://tutsplus.com/authors/tom-mcfarlin
I have been developing plugins for WordPress. Most plugin I have developed with two three classes and not so huge like Buddypress, WooCommerce or etc.
I am planning to make two open source plugins to deliver some sort of complex system (detail can't share you at the moment but later during the development) where other developers can customize functions and system for them need same as Buddypress and WooCommerce.
As I check those plugins files and realize they have register them own action and filters which developers can modify as per them need. But my problem is unable to understand completely how I should write the plugin where other developer have flexibility to override plugin function as well as they can add them own.
I know it is difficult to give definite answer but I need some sort of start-up guide so I can go into right direction. Do I need to register my action and filters? If yes how to do? if not than how can I do?
Your hint will help me a lot... Thanks a lot
You can check WordPress-Plugin-Boilerplate, it should get you started on the right path.
It may be useful to use wp-cli for generate plugin like so:
wp scaffold plugin my-plugin
Or using "WordPress Plugin Boilerplate" for more complex works: https://wpbp.github.io/wiki.html
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.
I'm using Symfony2 and the FOSUserBundle to manage registration and logins. I'd like to add a captcha system. Is there are pre-existing bundle or tutorial on this?
Of course, I could try to roll my own using Google re-captcha. In that case, is Google reCaptcha a good choice, or should I use some other API?
There are indeed a bundles for that, take a look at:
CaptchaBundle
Or
EWZRecaptchaBundle
Both got (most likely) all the documentation you need added in the README.md file or extended documentation.
I just wrote a tiny bundle called caitcha-bundle.
According to this part of the fos user bundle documenation implementation should be quite easy because you only have to activate the caitcha bundle and add $builder->add('caitcha', 'caitcha'); to the form type.
Because captcha images and any other approaches that require some user interaction which is not related to the form itself are very annoying in my optinion, I tried to implement an invisible bot protection by using the honeypot method and a check for the time it took to fill in the form. It works well for my use cases but still has to be extended by more checks I suppose. I would appreciate any suggestions to improve this bundle.