Silverstripe - creating a local copy of an existing site

I am new to silverstripe and webhosting, and I think I don't understand what a workflow is. The situation is this: there is this site http://foo.com that uses silverstripe. It is already installed and some content has been added. However, I am now responsible for changing the design from the standard simple theme to a custom theme.

Since this requires some testing and play, I certainly do not want to make all the changes on the Internet. I have ftp access to the website and you can change all the files there (yay!). But I think it is most useful to have a local copy of the website, make all changes in my standalone version, and then upload the latest new version to webhoster (via ftp).

So my question is this: how can I get a local working copy of a website with all the silverstripe modules / themes on my Ubuntu computer and edit it the same way as on the Internet?

I thought that there should be a textbook for this, but I could not find anything suitable for me.

If this is not a suggested workflow (download the website as it is now, make changes offline using the installation installation on my computer, download everything again), then please tell me how to do this correctly.

+5
source share
2 answers

You can get a copy of Silverstripe working locally in several ways.

Local setting:

  • Web server - Silverstripe prefers apache
  • Database

You can download a copy of silverstripe here: http://www.silverstripe.org/download/

When you downloaded Silverstripe, change everything that is included in the framework. The theme (which you want to change) is located in the /themes/ directory, in which you create a new directory with the name of your new theme and how you create the new theme. to switch themes you can do this in the configuration file.

https://docs.silverstripe.org/en/3.2/developer_guides/templates/themes/

I would recommend the following Silverstripes lessons. Although the textbooks are outdated, they still have useful information, just remember that they are not always relevant.

https://docs.silverstripe.org/en/3.2/tutorials/

http://www.silverstripe.org/learn/lessons

Project workflow:

You asked how to manage the changes between your local copy and your online copy.

It depends on how you have configured all the settings, you can do this in several ways.

  • FTP Download everything when you are happy with your changes locally.

  • Version control. Use .git to manage the repository, then use the script on the server to pull out the repo when you click on the changes.

  • SSH - Log in to your server remotely and edit your files on the Internet.

Any of them will work, but these are your preferences. I would recommend doing some more research along the path of the repository, as it often becomes the fastest in the future, however if you want fast and dirty FTP often be a good choice.

+5
source

More complex workflow:

  • use composer to install SilverStripe and all modules (it automatically installs all module dependencies! Although this is a cool tutorial, love it as soon as you resolve the first conflicts)
  • add the composer .json, composer.lock, mysite /, assets / dir (without assets), themes / and all your files related to the project to the git repository
  • make regular changes to vcs (git)

To get a site on the server, there are two possibilities:

  • clone / pull the repository using git on the server to get your files and changes and composer install --no-dev -o to install all the modules. Remember to run dev / build? Flush to clear the manifest cache and get changes to your model in the database.
  • if you donโ€™t have git access on the server, check on the dev machine (without modules only for dev-only like phpUnit) and put everything with git on the server. There are also some services, such as ftploy , that are deployed from git using ftp (but I personally have not used this service yet). Pushing changes / modifying modules with ftp to production is a major pain ...

See also: Silverstripe begins work with documents

+2
source

Source: https://habr.com/ru/post/1237280/


All Articles