V4.1
Symlink and Public folder issues SS4.1
I appologise in advance for the long post!
I really like Silverstripe but since V4 came out, I am growing more and more frustrated with it…
The way I used to work would be that I would use composer to create a new site on my development machine, I would then create the templates, classes and functionality before FTPing the site to the development server, re-run the install, populate the content and the site was live.
When version 4.0 came out, there was a much bigger reliance on Composer, which is fine as it is great at maintaining compatibility but I found that the install process creates Sym Links in the resources folder to the Vendor folder. Sym links cannot be FTP’d, which left me with the options of:
-
Using composer on the live server to install Silverstripe (this is difficult on the live server when compared to simply FTPing the site and also runs the risk of the live version not being exactly the same as the development version)
-
Creating a copy of the files the sym link linked to in the resources folder (This means that there are duplicated files and folders, making updates more tricky)
This wasn’t the end of the world and I started making copies of the files in the resource folder.
Then V4.1 came along and added the public folder, for me, this has two further problems:
-
I don’t have access to the necessary files to change the root folder of the site to public, so this functionality is of little use to me.
-
I cannot figure out how to add a new theme for a site as simply creating the theme folder is not enough as the symlinks (again) need to be generated in the public resources folder.
I do understand the advantages of the reliance on composer and also the security advantages of the public folder, and if you have unrestricted access to the live server, this would be great, however, I am sure that I am not alone in that I do not have that kind of access to the live server, so the later advancements are simply throwing hurdles in my way. Silverstripe seems to be pushing this kind of developer out.
All I need to do is have an exact copy of the live site in my development environment, the easiest way to achieve this is the ability to FTP the site files to the live server.
To summarise, my questions are:
-
Is there a way I can still work how I used to (having a local copy of the site and FTPing the site to the server?
-
Is there anyway I can disable the use of the public folder during the installation process?
-
If 1 or 2 are not possible, how do I create a custom theme and ensure that the resources folder in the public folder gets updated to allow me to use my new theme.