Skip to content

Commit

Permalink
Merge pull request #142 from phalcon/4.0.x
Browse files Browse the repository at this point in the history
Vokuro 2.0.0
  • Loading branch information
Jeckerson authored Dec 22, 2019
2 parents 51de2ad + b48cfdf commit ea6f9cc
Show file tree
Hide file tree
Showing 225 changed files with 5,954 additions and 3,353 deletions.
27 changes: 27 additions & 0 deletions .ci/create-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
#
# This file is part of the Phalcon Framework.
#
# (c) Phalcon Team <[email protected]>
#
# For the full copyright and license information, please view the
# LICENSE.txt file that was distributed with this source code.

set -e

: "${DB_NAME:=vokuro}"

case "$DB_ADAPTER" in
"mysql")
cmd="CREATE DATABASE IF NOT EXISTS $DB_NAME CHARSET=utf8 COLLATE=utf8_unicode_ci;"
echo "running command '$cmd'"
mysql -e "$cmd"
;;
"pgsql")
cmd="create database $DB_NAME;"
echo "running command '$cmd'"
psql -c "$cmd" -U postgres
;;
*)
;;
esac
34 changes: 34 additions & 0 deletions .ci/install-phalcon.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
#
# This file is part of the Phalcon Framework.
#
# (c) Phalcon Team <[email protected]>
#
# For the full copyright and license information, please view the
# LICENSE.txt file that was distributed with this source code.

set -e

: "${PHALCON_VERSION:=master}"

EXT_DIR="$(php-config --extension-dir)"
LOCAL_PATH="phalcon-$PHALCON_VERSION/php-$(php-config --vernum)/$TRAVIS_ARCH"

# Using cache only for tagged Phalcon versions
if [ "$PHALCON_VERSION" != "master" ] &&
[ "$PHALCON_VERSION" != "4.0.x" ] &&
[ -f "$HOME/assets/$LOCAL_PATH/phalcon.so" ]
then
cp "$HOME/assets/$LOCAL_PATH/phalcon.so" "$EXT_DIR/phalcon.so"
else
git clone --depth=1 -v https://github.com/phalcon/cphalcon.git -b "$PHALCON_VERSION" /tmp/phalcon
cd /tmp/phalcon/build || exit 1
./install --phpize "$(phpenv which phpize)" --php-config "$(phpenv which php-config)" 1> /dev/null

mkdir -p "$HOME/assets/$LOCAL_PATH"
cp "$EXT_DIR/phalcon.so" "$HOME/assets/$LOCAL_PATH/phalcon.so"
fi

echo extension=phalcon.so >> "$(phpenv prefix)/etc/php.ini"

"$(phpenv which php)" -m | grep -q phalcon
31 changes: 31 additions & 0 deletions .ci/install-postgres.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
#
# This file is part of the Phalcon Framework.
#
# (c) Phalcon Team <[email protected]>
#
# For the full copyright and license information, please view the
# LICENSE.txt file that was distributed with this source code.

set -e

# Ensure that this is being run inside a CI container
if [ "${CI}" != "true" ]
then
(>&2 echo "This script is designed to run inside a CI container only.")
(>&2 echo "Aborting.")
exit 1
fi

# 1. Shut down 9.* PostgreSQL database
# 2. Install PostgreSQL 11.*
# 3. Copy the authentication information from the old 9.6 configuration
# 4. Create a role called "travis"
sudo apt-get update
sudo apt-get --yes remove postgresql\* 1> /dev/null
sudo apt-get install -y postgresql-11 postgresql-client-11 1> /dev/null
sudo cp /etc/postgresql/{9.6,11}/main/pg_hba.conf
sudo service postgresql restart 11

psql -c 'CREATE ROLE travis SUPERUSER LOGIN CREATEDB;' -U postgres
psql --version
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.ci
.dockerignore
.editorconfig
.env
.git
.gitattributes
.gitignore
.htaccess
.idea
.php-version
.travis.yml
*.md
*.txt

db/*.sql
db/*.sqlite
db/*.sqlite3

resources/boxfile.yml
resources/Dockerfile

tests/_output/*.*

var/cache/*/*.*
var/logs/*.*
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{xml,sh}]
indent_size = 2

[.travis.yml]
indent_size = 2
25 changes: 25 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
APP_CRYPT_SALT=eEAfR|_&G&f,+vU]:jFr!!A&+71w1Ms9~8_4L!<@[N@DyaIP_2My|:+.u>/6m,$D
APP_BASE_URI=/
APP_PUBLIC_URL=dev.vokuro.phalcon.io

# Supported adapters are:
# - mysql
# - sqlite
# - pgsql
DB_ADAPTER=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_USERNAME=root
DB_PASSWORD=
DB_NAME=vokuro

MAIL_FROM_NAME=Vokuro
MAIL_FROM_EMAIL=[email protected]
MAIL_SMTP_SERVER=smtp.gmail.com
MAIL_SMTP_PORT=587
MAIL_SMTP_SECURITY=tls
MAIL_SMTP_USERNAME=
MAIL_SMTP_PASSWORD=

CODECEPTION_URL=127.0.0.1
CODECEPTION_PORT=8888
20 changes: 0 additions & 20 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,22 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
12 changes: 12 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: CI

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Build Vokuro image
run: docker build -t phalconphp/vokuro:4.0.0 -f resources/Dockerfile .
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@

composer.lock
vendor/
app/config/config.dev.php
.env
boxfile.yml
22 changes: 22 additions & 0 deletions .htrouter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

/**
* This file is part of the Vökuró.
*
* (c) Phalcon Team <[email protected]>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

$uri = urldecode(
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);

if ($uri !== '/' && file_exists(__DIR__ . '/public' . $uri)) {
return false;
}

$_GET['_url'] = $_SERVER['REQUEST_URI'];

require_once __DIR__ . '/public/index.php';
66 changes: 66 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
language: php

php:
- '7.3'
- '7.2'

dist: bionic

services:
- mysql
- postgresql

addons:
postgresql: "11.2"
hosts:
- dev.vokuro.phalcon.io

env:
global:
- PHALCON_VERSION=v4.0.0
matrix:
- DB=mysql DB_ADAPTER=mysql DB_PORT=3306 DB_USERNAME=root
- DB=postgres DB_ADAPTER=pgsql DB_PORT=5432 DB_USERNAME=postgres
- DB=sqlite DB_ADAPTER=sqlite

matrix:
fast_finish: true

cache:
timeout: 604800
directories:
- "$HOME/.composer/cache"
- "$HOME/assets"

before_install:
- git config --global advice.detachedHead false
- if [ "$DB" = "postgres" ]; then .ci/install-postgres.sh; fi
- if [ -n "$GITHUB_TOKEN" ]; then composer config github-oauth.github.com "$GITHUB_TOKEN"; fi

install:
- pecl install --force psr
- .ci/create-db.sh
- .ci/install-phalcon.sh

before_script:
- travis_retry composer install --no-interaction --no-ansi --no-progress --no-suggest
- cp tests/.env.test .env
- vendor/bin/phinx migrate -e development
- vendor/bin/phinx seed:run -e development
- php -S 127.0.0.1:8888 -t public/ .htrouter.php &

script:
- vendor/bin/codecept build --quiet
- vendor/bin/codecept run
- vendor/bin/psalm --show-info=false
- |
if [ "$TRAVIS_PHP_VERSION" = "7.2" ]; then
phpenv config-rm xdebug.ini || true
vendor/bin/phpcs
fi
#after_success:
# - bash <(curl -s https://codecov.io/bash)

notifications:
email: false
25 changes: 25 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Contributor Covenant Code of Conduct

## TL;DR

Common sense rules. Treat people the same way you want to be treated.

## Detail

This is an open source project. Everyone and anyone is welcome to contribute
to it as much or as little as they want to.

Personal views of contributors have no effect on the project and should be
kept in the personal realm not this project.

It is a requirement to treat other contributors as well as maintainers with
respect, when communicating in the realm of this project. It is OK to agree to
disagree.

## Conflict

If ever conflict arises, please bring it to the attention of the maintainers
privately. You can always find us on our [Discord](https://phalcon.link/discord)
server or you can send us an email at [email protected]

The core team maintains the final decision on any conflict that may arise.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Vökuró is an open source project and a volunteer effort.

*We only accept bug reports, new feature requests and pull requests in GitHub*.

Vökuró does not have human resources fully dedicated to the mainteniance of this software.
Vökuró does not have human resources fully dedicated to the maintenance of this software.
If you want something to be improved or you want a new feature please submit a Pull Request.

Thanks! <br />
Expand Down
Loading

0 comments on commit ea6f9cc

Please sign in to comment.