定制 letsdrink/ouzo-app 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

letsdrink/ouzo-app

Composer 安装命令:

composer require letsdrink/ouzo-app

包简介

Ouzo framework application skeleton

README 文档

README

Build Status

How to use Ouzo step by step. It takes only 5 minutes to set up sample project and start experiencing Ouzo.

Set up project

Simply use composer (http://getcomposer.org):

composer.phar create-project letsdrink/ouzo-app:1.4.0 myproject

Where myproject is your project's name.

After downloading Ouzo and its dependencies you will be asked what database you want to use. Ouzo will prepare config files for you. Database configuration can be changed manually later if needed.

PHP Version

You need:

  • PHP 5.6 or later installed. Currently Ouzo is tested on 5.6, 7.0, and 7.1 environments.
  • Database driver, accordingly to the database your are using.

In order to get list of available drivers check http://www.php.net/manual/en/pdo.getavailabledrivers.php.

Configure HTTP Server

Ouzo apps can be run on Apache web server. It needs mod_rewrite enabled. Once you have previous step completed, change document root to myproject.

Ouzo Configuration

Ouzo configuration is located under config/prod/config.php.

What's important for now is that debug is turned on by default. Please, leave it like this for installation purposes, as you will be able to see detailed error messages in case something goes wrong.

Database Configuration

Configuration is automatically generated for database of your choice. The only thing you need to do is to create database and database user first.

For MySQL:

CREATE DATABASE myproject;
CREATE USER 'ouzo'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON myproject.* TO 'ouzo'@'localhost';

For PostgreSQL:

CREATE DATABASE myproject;
CREATE USER ouzo WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE myproject to ouzo;

If you do not use composer, sample project has PostgreSQL by default. Database config can be found in Ouzo configuration file:

$config['db']['dbname'] = 'myproject';
$config['db']['user'] = 'ouzo';
$config['db']['pass'] = 'password';
$config['db']['driver'] = 'pgsql';
$config['db']['host'] = '127.0.0.1';
$config['db']['port'] = '5432';
$config['sql_dialect'] = '\\Ouzo\\Db\\Dialect\\PostgresDialect';

You need to provide database name, user name & password, driver, host, port and SQL dialect class. For now Ouzo supports:

  • PostgreSQL - \Ouzo\Db\Dialect\PostgresDialect
  • MySQL - \Ouzo\Db\Dialect\MySqlDialect
  • SQLite3 - \Ouzo\Db\Dialect\Sqlite3Dialect

Migrations

Your database is empty at the beginning. To demonstrate Ouzo capabilities we have created a sample database. Use db.sh script to apply migrations:

./db.sh db:migrate

To see full list of possible migrations related actions run:

./db.sh

Ouzo uses Ruckusing framework for migrations (https://github.com/ruckus/ruckusing-migrations).

Check out the app!

Open your favourite browser and go to http://localhost/myproject. Your first Ouzo project is now running! You can play around by adding, browsing and editing users.

Running tests

Test configuration can be found in config/test/config.php. You will need separate database for tests purposes only.

Set up for MySQL:

CREATE DATABASE myproject_test;
GRANT ALL PRIVILEGES ON myproject_test.* TO 'ouzo'@'localhost';

Set up for PostgreSQL:

CREATE DATABASE myproject_test;
GRANT ALL PRIVILEGES ON DATABASE myproject_test to ouzo;

Apply migrations:

environment=test ./db.sh db:migrate

Now run tests:

phpunit --bootstrap bootstrap_test.php test/

If all tests are passing, you're good to go!

More

Skeleton app explained: http://ouzo.readthedocs.org/en/latest/tutorials/project_structure_explained.html

Ouzo documentation: http://ouzo.readthedocs.org

letsdrink/ouzo-app 适用场景与选型建议

letsdrink/ouzo-app 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 394 次下载、GitHub Stars 达 14, 最近一次更新时间为 2013 年 09 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 letsdrink/ouzo-app 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 letsdrink/ouzo-app 我们能提供哪些服务?
定制开发 / 二次开发

基于 letsdrink/ouzo-app 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 394
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 16
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 12
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-09-16