Get Start - Installation

#Installation

#Server Requirements

The CL framework has a few system requirements.

You will need to make sure that your server meets the following requirements:

  • Composer
  • PHP >= 7.0.0
  • MbString PHP Extension
  • XML PHP Extension
  • JSON PHP Extension
  • CLI PHP Extension

#Installing Framework

Step 01. Composer Requirements

First, The CL framework utilizes Composer to manage its dependencies. Before using the CL framework, make sure you have the Composer installed on your machines.

If Composer is already installed on your machine then command "composer or composer -V" on your machine's console, you can see below

root@SERVER:# composer


You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Do not run Composer as root/super user! See https://getcomposer.org/root for details
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/

Composer version 1.2.0 2016-07-19 01:28:52

Usage:
  command [options] [arguments]

Options:
  -h, --help                     Display this help message
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi                     Force ANSI output
      --no-ansi                  Disable ANSI output
  -n, --no-interaction           Do not ask any interactive question
      --profile                  Display timing and memory usage information
      --no-plugins               Whether to disable plugins.
  -d, --working-dir=WORKING-DIR  If specified, use the given directory as working directory.
  -v|vv|vvv, --verbose           Increase the verbosity of messages: 1 For normal output, 2 for more verbose output and 3 for debug

Available commands:
  about           Short information about Composer

  ~~~~~~~~~~~~~~~~~~~~ omission in the middle of commands ~~~~~~~~~~~~~~~~~~~~~~~~~~~

  validate        Validates a composer.json and composer.lock
  why             Shows which packages cause the given package to be installed
  why-not         Shows which packages prevent the given package from being installed

Step 02. Create a new json file called `composer.json`

Second, download the CL framework installer using composer.json:


{
    "require": {
        "php": ">=7.0",
        "cafelatte/framework": "v1.0.*"
    }
}

composer.json download

Step 03. Install the CL PHP framework using the composer.json file through the Composer

Third, download the CL framework installer using composer.json:

root@SERVER:# ls -al


drwxr-xr-x 2 root root 4096 10 18 10:06 .
drwxr-xr-x 9 root root 4096  9 27 17:37 ..
-rw-r--r-- 1 root root   91 10 18 10:05 composer.json

root@SERVER:# composer update


Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing cafelatte/framework (v1.0.*)
    Loading from cache

Writing lock file
Generating autoload files

root@SERVER:# ls -al


drwxr-xr-x 3 root root 4096 10월 18 10:06 .
drwxr-xr-x 9 root root 4096  9월 27 17:37 ..
-rw-r--r-- 1 root root   91 10월 18 10:05 composer.json
-rw-r--r-- 1 root root 2238 10월 18 10:06 composer.lock  <--------------------------------- new file created
drwxr-xr-x 4 root root 4096 10월 18 10:06 vendor  <--------------------------------- new folder created

root@SERVER:# ln -s ./vendor/cafelatte/framework/bin/cafelatte cafelatte

root@SERVER:# ./cafelatte template update --config=cafelatte.json


This file is part of CafeLatte framework and including a package manager functions
This binary helps you to convert your HTML code into PHP output statements

@@@@@   @   @@@@@ @@@@@ @       @   @@@@@ @@@@@ @@@@@
@      @ @  @     @     @      @ @    @     @   @
@     @@@@@ @@@@  @@@@@ @     @@@@@   @     @   @@@@@
@     @   @ @     @     @     @   @   @     @   @
@@@@@ @   @ @     @@@@@ @@@@@ @   @   @     @   @@@@@

Name    : CafeLatte Binary
Version : v1.1.0
Url     : http://www.cafe-latte.co.kr
Author  : Thorpe Lee

Usage:
  cafelatte check [options=arguments]
  cafelatte setup [options=arguments]
  cafelatte remove [options=arguments]
  cafelatte template [init/update/delete] [options=arguments]
  cafelatte package [clean/create/install/delete/build] [options=arguments]
  cafelatte database [update] [options=arguments]
  cafelatte composer [update] [options=arguments]
  cafelatte version
  ex) cafelatte template update --config=cafelatte.json

First commands:
  template		 Convert html to php base on the json
    ├─ init		 clean template files
    ├─ update	 update template files
    └─ build	 build template files

  package		 Build own Package library and Install a package from repo
    ├─ clean	 clean package data
    ├─ create	 create package data
    ├─ install	 install package data
    ├─ delete	 delete package data
    └─ build	 build package data

  database		 Use propel command
    └─update	 created model files using database information in the json

  composer		 Use composer's command
    └─update	 Use composer update command

  version		 Show version info

Option:
  --config		 the default value is cafelatte.json

Step 04. Create Config File


{
  "server_name": "TEST SERVER",
  "server_type": "develop",
  "project": {
    "name": "hello world project",
    "path": "/home/projects/my_project/",
    "version": "0.1.1",
    "url": "http://localhost",
    "security_level": "normal"
  },
  "log": {
    "level": "debug",
    "path": "/home/projects/my_project/logs/"
  },
  "template": {
    "input": "",
    "output": "",
    "user": "",
    "group": ""
  },
  "upload": {
    "path": ""
  },
  "config": {
    "key1": "value1",
    "key2": "value2",
    "key3": "value3",
    "key4": "value4"
  }
}


#Tutorial

To get more information, move to tutorial page, Click `Here`