Download the PHP package loadsys/skeleton without Composer

On this page you can find all versions of the php package loadsys/skeleton. 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 skeleton

Loadsys CakePHP 3.x App Skeleton

A skeleton for creating applications with CakePHP 3.x. (If you're looking for a 2.x compatible version you'll want to check out the cake-2.x branch.)

This skeleton is tuned to serve the most common needs for Loadsys. If you're finding this on your own, it may be more than you need or not exactly what you need. Feel free to cherry pick any ideas that are useful.

:grey_exclamation: This is the Skeleton's Readme! To edit the README that is bundled with new projects, see README.md.template.

Requirements for Using the Skeleton

The following tools must be installed installed on your development machine to use the skeleton to create a new project:

Please see README.md.template for system requirements necessary to work with a project spawned from this skeleton.

Skeleton Usage

The 3.x version of the skeleton leverages composer's create-project command. A new project will be created for you locally using this repo as the foundation. Post-install scripts will fire during the process to transform the cloned files appropriately.

After vagrant provisioning finishes, the VM will be available at http://localhost:8080.

Alternatively, you can edit your system's hosts file to include the VM's IP and hostname listed the config/provision.yaml file. The finished machine's webserver will respond to any domain that resolves to this IP address. if you use the vagrant-hostmanager plugin, this should be done for you.

You should be able to visit the homepage of the new app and see the setup "traffic lights" as green.

Contributing

If you would like to contribute to this project open a pull request targeted at the correct branch; master for the 3.x skeleton and cake-2.x for the 2.x skeleton.

Testing the skeleton can be difficult because under normal circumstances, a dev would have to commit their experimental changes, push the changes to Github, merge the changes into master and (optionally) tag a new release semver for packagist.org to pick up for "release". Since this is a bad situation when working on something new and untested, it would be nice to be able to run the create-project command using your local checked-out copy of the skeleton repo.

In order to accomplish this, composer needs to be "tricked" into using the local copy, which requires a specially-crafted packages.json file. To ease this process, a skel/test-project.sh [branch-name] [dest/dir] script is included with the skeleton.

So to test a change to the skeleton:

SemVer

Because this repo is used through Packagist, it maintains semantic versioning. The 2.* series (on the cake-2.x branch) can be used to spawn new projects using the old skelbin/spawn method. The 3.* series tracks master and is intended to be used with composer create-project. You should always use a version specifier with the create-project commands to ensure you are using a fully-stable version of this skeleton. The raw master branch may contain merged but "unreleased" new features that might be unstable or otherwise not ready for active use in a brand new project.

Templates

As a part of the create-project process, a composer post-install script is executed that scans the new project for *.template files, then scans inside them for {{TOKEN}}s. The developer running the create-project command is then prompted for values for each token, and those values are written into renamed files.

For example, if README.md.template includes a {{GIT_CLONE_URL}} token, the developer will be prompted to enter a value during setup, such as [email protected]:myself/super-project.git That value will be written back into README.md.template and the resulting file will replace any existing README.md file.

In other words: This repo uses README.md and composer.json, but your generated project will be using filled-in copies of README.md.template and composer.json.template. So if you want to change the default composer packages available in new projects, you need to edit composer.json.template.

When working on the skeleton's templates, it can be handy to review the list of tokens currently in use. This can be done pretty easily on the command line using grep.

Post-Install Scripts

Most of the magic behind the create-project command lies in composer's ability to execute PHP scripts on the new project. These scripts traditionally live in skel/src/ and are wired into the composer.json:scripts:post-create-project-cmd array. The current tasks that are performed during setup:

Additional first-time setup should be added as a post-install script. If a process should be repeatable, consider making it part of the loadsys/CakePHP-Shell-Scripts repo instead, and calling that script from a post-install hook.

Running Tests

The composer scripts have their own unit tests. To execute them, run:

Keeping in sync with CakePHP App

It's a good idea to periodically pull in cakephp/app changes. You can do this by creating a patch and then applying it to the skeleton. You'll need to know the <previous-tag> and the <desired-tag> (use latest cakephp/app release).

Determine <previous-tag> run and find the tag after app-update-:

git log -1 --oneline --grep="app-update"

Generate patch:

cd path/to/cakephp/app
git fetch
git format-patch <previous-tag>..<desired-tag> --stdout > app.patch

Apply patch into a new branch f/app-update-<desired-tag> and merge it into the cakephp-app branch:

cd path/to/loadsys/CakePHP-Skeleton
git fetch
cp path/to/cakephp/app/app.patch path/to/loadsys/CakePHP-Skeleton/
git checkout cakephp-app
git checkout -b f/app-update-<desired-tag>
git apply --stat app.patch
git apply --check app.patch
git am --ignore-whitespace --signoff < app.patch
git checkout cakephp-app
git tag -f cakephp-app-previous
git merge f/app-update-3.0.2 --no-ff
git push origin cakephp-app

Next it can be rebased onto origin/master and any conflicts can be resolved.

git rebase --onto origin/master cakephp-app-previous f/app-update-<desired-tag>
git push origin f/app-update-<desired-tag>

Now create a PR and merge it.

Bundled Provisioning

By default, the Cake 3 projects created by this skeleton will be environment-aware. This approach to configuration allows the Cake app to work in multiple environments without much fuss, but the question of creating those environments consistently remains.

We used to use PuPHPet to handle the Vagrant side of this, but grew weary of having to include thousands of files into each of our projects that we typically didn't need. It was also difficult to engage PuPHPet's assets for a "bare metal" installation on AWS or for a dedicated production server, reducing the utility even further.

So we've replaced it with very slim, lightweight shell scripts. Here's how they work:

"The Three Machines"

In our typical setup, there are three different computers to think about:

  1. The developer's workstation, usually a Mac laptop, which needs to be able to push/fetch the code to/from source control (git) and run development tools like code editors, a web browser and a virtualized copy of the project's hosting environment (vagrant).
  2. The developer's running copy of the project, typically a vagrant VM, which maintains the hosting environment for the app itself that includes all necessary resources (PHP, composer, Apache, MySQL, Memcached, file storage).
  3. The client's running copy (or copies) of the app, typically implemented as dedicated physical servers or cloud instances, which also must maintain the proper hosting environment, although possibly split among different resources (EC2 web instances + ElastiCache caching + RDS database(s) + S3 file storage).

In order to conserve developer resources and unify these environments as much as possible, this skeleton bundles provisioning scripts that make the setup processes repeatable and self-documents the necessary steps involved. The order of execution of this process matters, and is outlined below.

Provisioning Diagram

Project Inception

When this skeleton is used to first create a new project via composer create-project, it will be done from a developer's "natural" environment (typically Mac OS X). The requirements for this are git, php and composer. In this step, the files in this repo are copied to a new directory and composer install is executed along with any composer PostInstall hook scripts.

This newly-created directory hasn't been fully initialized yet though, so the necessary steps are encoded into a bootstrap.sh script. This script ensures the new project folder is a git repo by calling git init if necessary, makes sure composer update has been executed and then kicks off the "provisioning" process. In the case of a developer's Mac, this means setting up the vagrant virtual machine, so the script calls vagrant up, which itself executes provision/main.sh vagrant inside the VM to prepare it.

Additional Developers

The bootstrap.sh script serves a dual purpose. As outlined in the previous section, in the case of a freshly-spawned project it prepares everything to be committed to git and pushed to a new remote.

In the case of another developer freshly cloning an existing project (the "second run"), it prepares the environment to work with the project and again runs vagrant up for them to prime the VM. The developer need only have git, php, composer and vagrant on their machine as pre-requisites.

Deployment

To handle the third machine case, the "bare metal" environments, git is the only pre-requisite in order to clone the repo and run bootstrap.sh. The bootstrapper just launches provision/main.sh YOUR_APP_ENV_VALUE for you.

Conclusion

All told, this allows us to:

TODO


All versions of skeleton with dependencies

PHP Build Version
Package Version
Requires cakephp/cakephp Version 2.6.*
loadsys/cakephp-shell-scripts Version ~2.1
loadsys/cakephp-config-read Version ~2.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 loadsys/skeleton contains the following files

Loading the files please wait ....