I had like to install a bundle in Symfony : FOSUserBundle
All search end up using composer.
I'm working in a company behind a proxy with authentication.
I can't write down my password in a config file as it would be on a shared files server.
So, i'd like to install a Bundle without using composer. What is the best way to achieve that task ?
Thank you for reading my poor english and spending time answering me.
FoW
You can deploy the same project on your local machine, install all vendors using composer, and when it is set and done - upload all project files to the shared file server.
i dont know why you have to store your password in a config file. If you working behind a proxy, you have to type your password only in installation. If you don't want to use composer you have to download the bundle and add it to AppKernel.php. but the problem is that if your bundle depend of other library you will have some noise.
Related
I have integrated a Service Worker for receiving Push Notifications in my TYPO3 Extension.
Now I want so send Messages form backend to the clients web-push-php Library.
But how it is possible to integrate the library and its dependencies to TYPO3?
If you set up your project with composer you can just require minishlink/web-push and start using class Minishlink\WebPush\WebPush.
In case you‘re running in "legacy" mode (i.e. classic install without composer) or want to support both you‘ll need a different approach. IMO best practice is bundling composer requirements in .phar files - this way you can keep your IDE clean and your VCS footprint small. There‘s a blog post with a detailed description about phar bundling in TYPO3 extensions.
This method works for most composer requirements following PSR-0 or PSR-4 and should be viable in your case as minishlink/web-push seems to follow PSR-4.
You can even advance this by using scripts you can launch by running composer run <script> in your extension‘s root folder. TYPO3 extension typo3_console holds a composer.json defining such scripts.
If you need to run your extension in a TYPO3 6.2 environment you‘ll need to remove composer.json from extension folder as 6.2 fails coping with "real composer requirements" (i.e. non-TYPO3-extension packages).
Probably a silly question, but I cannot find any good advice on the internet so far, so hopefully you guys have some good advice. I would like to use GIT for version control and use it to deploy changes to my websites to the server(s). It's easy when I use NodeJS, but a bit more complicated when using a CMS system, to my opinion.
When I use NodeJS
When I use NodeJS it's quite easy to have a node_modules folder which contains all the external libraries which I will install on deployment. The rest(my own files) will be saved on Github and deployed to my server if changed. Obviously I will not store the node_modules folder on my Github account or send it to my server (node modules will be installed on the server, on deployment). So it's pretty easy to keep those two (third-party an my own files) seperated.
When I use Wordpress, Magento or something similar
Now it gets complicated. Mostly because CMS systems like Wordpress have a folder structure like wp_content/themes/theme_name/, so your own theme files are more or less entangled with the core structure, instead of separated like NodeJS. And it doesn't seem right to commit all my core files to my Github account as well or send all those core files to my server on every deploy (I would prefer to install them using composer or something, serverside), because I'll never touch the core files, obviously.
So is there any advice? Is there a better whey to handle this? Maybe change a configuration file with the path to my theme folder or something?
The best way to do this is to move your wp-content folder outside of your standard installation. I tend to have a folder called "wp" with the basic WordPress installation in it and a folder called "wp-content" at the same level for my content files. You can then tell WordPress that your content folder is elsewhere with the following:
define('WP_CONTENT_DIR', dirname(__FILE__) . '/content');
That goes into wp-content.php which you can also take out of the main WordPress install (and thus add to git) and place at the same level as your folders.
To make things even better consider looking at composer https://getcomposer.org/ and using that to bring in WordPress core and plugins https://wpackagist.org/ is your friend here. This guide got me started on using composer with WordPress and its a good start https://roots.io/using-composer-with-wordpress/ you can pull in your theme from git as well via composer which is great for when you deploy etc... Capistrano for example can run composer on a server :)
I'm supposed to edit an existing web application built using symfony framework. so now I have to learn to use symfony framework. but I'm having trouble installing the framework. the download button in symfony.com/download/ seems to be broken. when I click it, it doesn't download anything. it's not because javascript is turned off or anything like it because I can still download other things.
I ended up downloading the file from softpedia and I'm not sure if it's the right file because the contents are different from the tutorial video I found on youtube.
can someone point me to the correct (and working) installation file?
P.S.:
1. I have never used nor installed any php framework. I've only developed websites using flat php and wordpress
2. I don't have access to command prompt because my office admin isn't allowed to give a staff an administrator privileges
thank you
Direct download of the Symfony2 framework
If you haven't access to the command prompt you could directly download the Symfony 2.7 package from: http://get.symfony.com/Symfony_Standard_Vendors_2.7.0.zip
In this case the best way to move the first steps with Symfony is to use an IDE (like PhpStorm or Netbeans).
Using the command prompt
However, the best way to install and configure a Symfony2 project is described in the official documentation as follows:
$ sudo curl -LsS http://symfony.com/installer -o /usr/local/bin/symfony
$ sudo chmod a+x /usr/local/bin/symfony
Then you could use the Symfony binary to build the right scaffolding:
$ symfony new my_project
I have almost finished the development of a project developed with Symfony2, and wish to put the project online.
However, I suppose there are a lot of things that need to be done so that everything works ok. I suppose, the dev mode needs to be disabled etc....What needs to be done and how?
What are the most important things to do on a Symfony2 project that will be available to everyone on the web?
I suggest you to use Capifony for deployment. It does a lot of stuff out of the box and you can make it run any custom commands you need. See its documentation for details.
Regarding the dev mode, unless you've removed the IP checks from app_dev.php, you don't have to worry about deploying it. Of course, if you wish, you can tell Capifony to delete it on deployment.
The best way to handle deployment is to create "build" script, which will:
Remove all folders and files with tests from your bundles and vendors.
Remove app_dev.php file
Make sure that app/cache and app/logs are fully writable/readable.
Packs your project into archive (rpm f.e.)
Then, before deployment, you should create tag in your project - so it will mean, that certain version of your application is released (I recommend to follow this git branching model).
Create tag.
Run your build script
Upload archive to host
Unpack
Enjoy your project
Im currently researching the same thing.
The first thing you have to consider is "how professional" you want to deploy. There are a lot of tools you can use:
Continous Integration Server ( e.g. Hudson, Jenkins)
Build Tools (e.g. Phing, Capistrano --> Capifony, Shell scripts)
Versioning Tools (e.g. Git, SVN)
I think the simplest setup is using only a Build tool and i guess you are already using some kind of versioning.
Depending on which tool you use, the setup is different, but I think there are some things you should consider with your application (maybe not all are applicable to your application)
Creating a Tag in your Versioning
Copying the new Code in an folder on production
--> if you are in a new folder you dont need to clear the cache and logs, since these shouldnt be in your versioning the first time.
loading composer (if youre using it)
installing vendors
updating database schema
install assets from your bundles
move symlink from current version to the folder of the new site
These are the things I currently need for my application for production deployment, if you deploy to an test environment you should load fixtures and run your testscripts as well.
One other option that is very well described here is to deploy the Symfony2 application with Apache Ant. Apache Ant is a Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other.
the issue i am fighting through is a bit complicated. Ill explain the setup envoironment to you first.
I am using PHPStorm to work on a Symony2 Project.
My Apache is hosted on a Debian-VM connected to PHPStorm via "Deployment Tool".
/* So far: I can edit code and update the server automaticaly on save. Works*/
My problem now is, that i am using the composer, which is ment do get me the right bundles into the vendor folder.
I WANT to create kind of a symlink from the server directly into the project.
I DONT WANT to download the vendor folder from the server hard into the project.
COMPACT:
I want to create a symbolic link within a PHPStorm project. Linking a folder from a server into the Project. The linked in folder should be unidirectional updated on source change. The Classes and Namespaces should be known to the Project.
Is there any native way to get this done?
Or does anyone know a plugin which could handle such affairs?
I hope i expressed my point clearly :/ Please ask, if anything is unclear.
Greetings and thanks upfront.
It's not possible to do directly from PhpStorm, see the related issue. You can use some third-party tool like ExpanDrive to map a server directory to the drive letter by SFTP and then add this local directory as a content root to your PhpStorm project. Note that it may affect the performance dramatically.