when I install Symfony according to the guide (option 1 with composer) it creates the folder structure as expected (and mentioned in that guide):
path/to/webroot/
Symfony/
app/
src/
vendor/
web/
But in the root folder it also creates an empty vendor/ folder. In this vendor folder there is a subfolder named composer/.
path/to/webroot/
Symfony/
vendor/
composer/
Both directories are empty (no hidden files). So two questions:
Is this a required folder or is it kind of a bug that these folders are installed? Or may this be a directory for composer-specific files?
Can I delete this folder without any danger?
That empty folder is generated when you don't pass the target-directory parameter to composer:
php composer.phar create-project vendor/project target-directory [version]
Related
I installed Symfony on my local host and it is working like a charm.
But when I upload the project folder via php to my shared host it is not working.
I see only the message: This site is currently under construction.
I am using the right php version (7.1.)
This is my folder structure.
.DS_Store
.env
.env.dist
.git
.gitignore
assets
bin
composer.json
composer.lock
config
package.json
phpunit.xml.dist
public
src
symfony.lock
templates
tests
translations
var
vendor
webpack.config.js
I am using rsync to deploy a git branch with my production server. Currently, I got js files stored in two locations:
assets/js/
js/
When I run rsync using --exclude js, non of the both folders will be sync, while I want the assets/js/ folder to be synced and the js/ folder inside my root folder to be skipped. How can I achieve this?
You need to specify the pattern for those files and directories:
using:
CWRULE [PATTERN_OR_FILENAME]
CWRULE,MODIFIERS [PATTERN_OR_FILENAME]
so you would have something like
CW- js/
For even more detailed info you can see the man page at the section
Include/Exclude Pattern Rules
from this link, hope it helps
Is it possible to change the path of the injected file before injection occurs?
I am using Grunt/Bower/Connect/Wiredep, and my directory structure is:
www
|- dev-dist/
|- node_modules/
|- src/
|- vendor/
|- bower.json
|- Gruntfile.js
|- package.json
(Note: in my .bowerrc file I've added directory: vendor)
When I run the custom task grunt serve:dev it will create the directory dev-dist, I will then copy my index.html (only) to the folder, after which I run the task wiredep.
After running wiredep, the src paths to my dependencies are all prefixed with '../vendor/'. The problem is that when I run connect I have the option base: ['vendor', 'dev-dist', 'src']. When everything is served, the relative path to vendor doesn't make any sense because the vendor dir is already served at the root.
Is there a way I can modify the path to the injected files before wiredep injects them? (So I can remove the '../vendor')
What I would like to have happen is from the same workspace be able to run grunt serve:* and specify dev/stage/prod environments. This is why I did not want to serve the whole www directory.
Is there a way to exclude folders from being served in connect? (So instead of specifying base:[...], I can just exclude the stage-dist / prod-dist folders)
Thanks,
JD
You can use the option ignorePath with a regular expression
ignorePath: /\.\.\//,
from the wiredep to remove the ../ from the path that is getting injected. The configuration details are available over here https://github.com/taptapship/wiredep#configuration
I haven't used connect yet, so I am not sure of your second part of the question.
I'm breaking some of my bundles into stand alone repos that I can reuse in other projects, they are all under the same vendor namespace in my /src directory, so when I pull them out and require them with composer I end up with the same vendor name space in my /src directory and also the /vendor directory.
When I try to load my app I get a Compile Error as it's looking for the class in the /src directory.
Is there anyway around this or do I need to change my vendor name?
Turns out the opcache needed to be cleared - restarting apache solved the issue.
I have a problem when updating the vendor "kriswallsmith/assetic": "1.1.*", the update gives me this output :
Updating kriswallsmith/assetic (dev-master 5591252 => v1.1.2)
[RuntimeException]
The .git directory is missing from /home/smiles/Downloads/auth_Project/vendor/kriswallsmith/assetic, see http://getcomposer.org/commit-deps for more information
This literally means what it says: the .git directory is missing from this vendor directory. Simply remove the whole assetic folder, then run composer update again. This will add assetic again and the .git folder. (If the kriswallsmith vendor namespace is empty, then you are safe to remove that empty folder as well.)
This can happen if - for example - you are using subversion and all .git folders are ignored. Upon next checkout this folder will not be present.