Skip to content
Maurits van der Schee edited this page Apr 16, 2017 · 91 revisions

Welcome to the Wiki

Feature roadmap

  1. Permissions on filters (disallow filters when key is missing?)
  2. Order on diff functions: diff(numeric), dist(geo), diff(date)
  3. Security better explained (csrf, cors)
  4. Test case for NaN float
  5. Detect DB version to adjust tests for features "binary", "spatial" and (in the future) "json".
  6. Upsert support on edit
  7. Proxy for set of API's
  8. Multi-schema support (as alternative for multi-database)
  9. Travis integration

Ideas for related projects

  1. Some form of JWT token support (see: https://github.com/mevdschee/php-api-auth)
  2. Port to .net core (C#) (see: https://github.com/mevdschee/core-data-api)
  3. Port to .net (C#) (see: https://github.com/mevdschee/data-api-dot-net)
  4. Port to Go (see: https://github.com/mevdschee/go-crud-api)
  5. Port to Java (see: https://github.com/mevdschee/java-crud-api)
  6. Port to NodeJs (see: https://github.com/mevdschee/js-crud-api)
  7. Stored procedure API (see: https://github.com/mevdschee/php-sp-api)
  8. PHP CRUD application (see: https://github.com/mevdschee/php-crud-ui)
  9. Vue.js CRUD application (see: https://github.com/mevdschee/vue-crud-ui)

VM installation

General tips

Use virtualbox and set your network interface to bridged
apt-get install openssh-server
sudo nano /etc/sysctl.conf
  net.ipv6.conf.all.disable_ipv6 = 1
  net.ipv6.conf.default.disable_ipv6 = 1
  net.ipv6.conf.lo.disable_ipv6 = 1
  net.ipv6.conf.eth0.disable_ipv6 = 1
reboot

Ubuntu 12/14/16

#Use mini.iso
#Choose LAMP+PostgreSQL packages
sudo apt-get install nano git sqlite3
sudo apt-get install php-dom php-zip (ubuntu 16 only)
sudo apt-get install php5-sqlite php5-pgsql (ubuntu 12/14 only)
sudo apt-get install php7.0-sqlite php-pgsql (ubuntu 16 only)
git clone https://github.com/mevdschee/php-crud-api.git
cd php-crud-api
sudo su postgres
psql
  CREATE DATABASE "php-crud-api";
  CREATE USER "php-crud-api" WITH PASSWORD 'php-crud-api';
  GRANT ALL PRIVILEGES ON DATABASE "php-crud-api" TO "php-crud-api";
  \q
exit
mysql -uroot -proot
  CREATE DATABASE `php-crud-api`;
  CREATE USER 'php-crud-api'@'localhost' IDENTIFIED BY 'php-crud-api';
  GRANT ALL PRIVILEGES ON `php-crud-api`.* TO 'php-crud-api'@'localhost';
  FLUSH PRIVILEGES;
  exit
cp tests/Config.php.dist tests/Config.php
nano tests/Config.php
  'MySQL' => array(
    'hostname' => 'localhost',
    'username' => 'php-crud-api',
    'password' => 'php-crud-api',
    'database' => 'php-crud-api',
  ),
  'PostgreSQL' => array(
      'hostname' => 'localhost',
      'username' => 'php-crud-api',
      'password' => 'php-crud-api',
      'database' => 'php-crud-api',
  ),
  'SQLite' => array(
      'hostname' => '',
      'username' => '',
      'password' => '',
      'database' => 'tests/sqlite.db',
  ),
  /* Uncomment and update for any databases you want to use.
wget https://getcomposer.org/composer.phar
php composer.phar install
vendor/phpunit/phpunit/phpunit

Debian 7/8

#Use netinst.iso
#Choose nothing but system tools
su
apt-get install postgresql mysql-server sqlite3
apt-get install php5-cli php5-sqlite php5-pgsql php5-mysqlnd
apt-get install nano git
su postgres
psql
  CREATE DATABASE "php-crud-api";
  CREATE USER "php-crud-api" WITH PASSWORD 'php-crud-api';
  GRANT ALL PRIVILEGES ON DATABASE "php-crud-api" TO "php-crud-api";
  \q
exit
mysql -uroot -proot
  CREATE DATABASE `php-crud-api`;
  CREATE USER 'php-crud-api'@'localhost' IDENTIFIED BY 'php-crud-api';
  GRANT ALL PRIVILEGES ON `php-crud-api`.* TO 'php-crud-api'@'localhost';
  FLUSH PRIVILEGES;
  exit
exit
git clone https://github.com/mevdschee/php-crud-api.git
cd php-crud-api
cp tests/Config.php.dist tests/Config.php
nano tests/Config.php
  'MySQL' => array(
    'hostname' => 'localhost',
    'username' => 'php-crud-api',
    'password' => 'php-crud-api',
    'database' => 'php-crud-api',
  ),
  'PostgreSQL' => array(
      'hostname' => 'localhost',
      'username' => 'php-crud-api',
      'password' => 'php-crud-api',
      'database' => 'php-crud-api',
  ),
  'SQLite' => array(
      'hostname' => '',
      'username' => '',
      'password' => '',
      'database' => 'tests/sqlite.db',
  ),
  /* Uncomment and update for any databases you want to use.
wget https://getcomposer.org/composer.phar
php composer.phar install
vendor/phpunit/phpunit/phpunit

Centos 6/7

#Use minimal.iso (not netinst.iso)
useradd maurits
passwd maurits
su
vi /etc/sysconfig/network-scripts/ifcfg-e*
  ONBOOT="yes"
  NM_CONTROLLED="no" (centos 6 only)
yum install nano git wget
yum install php-cli php-sqlite3 php-pgsql php-mysqli php-dom
yum install sqlite postgresql postgresql-server postgresql-contrib
yum install mysql-server (centos 6 only)
yum install mariadb-server (centos 7 only)
chkconfig mysqld on (centos 6 only)
service mysqld start (centos 6 only)
systemctl enable mariadb (centos 7 only)
systemctl start mariadb (centos 7 only)
mysql_secure_installation
chkconfig postgresql on (centos 6 only)
service postgresql initdb (centos 6 only)
service postgresql start (centos 6 only)
systemctl enable postgresql (centos 7 only)
postgresql-setup initdb (centos 7 only)
systemctl start postgresql (centos 7 only)
nano /var/lib/pgsql/data/pg_hba.conf
  #replace 'ident' by 'md5' (for 'host' not for 'local')
/etc/init.d/postgresql restart (centos 6 only)
systemctl restart postgresql (centos 7 only)
su postgres
psql
  CREATE DATABASE "php-crud-api";
  CREATE USER "php-crud-api" WITH PASSWORD 'php-crud-api';
  GRANT ALL PRIVILEGES ON DATABASE "php-crud-api" TO "php-crud-api";
  \q
exit
mysql -uroot -proot
  CREATE DATABASE `php-crud-api`;
  CREATE USER 'php-crud-api'@'localhost' IDENTIFIED BY 'php-crud-api';
  GRANT ALL PRIVILEGES ON `php-crud-api`.* TO 'php-crud-api'@'localhost';
  FLUSH PRIVILEGES;
  exit
exit
git clone https://github.com/mevdschee/php-crud-api.git
cd php-crud-api
cp tests/Config.php.dist tests/Config.php
nano tests/Config.php
  'MySQL' => array(
    'hostname' => 'localhost',
    'username' => 'php-crud-api',
    'password' => 'php-crud-api',
    'database' => 'php-crud-api',
  ),
  'PostgreSQL' => array(
      'hostname' => 'localhost',
      'username' => 'php-crud-api',
      'password' => 'php-crud-api',
      'database' => 'php-crud-api',
  ),
  'SQLite' => array(
      'hostname' => '',
      'username' => '',
      'password' => '',
      'database' => 'tests/sqlite.db',
  ),
  /* Uncomment and update for any databases you want to use.
wget https://getcomposer.org/composer.phar
php composer.phar install
vendor/phpunit/phpunit/phpunit
Clone this wiki locally