Download the PHP package mentiondev/craft3-base without Composer

On this page you can find all versions of the php package mentiondev/craft3-base. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft3-base

Craft 3 Starter Project

This is a forked project of the excellent nystudio107 Craft 3 CMS scaffolding project with my own customisations

Assumptions

Since this is boilerplate that mention uses for projects, it is by definition opinionated, and has a number of assumptions:

Obviously you're free to remove whatever components you don't need/want to use.

Initial setup using mentiondev/craft3-base

This project package works exactly the way Pixel & Tonic's craftcms/craft package works; you create a new project by first creating & installing the project:

composer create-project mentiondev/craft3-base PATH

Make sure that PATH is the path to your project, including the name you want for the project, e.g.:

composer create-project mentiondev/craft3-base PATH

Next go to MAMP Pro and create a new host and point it to the /web folder in the project you created.

Also create a new database and note/copy the name as will be needed in the craft setup. Then click save to restart the local apache and mysql.

Then back in the terminal cd to your new project directory, and run Craft's setup console command to create your .env environments and optionally install:

cd PATH
./craft setup

Next, run the nys-setup command to configure Craft-Scripts & Craft 3 Multi-Environment based on your newly created .env settings:

./nys-setup

If you ever delete the vendor folder or such, just re-run:

./nys-setup

...and it will re-create the symlink to your .env.sh

Next edit the .env.gulp.json file to point to local url you've chosen. This is required for browsersync to work.

Finally, in the terminal in the project root type

gulp

And browsersync will start the browser, and it's ready to start using.

Assets

Login to Craft CMS and got to Settings/Assets and create a New volume with the folder name of your choice

Then set the Base URL to

@baseUrl/assets

And the File System Path to

@basePath/assets

And then copy these to the config/volumes.php file

Cache busting for live sites

This is created using the method described in Simple Static Asset Versioning in Craft CMS

I've included a twig tag called {{ staticAssetsVersion }} which references craft.app.config.general.custom.staticAssetsVersion in the config/general.twig

To use it add

{% if env != 'local' %}.{{ staticAssetsVersion }}{% endif %}

before the filename. For example:

<link href="{{ siteUrl }}css/main{% if env != 'local' %}.{{staticAssetsVersion}}{% endif %}.css" rel="stylesheet">

This will output <link href="http://<siteurl>/css/main.1.css" rel="stylesheet"> on the live site so that it is cached for that version number and <link href="https://<siteurl>/css/main.1546193063.css" rel="stylesheet"> on the staging site, as the staging site uses the time() tag for the Static Assets Version number, so that it is not cached on the development server while changes are regularly being made, as this changes every second.

To bust the cache on the live site, go to the terminal in the project root and type:

gulp build

Which will increase the staticAssetsVersion number by 1

For {{staticAssetsVersion}} to work it the following needs to be added to the nginx config on the server at the top of the file

location ~* (.+)\.(?:\d+)\.(js|css|png|jpg|jpeg|gif|webp)$ {
  try_files $uri $1.$2;
}

and restart the server.

This will make the browser not see any num­bers before the sta­t­ic asset file­name exten­sion, and then force the browser to download a new version of the file if the number has been changed, hence, busting the cache.

Again, for a full explanation see Simple Static Asset Versioning in Craft CMS

Database/asset synching via craft-scripts

For full documentation on how to use all of nystudio107/craft-scripts go to: nystudio107/craft-scripts

There are several scripts included in craft-scripts, each of which perform different functions. They all use a shared .env.sh to function. This .env.sh should be created on each environment where you wish to run the craft-scripts, and it should be excluded from your git repo via .gitignore.

Setup

pull_db.sh

To pull down a database dump from a remote server type

./pull_db.sh

The pull_db.sh script pulls down a database dump from a remote server, and then dumps it into your local database. It backs up your local database before doing the dump.

The db dumps that craft-scripts does will exclude tables that are temporary/cache tables that we don't want in our backups/restores, such as the templatecaches table.

See Database & Asset Syncing Between Environments in Craft CMS for a detailed writeup.

N.B.: The pull_db.sh script can be used even if the local and remote are on the same server.

pull_assets.sh

To pull down asset directories from a remote server type

./pull_assets.sh

The pull_assets.sh script pulls down an arbitrary number of asset directories from a remote server, since we keep client-uploadable assets out of the git repo. The directories it will pull down are specified in LOCAL_ASSETS_DIRS

It will also pull down the Craft userphotos and rebrand directories from craft/storage by default. The directories it will pull down are specified in LOCAL_CRAFT_FILE_DIRS

See Database & Asset Syncing Between Environments in Craft CMS for a detailed writeup.

N.B.: The pull_assets.sh script can be used even if the local and remote are on the same server.

pull_backups.sh

To pull down script pulls down the backups created by craft-scripts from a remote server type

./pull_backups.sh

The pull_backups.sh script pulls down the backups created by craft-scripts from a remote server, and synced into the LOCAL_BACKUPS_PATH

For database backups, a sub-directory REMOTE_DB_NAME/db inside the REMOTE_BACKUPS_PATH directory is used for the database backups.

For asset backups, a sub-directory REMOTE_DB_NAME/assets inside the REMOTE_BACKUPS_PATH directory is used for the asset backups.

Because rsync is used for these backups, you can put a .rsync-filter in any directory to define files/folders to ignore. More info

See Mitigating Disaster via Website Backups for a detailed writeup.

For more information on how to use them and the other options it has go to nystudio107/craft-scripts


All versions of craft3-base with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ~3.0.0
nystudio107/craft-minify Version ^1.2
nystudio107/craft-scripts Version ^1.2
nystudio107/craft-typogrify Version ^1.1
nystudio107/craft3-multi-environment Version ^1.0
vlucas/phpdotenv Version ^2.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mentiondev/craft3-base contains the following files

Loading the files please wait ....