Setting up Silex project - where? - silex

This is a very basic question about using Silex for the first time.
I want to install this project which was linked from this tutorial. I have already installed Silex via Composer per these instructions.
What I need to know is, should I put the project inside the Silex folder I created when I installed it with Composer? Do I need a new instance of Silex for each project I use it for, or do I use one for all the projects, and keep those in other folders?
I'm used to Drupal, if that helps with answering this.

Different silex projects might require different package dependencies. You should have 1 composer.json per project , with it's own vendor folder.
What you should do :
fork this repo on github:
https://github.com/fabpot/silex-skeleton
create you own base project , and just create projects automatically with composer ( you can publish your default project on packagist.org then use composer to install it):
To use the default skeleton used by Fabien Potencier , use this command :
composer create-project fabpot/silex-skeleton -sdev
it will be easier to deploy your application on the server once you are done developing it if you use separate silex installations.

Related

Is it possible to avoid updating drupal core with composer update?

I'm trying to build a docker container where the dockerfile installs a specific version of drupal, I copy over custom copies of composer.json/composer.lock and then do a composer update to download the contributed modules specified in these composer files. I know that ideally composer would also control core, but for this project, I'm trying to avoid that.
The problem I'm having is that composer update seems to also reinstall drupal, where I want the dockerfile to be in control of this and I'd like composer to just manage the modules.
Is this something I could do by modifying the composer files (so far tests have not worked)? It seems you can't specify a package for composer to ignore and where I see you can specify specific packages to update, that's not really a viable solution for this.
Thanks
OK, it's looking like the issue was the composer.lock/json files I was adding to run composer update were initially created by using composer create-project drupal-composer/drupal-project, which installed core and thus added it to the composer.lock/json files.
It seems that by just reinstalling the contributed modules with composer in a fresh drupal site (so simplified composer files) might be the answer.

Do zend framework has application setup wizard module?

I'm looking at zend framework 2 to use it for my project.
Wanted to know if it has an in-build php web application installer script/module like mentioned in this thread How I can create installer for website. PHP mysql
I would say using Composer with your own composer.json is as close as you can get...
As an example there is the ZF2 Skeleton Application. Similarly you can also make a composer.json for your own custom application pointing to your custom repository and all dependencies.

How to define in composer.json to get zf2 library update?

i have kept the zf2 library inside vendor folder as follows . How to define composer to set zf2 updated through composer?
If you want it to be managed by Composer, remove your existing vendor folder and have Composer set it up again. See the ZF skeleton application for an example of adding ZF2 to your composer.json.

ZEND2 project not working after cloned to separate machine

I have cloned my office colleague's zend2 project from our server. He used zfcuser, zfcbase, and zfcadmin. But when I tried to run the project in my local machine its giving
<b>Fatal error</b>: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException'
with message 'Module (ZfcBase) could not be initialized.' in C:\xampp\htdocs\coolshop
\vendor\ZF2\library\Zend\ModuleManager\ModuleManager.php:140
Everything is fine to me as the same project 100% working in my colleague's machine. I tried the composer as well. But no luck
This is a result of loading the ZfcBase module as a git submodule. If you fix this module you'll receive the same error for other modules or dependencies you're using in that manner. I've encountered this problem when someone tries to clone the project on a new machine or you delete the project locally and try to re-clone it.
The simple answer here is to use composer as your dependency manager, you'll have a better day. Head over to ZfcBase on Packagist and copy the require statement into your composer.json file (You'll need to run the composer script after saving your .json file). Most modules should have instructions on using composer to grab them in the README.
I should note that if you're using other modules that depend on ZfcBase, you'll likely just need to have a require statement for those, and not their dependencies (like ZfcBase).
Someone had a similar question regarding the ZfcUser module. Using composer solved his issue.

Is it possible to change Yeoman's directory structure?

I like Yeoman's features like the Package Manager (Bower), Livereload integration, Compass, etc.
Therefor, I'd like to use it to handle my public website. However, instead of using the "app" folder, I would like to put everything at the root.
I've changed the references in the grunt configuration file but still get errors when installing new package and building.
Is it possible to change the project structure?
Not as easy as it could be at the moment, but we're working on making it easily customizable.
Though I don't think you would need to. You develop in the /app folder and deploy the contents of the built /dist folder. That way it's still in the root on your server.

Resources