holgersielaff/potatoe

一个小型PHP 7.0 框架

安装: 30

依赖项: 0

建议者: 0

安全: 0

星星: 0

观察者: 1

分支: 0

开放性问题: 0

类型:php-framework

1.1.6 2018-08-16 15:57 UTC

This package is not auto-updated.

Last update: 2021-01-23 10:34:59 UTC


README

logo.svg

Potatoe 是一个 PHP7.0 库

依赖项

在 Debian 系统版本 >= stretch 中,必需 PHP >= 7.0

 apt-get install php

可选 apache2 mysql postgres libapache2-mod-php7.x

apt-get install apache2 mysqp postgresql-9.3 libapache2-mod-php

安装

最佳做法是使用 composer

 composer require holgersielaff/potatoe

之后,您可以使用以下命令设置一些自定义参数

 cd vendor/holgersielaff/potatoe && php install.php

如果您想获取最新的快照

 git clone https://github.com/holgersielaff/potatoe

\Potatoe\AutoDBRec

一个可以非常容易调用的数据库抽象层
包括

  • 分页
  • 搜索

示例

初始化 \Potatoe\AutoDBRec::factory($options); 执行 获取数据库对象的数组:

  \Potatoe\AutoDBRec::newArray("SELECT foo, bar FROM baz");

仅获取一个对象(如果有多个,则为第一个)

  \Potatoe\AutoDBRec::newRec("SELECT foo, bar FROM baz WHERE id = 1");

\Potatoe\HKP

PHP 的 HKP 服务器。

以下驱动程序可用

  1. GPG(测试中)
  2. LDAP(不稳定)
  3. Postgres(开发中)
  4. MySQL(开发中)

使用 GPG 驱动程序在本地 ./gnupg 上

$config = new \Potatoe\HKP\Config\GPG([
    'POTATOE_PGP_HOME' => '~/.gnupg'
]);
// 0.0.0.0 für broadcast
$server = new \Potatoe\HKP(\Potatoe\HKP::DRIVER_GPG, $config); 
$server->server(8080, '127.0.0.1');  

使用 LDAP 驱动程序在 LDAP 服务器上

$config = new \Potatoe\HKP\Config\LDAP([
    'POTATOE_LDAP_HOST' => '192.168.0.1',
    'POTATOE_LDAP_BIND_DN' => 'a=dmin,r=dn',
    'POTATOE_LDAP_BIND_PASS' => '*****',
    'POTATOE_LDAP_BASE_DN' => 'p=ath,t=o,b=ase'
]);
$server = new \Potatoe\HKP(\Potatoe\HKP::DRIVER_LDAP, $config); 
// 0.0.0.0 für broadcast
$server->server(8080, '127.0.0.1');  

作为一个 web 服务器脚本,整个过程通过

  $server->apache();

代替

  $server->server(...)