V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  doyouhaobaby  ›  全部回复第 3 页 / 共 4 页
回复总数  62
1  2  3  4  
2018 年 11 月 8 日
回复了 doyouhaobaby 创建的主题 PHP QueryPHP 1.0.0-alpha.1 发布,渐进式 PHP 常驻框架引擎
@Donne 我在 2010 - 2014 开发一个框架 DoYouHaoBaby,这个是在哪个框架上重新重构,老框架留下了不少组件,甚至包含模板引擎,于是保留了下来。也依赖了很多 composer 包,重构了 2 年,自己的组件也有很多。

"php": "^7.1.3",
"ext-mbstring": "*",
"ext-openssl": "*",
"symfony/console": "~4.0",
"symfony/var-dumper": "~4.0",
"symfony/process": "~4.0",
"symfony/finder": "~4.0",
"clio/clio": "@stable",
"robmorgan/phinx": "^0.9.2",
"vlucas/phpdotenv": "~2.2",
"nesbot/carbon": "~1.20",
"league/flysystem": "^1.0.8",
"monolog/monolog": "^1.23",
"swiftmailer/swiftmailer": "6.0.2",
"nunomaduro/collision": "~2.0",
"twig/twig": "~2.0",
"gettext/gettext": "^4.6.0",
"fzaninotto/faker": "^1.6",
"zircote/swagger-php": "^3.0.1",
"maximebf/debugbar": "~1.15.0"
2018 年 11 月 8 日
回复了 doyouhaobaby 创建的主题 PHP QueryPHP 1.0.0-alpha.1 发布,渐进式 PHP 常驻框架引擎
@server 我也选择 golang,我研究了一段时间了 gin,哈哈
2018 年 11 月 8 日
回复了 doyouhaobaby 创建的主题 PHP QueryPHP 1.0.0-alpha.1 发布,渐进式 PHP 常驻框架引擎
@JaguarJack 不同的场景适应不同框架,轮子不是很多,遇到了才看看,golang 才叫轮子多。
新的项目出来,感兴趣就看看,不感兴趣的就忽略,大部分项目都会与我们生活插肩而过。
国内开源项目普遍工程化不如欧美的,我也看了不少 swoole 的轮子,很多连基本的单元没有怎么能稳定。
谢谢指正。
2018 年 11 月 1 日
回复了 894021573 创建的主题 PHP 为什么一些 PHP 框架,比如 thinkphp3 都有表结构缓存功能
这种设计有缺陷,很容易采坑的,TP3 在公司中用的时候自动过滤,比如字段单词拼写错误造成了很多隐晦的 bug,代码太依赖数据库了,我现在基本放弃这种写法了。把字段放到 model 层或者实体,用 getter setter 来做比较好,字段校验不依赖数据库。

```
<?php

declare(strict_types=1);

/*
* This file is part of the ************************ package.
* _____________ _______________
* ______/ \__ _____ ____ ______ / /_ _________
* ____/ __ / / / / _ \/ __`\/ / __ \/ __ \/ __ \___
* __/ / / / /_/ / __/ / \ / /_/ / / / / /_/ /__
* \_\ \_/\____/\___/_/ / / .___/_/ /_/ .___/
* \_\ /_/_/ /_/
*
* The PHP Framework For Code Poem As Free As Wind. <Query Yet Simple>
* (c) 2010-2018 http://queryphp.com All rights reserved.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Tests\Database\Ddd\Entity\Relation;

use Leevel\Database\Ddd\Entity;

/**
* post.
*
* @author Xiangmin Liu <[email protected]>
*
* @since 2018.10.13
*
* @version 1.0
*/
class Post extends Entity
{
const TABLE = 'post';

const ID = 'id';

const AUTO = 'id';

const STRUCT = [
'id' => [
'readonly' => true,
],
'title' => [],
'user_id' => [],
'summary' => [],
'create_at' => [],
'delete_at' => [],
'user' => [
self::BELONGS_TO => User::class,
'source_key' => 'user_id',
'target_key' => 'id',
],
'comment' => [
self::HAS_MANY => Comment::class,
'source_key' => 'id',
'target_key' => 'post_id',
self::SCOPE => 'comment',
],
'post_content' => [
self::HAS_ONE => PostContent::class,
'source_key' => 'id',
'target_key' => 'post_id',
],
];

const DELETE_AT = 'delete_at';

private $id;

private $title;

private $userId;

private $summary;

private $createAt;

private $deleteAt;

private $user;

private $comment;

private $postContent;

public function setter(string $prop, $value)
{
$this->{$this->prop($prop)} = $value;

return $this;
}

public function getter(string $prop)
{
return $this->{$this->prop($prop)};
}

public function scopeComment($select)
{
$select->where('id', '>', 4);
}

public function scopeTest($select)
{
$select->where('id', '>', 4);
}

public function scopeTest2($select)
{
$select->where('id', '<', 10);
}

public function scopeTest3($select)
{
$select->where('id', 5);
}
}
```

https://github.com/hunzhiwange/framework/blob/master/tests/Database/Ddd/Entity/Relation/Post.php
2018 年 10 月 31 日
回复了 Zhiyicx 创建的主题 PHP 社交系统 ThinkSNSPlus V2.0 更新播报
好,非常棒的产品
star
2018 年 9 月 28 日
回复了 pwstrick 创建的主题 程序员 大家在开发的时候都会写单元测试吗?
提高代码质量,微重构必须,梳理思路
https://github.com/hunzhiwange/framework/tree/master/tests
@linxl 需求分析完,都是后端先写文档,然后一起讨论是否合理,然后 easymock 基于生成的 swagger json 来生成 mock 数据,前端分开做,最后一起联调。实际上写文档是必须的,复制粘贴改改就行。
时间比较仓促,睡觉,明天要搬砖。
2018 年 9 月 8 日
回复了 Sor 创建的主题 PHP Laravel Homestead 6.3 最新云盘分享
一般都是自己搭建,原滋原味,laravel 考虑太多了
@zarte 要求 php7 有啥问题,细说一下呢,我看看。
@millken 已关注,晚上回去看看
@yangqi 这个 php 现在内置,编译带上,非第三方扩展,mbstring 系列可以避免以前 iconv 一些兼容判断,openssl 这个加解密必需的。
@dajj 是这样的,首先用法上要遵循 psr,api 与 laravel 和 symfony 等贴近,http 组件基于 symfony 二次开发,主要是为了编译成 zephir 扩展,例外用 composer 里面精致轮子,避免重复造这些非核心组件。第二个就是完整地对所有核心采用 zephir 制作成 c 扩展来提升性能。最后也是以后的重点是对 swoole 的支持,未来主要在这一块进行扩展。php7(2|3)+redis+框架扩展化常驻+swoole 业务常驻+微服务基础设施整合(比如统一配置中心,服务注册于发现,与 grpc 和 thrift,以及日志系统接入),最后两个做了一点点,是未来重点关注对象
@zhaolion 说的有道理,还未出生没社区,一点点坚持
@fleam 有点厉害
@yangqi 不依赖 ext
@lincanbin 你可以试试,不开启 opcache 有 30-40 ms 提升,在我的 macbook pro 上。
https://github.com/hunzhiwange/queryphp/blob/master/www/index.php
@jfcherng 我这是在 composer 前注册自己的自定义类加载机制提升匹配效率,小几率失败然后注册 composer 的类加载机制
@jswh opcache 知道,未开启 opcache 的情况下,每每做基本的优化减少磁盘 IO 看到这里消耗过多的性能。心痛。
2018 年 7 月 25 日
回复了 lxerxa 创建的主题 PHP ActionView - 开源的免费的类 Jira 的问题需求跟踪工具
看起来非常不错,回去研究哈
1  2  3  4  
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5741 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 23ms · UTC 02:41 · PVG 10:41 · LAX 19:41 · JFK 22:41
♥ Do have faith in what you're doing.