# Create installation package for CakePHP 3.x

**URL:** <https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866>\
**Category:** Need Help\
**Created:** [July 10, 2017, 7:45pm UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866 "2017-07-10T19:45:37Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Snorvarg](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/snorvarg/32/709_2.png) [@Snorvarg](https://discourse.cakephp.org/u/Snorvarg)\
**Post date:** [July 10, 2017, 7:45pm UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866/1 "2017-07-10T19:45:38Z")

</div>

Hi, I have been working with a little project on my free time, you can find it at github, just look for Snorvarg/simplicity.  
[https://github.com/Snorvarg/simplicity](https://github.com/Snorvarg/simplicity)

I am booting up the project again after some (too long) downtime.

Anyway, I would like to create an installation package so anyone can install it! The composer is not an alternative.

I installed composer and downloaded cakephp, so I have the files. My intention is to more or less zip it up, after merging in my files from simplicity. So anyone with access to a decent webhotel can unzip it in a folder and get started.

Anyone having any tips, big no-nos or experience of the same thing, please share with me!

---

<div class="post-metadata">

**Author:** ![jlroberts](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/jlroberts/32/649_2.png) [@jlroberts](https://discourse.cakephp.org/u/jlroberts)\
**Post date:** [July 11, 2017, 9:06am UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866/2 "2017-07-11T09:06:54Z")

</div>

check out

> **[basecamp/sub](https://github.com/basecamp/sub)**
>
> sub - a delicious way to organize programs

might be good for use before bin/cake is available =]

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [July 11, 2017, 2:18pm UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866/3 "2017-07-11T14:18:48Z")

</div>

You can do it no problem.

On the other hand I would do it via composer 🙂

---

<div class="post-metadata">

**Author:** ![dakota](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dakota/32/1421_2.png) [@dakota](https://discourse.cakephp.org/u/dakota)\
**Post date:** [July 11, 2017, 4:08pm UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866/4 "2017-07-11T16:08:36Z")

</div>

Take a look at how Croogo does it ([https://github.com/croogo/croogo/tree/3.0](https://github.com/croogo/croogo/tree/3.0)). You can also look at [https://github.com/cakedc/oven](https://github.com/cakedc/oven) for inspiration 🙂

---

<div class="post-metadata">

**Author:** ![Snorvarg](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/snorvarg/32/709_2.png) [@Snorvarg](https://discourse.cakephp.org/u/Snorvarg)\
**Post date:** [July 13, 2017, 11:34am UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866/6 "2017-07-13T11:34:58Z")

</div>

Thanks jlroberts, but I am not a fan of scripts, not a linux-person, no offense, sorry. 🙂

---

<div class="post-metadata">

**Author:** ![Snorvarg](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/snorvarg/32/709_2.png) [@Snorvarg](https://discourse.cakephp.org/u/Snorvarg)\
**Post date:** [July 13, 2017, 11:35am UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866/7 "2017-07-13T11:35:57Z")

</div>

Oven seem to be the way to go dakota! I tried to install it on my windows system, worked like a charm.

Will ask the guys making oven of course, but have you experience using it? Because after it install cake, I would like to install my own files and also create a few tables. Maybe I can just adapt their script?

---

<div class="post-metadata">

**Author:** ![Snorvarg](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/snorvarg/32/709_2.png) [@Snorvarg](https://discourse.cakephp.org/u/Snorvarg)\
**Post date:** [December 30, 2017, 1:37am UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866/8 "2017-12-30T01:37:29Z")

</div>

Hi rrd,  
I finally got time to work on this, and got a grip on how to use composer. 🙂

Maybe I should put this as a new question on the forum, but I start with asking you: I am using the cake skeleton app, which nicely set up a fully working site for me. Then I can add my files.

But how do I do a composer script? Should I modify the composer.json file for the cake skeleton app?

Also, should I include all cake-php-files on github, or just my own files?

Again, thanks a lot!

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [December 30, 2017, 5:18pm UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866/9 "2017-12-30T17:18:27Z")

</div>

> [@"Snorvarg](#):
>
> But how do I do a composer script? Should I modify the composer.json file for the cake skeleton app?

Sure. If you need an extra package just add it to the required packages. Perhaps it is more safe to do it from the command line. Most of the packages’ docs desribe how to do it. Mainly it something like `php composer.phar require vendor/package`

> [@"Snorvarg](#):
>
> Also, should I include all cake-php-files on github, or just my own files?

The best if you have a `.gitignore` file like this:

```
/vendor/*
/config/app.php
/tmp/*
/logs/*
/webroot/.htaccess
.htaccess

```

These files should not go to version control and you can add any other if you want.

---

<div class="post-metadata">

**Author:** ![Snorvarg](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/snorvarg/32/709_2.png) [@Snorvarg](https://discourse.cakephp.org/u/Snorvarg)\
**Post date:** [January 2, 2018, 8:40pm UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866/10 "2018-01-02T20:40:55Z")

</div>

I am really confused about the way I should do this… I want a composer.json file anyone can use to install my project.

So I modify the composer.json after ‘checking out’ all the files of the cakephp/app project. That should work, but I lose the ability to get any fixes the team of the cakephp/app project will do… But I guess it is named a skeleton app for a reason: So I can build from it.

Argh, I will try it out again. 🙂 Thanks again rrd.

---

<div class="post-metadata">

**Author:** ![Snorvarg](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/snorvarg/32/709_2.png) [@Snorvarg](https://discourse.cakephp.org/u/Snorvarg)\
**Post date:** [January 2, 2018, 9:59pm UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866/11 "2018-01-02T21:59:51Z")

</div>

Hmm, what am I doing wrong here… I run the composer to download cakephp/app into a folder. Then I added my files to its various places and added them to git.  
I modified the composer.json file so it points to my own repository. Then I created a “contribution”.  
Finally I created a local composer.json looking like this:

```
{
  "require": {
    "madskullcreations/simplicity":"dev-master@dev"
  },
  "repositories": [
    {
       "type": "vcs",
       "url": "https://github.com/madskullcreations/simplicity" 
    }
  ]
}

```

and then I ran “composer install” in the same folder. Everything downloads fine with no errors.

But everything ends up in a vendor folder, and inside of that folder everything looks totally different from what it would look like if I would use the cakephp/app repo… Meaning what?!  
…it is basically the same composer.json file, so why does it look totally different.

I get some odd folder structure with the folders aura, bin, cakephp, …, madskullcreations, … etc.

The expected folder structure should have been the well-known cakeish: bin, config, logs, plugins, src, tests, tmp, vendor, webroot.

Please, if you can, check it out here:

> **[madskullcreations/simplicity](https://github.com/madskullcreations/simplicity)**
>
> Website made simple! Contribute to madskullcreations/simplicity development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Snorvarg](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/snorvarg/32/709_2.png) [@Snorvarg](https://discourse.cakephp.org/u/Snorvarg)\
**Post date:** [January 3, 2018, 8:37am UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866/12 "2018-01-03T08:37:23Z")

</div>

I tried to make a new release through packagist and install it with the same syntax as for cakephp/app, but of course the scripts post-install failed, some files defined in cakephp/app is still missing… Will try again after adding the missing files.

Someone should make a guide explaining how to create a package based on cakephp/app. 🙂

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [January 3, 2018, 9:22am UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866/13 "2018-01-03T09:22:42Z")

</div>

Ah I see. Are you building a CakePHP plugin or a full CakePHP based package?

---

<div class="post-metadata">

**Author:** ![Snorvarg](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/snorvarg/32/709_2.png) [@Snorvarg](https://discourse.cakephp.org/u/Snorvarg)\
**Post date:** [January 3, 2018, 9:28am UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866/14 "2018-01-03T09:28:50Z")

</div>

rrd, Now I believe I got the hang of it. I simply add most of the same files to my repository as they have done in cakephp/app.

…In the end, I will have a copy of the cakephp/app skeleton with my own files added.

The initial misunderstanding: I believed I could easily “require” the cakephp/app skeleton files in my own composer.json. But now I realize it is better to do a more or less full copy of the repository.

This should be clarified with an example in the cakephp/app docs. (although any beginner must do this journey/mess to get acquainted with composer.)

---

<div class="post-metadata">

**Author:** ![Snorvarg](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/snorvarg/32/709_2.png) [@Snorvarg](https://discourse.cakephp.org/u/Snorvarg)\
**Post date:** [January 3, 2018, 9:29am UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866/15 "2018-01-03T09:29:42Z")

</div>

I build a full CakePHP based package. I realize it is not very common though. 🙂

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [January 3, 2018, 7:53pm UTC](https://discourse.cakephp.org/t/create-installation-package-for-cakephp-3-x/2866/16 "2018-01-03T19:53:13Z")

</div>

There are services build on CakePHP. But yes the skeleton is not something you require. You start with that, bake and modify and add new things. And you can end up with a full composer installable application.
