PhalconPHP 3.0.0 正式发布,高性能 PHP 框架 - 开源中国社区
PhalconPHP 3.0.0 正式发布,高性能 PHP 框架
mia0x75 2016年07月30日

PhalconPHP 3.0.0 正式发布,高性能 PHP 框架

mia0x75 mia0x75 发布于2016年07月30日 收藏 14

有免费的MySQL,为什么还要买? >>>  

PhalconPHP 3.0.0 正式发布了,由于新版BC问题,根据semver,2.1.x不再发布,改为3.0.0。

下载地址:

https://github.com/phalcon/cphalcon/archive/v3.0.0.tar.gz

更新日志:

  • PHP 5.3 and 5.4 are now fully deprecated

  • Phalcon\Mvc\Model\Validation is now deprecated in favor of Phalcon\Validation

  • Changed default hash algorithm in Phalcon\Security to CRYPT_BLOWFISH_Y

  • Changed constructor of Phalcon\Mvc\Model to allow pass an array of initialization data

  • Removed support for prefixes strategy in Phalcon\Loader

  • Now Phalcon\Mvc\View supports many views directories at the same time

  • An absolute path can now be used to Mvc\View::setLayoutsDir

  • Fixed odd view behavior#1933 related to setLayout() and pick()

  • Phalcon\Di is now bound to services closures allowing use Phalcon\Di as $this to access services within them

  • If an object is returned after firing the event beforeServiceResolve in Phalcon\Di this overrides the default service localization process

  • Placeholders :controller and :action in Mvc\Router now defaults to /([\\w0-9\\_\\-]+) instead of /([\\a-zA-Z0-9\\_\\-]+)

  • Modifier #u (PCRE_UTF8) is now default in regex based routes in Mvc\Router

  • Return 'false' from an action disables the view component (same as $this->view->disable())

  • Return a string from an action takes it as the body of the response (same as return $this->response->setContent('Hello world'))

  • Return a string from an Mvc\Micro handler takes it as the body of the response

  • Mvc\Router\Route now escapes characters such as . or + to avoid unexpected behaviors

  • Closures used as handlers inMvc\Micro are now bound to the $app instance

  • Routes now can have an associated callback that can override the default dispatcher + view behavior

  • Phalcon\Mvc\Model now implements JsonSerializable making easy serialize model instances

  • When destructing a Mvc\Model\Manager PHQL cache is clean

  • Method isSetOption in Phalcon\Validation\ValidatorInterface marked as deprecated, please use hasOption

  • Added internal check "allowEmpty" before calling a validator. If it option is true and the value of empty, the validator is skipped

  • Added default header: Content-Type: "application/json; charset=UTF-8" in method Phalcon\Http\Response::setJsonContent

  • Now Phalcon\Events\Event implements Phalcon\Events\EventInterface

  • Phalcon\Events\Event::getCancelable renamed to Phalcon\Events\Event::isCancelable

  • Removed Phalcon\Events\Manager::dettachAll in favor of Phalcon\Events\Manager::detachAll

  • Phalcon\Mvc\Model\Criteria::getOrder renamed to Phalcon\Mvc\Model\Criteria::getOrderBy

  • Added method getOption() in Phalcon\Mvc\Model\RelationInterface

  • Added ability to spoof HTTP request method

  • Added FULLTEXT index type to Phalcon\Db\Adapter\Pdo\Mysql

  • Fixed the use of the annotation router with namespaced controllers

  • Added Phalcon\Acl\RoleAware and Phalcon\Acl\ResourceAware Interfaces, Now you can pass objects to Phalcon\Acl\AdapterInterface::isAllowed as roleName and resourceName, also they will be automatically passed to function defined in Phalcon\Acl\AdapterInterface::allow or Phalcon\Acl\AdapterInterface::deny by type

  • Phalcon\Acl\AdapterInterface::allow and Phalcon\Acl\AdapterInterface::deny have 4th argument - function, which will be called when using Phalcon\Acl\AdapterInterface::isAllowed

  • Phalcon\Acl\AdapterInterface::isAllowed have 4th argument - parameters, you can pass arguments for function defined in Phalcon\Acl\AdapterInterface:allow or Phalcon\Acl\AdapterInterface::deny as associative array where key is argument name

  • Added method getActionSuffix() in Phalcon\DispatcherInterface

  • CLI parameters are now handled consistently.

  • Added Phalcon\Mvc\Controller\BindModelInterface and associated model type hint loading through dispatcher.

  • Added Phalcon\Dispatcher::hasParam().

  • Phalcon\Cli\Console and Phalcon\Mvc\Application now inherit Phalcon\Application.

  • Fixed afterFetch event not being sent to behaviors

  • Fixed issue with radio not being checked when default value is 0 #11358

  • Fixed issue with Model::__set that was bypassing setters #11286

  • Fixed issue with Model::__set that was setting hidden attributes directly when setters are not declared #11286

  • Added Phalcon\Cli\DispatcherInterface, Phalcon\Cli\TaskInterface, Phalcon\Cli\RouterInterface and Phalcon\Cli\Router\RouteInterface.

  • Added Phalcon\Mvc\Collection::update, Phalcon\Mvc\Collection::create and Phalcon\Mvc\Collection::createIfNotExist

  • Removed __construct from all interfaces #11410

  • Fires the dispatch:beforeException event when there is any exception during dispatching #11458

  • Added OR operator for Phalcon\Mvc\Model\Query\Builder methods: betweenWhere, notBetweenWhere, inWhere and notInWhere

  • Fixed bug of destroy method of Phalcon\Session\Adapter\Libmemcached

  • Added Phalcon\Cache\Backend\Memcache::addServers to enable pool of servers for memcache

  • Added setLastModified method to Phalcon\Http\Response

  • Added Phalcon\Validation\Validator\Date

  • Added \Phalcon\Queue\Beanstalk::ignore() It removes the named tube from the watch list for the current connection.

  • Added \Phalcon\Queue\Beanstalk::pauseTube() Can delay any new job being reserved for a given time.

  • Added \Phalcon\Queue\Beanstalk::kick() It moves jobs into the ready queue. If there are any buried jobs, it will only kick buried jobs. Otherwise it will kick delayed jobs.

  • Added \Phalcon\Queue\Beanstalk::listTubeUsed() Returns the tube currently being used by the client.

  • Added \Phalcon\Queue\Beanstalk::listTubesWatched() Returns a list tubes currently being watched by the client.

  • Added \Phalcon\Queue\Beanstalk::peekDelayed() Return the delayed job with the shortest delay left.

  • Added \Phalcon\Queue\Beanstalk::jobPeek() Return job.

  • Mcrypt is replaced with openssl in Phalcon\Crypt

  • Default encrypt algorithm in Phalcon\Crypt is now changed to AES-256-CFB

  • Removed methods setMode(), getMode(), getAvailableModes() in Phalcon\CryptInterface

  • Added Phalcon\Assets\Manager::exists() to check if collection exists

  • Phalcon\Mvc\Model\Manager::load() now can load models from aliased namespaces

  • Phalcon\Mvc\Model\Transaction\Manager now correctly keeps account of transactions #11554

  • Phalcon\Db\Dialect\Sqlite now maps additional column types to SQLite columns equivalents.

  • Phalcon\Security is using now Phalcon\Security\Random

  • Enforced that Phalcon\Security::getToken() and Phalcon\Security::getTokenKey() return a random value per request not per call

  • Phalcon\Security::getToken() and Phalcon\Security::getTokenKey() are using now Phalcon\Security::_numberBytes instead of passed as a argument or hardcoded value

  • Phalcon\Security::hash() corrected not working CRYPT_STD_DES, CRYPT_EXT_DES, MD5, CRYPT_SHA256

  • Phalcon\Security::hash() CRYPT_SHA512 fixed wrong salt length

  • Added missing unit-tests for Phalcon\Security

  • Fixed Filter::add method handler #11581

  • Removed Phalcon\Session #11340

  • Phalcon\Tag::getTitle() shows a title depending on prependTitle and appendTitle

  • Using a settable variable for the Mongo Connection Service name instead of a hard coded string #11725

  • Added new getter Phalcon\Mvc\Model\Query\Builder::getJoins() - to get join parts from query builder

  • Fixed Phalcon\Db\Dialect\Oracle::prepareTable() to correctly generate SQL for table aliases #11799

  • Fixed Phalcon\Mvc\Model\Resultset::update() - removed endless loop queries

  • The cache backend adapters now returns boolean on call Phalcon\Cache\BackendInterface::save

  • Fixed the Session write callback #11733

  • Added '\Phalcon\Loader::registerFiles' & '\Phalcon\Loader::getFiles'. This allows you to add files to the autoloader

  • Added Phalcon\Security::hasLibreSsl and Phalcon\Security::getSslVersionNumber

  • Added new setter Phalcon\Escaper::setDoubleEncode() - to allow setting/disabling double encoding

  • Added Phalcon\Cache\Frontend\Msgpack - Added Msgpack Support for Frontend Cache

  • Phalcon\Debug\Dump skip debugging di, fix detecting private/protected properties

  • Added option to validate multiple fields with one validator(fix uniqueness validator as well), also removes unnecessary model => $this in Phalcon\Validation\Validator\Uniqueness.

  • Phalcon\Validation\Validator\Alpha now correctly validates non-ASCII characters #11386

  • Phalcon\Validation\Validator\Digit now correctly validates digits #11374

  • Added Phalcon\Validation\CombinedFieldsValidator, validation will pass array of fields to this validator if needed

  • Added ability to autoescape Flash messages #11448

  • Fixed Phalcon\Config::merge for working with php7

  • Added ability to use custom delimiter for Phalcon\Text::camelize and Phalcon\Text::uncamelize #10396

  • Added support of CONNECT, TRACE and PURGE HTTP methods

  • Refactored Phalcon\Http\Request::getHttpHost. Now it always return host name or empty string. Optionally validates and clean host name #2573

  • Added Phalcon\Http\Request::getPort. To get information about the port on which the request is made.

  • Added Phalcon\Http\Request::setStrictHostCheck and Phalcon\Http\Request::isStrictHostCheck to manage strict validation of host name.

  • Fixed matching host name by Phalcon\Mvc\Route::handle when using port on current host name #2573

  • Fixed Phalcon\Text:dynamic() to allow custom separator #11215

  • Fixed Phalcon\Validation::appendMessage to allow append message to the empty stack #10405

  • Fixed Phalcon\Session\Flash::getMessages. Now it returns an empty array in case of non existent message type request #11941

  • Amended Phalcon\Mvc\RouterInterface and Phalcon\Mvc\Router. Added missed addPurge, addTrace and addConnect methods

  • Fixed incorrect query when using NULL fields with Phalcon\Validation\Validator\Uniqueness

  • Fixed Phalcon\Forms\Form::getValue. Now Elements can have names that match with the internal Form getters #10398

  • Add setContentLength() method to Phalcon\Http\Response

  • Fixed Phalcon\Mvc\Model\Manager::_mergeFindParameters - Merging conditions #11987

  • Renamed Phalcon\Http\Request::isSoapRequest to Phalcon\Http\Request::isSoap and Phalcon\Http\Request::isSecureRequest to Phalcon\Http\Request::isSecure. Left the originals functions as aliases and marked them deprecated.

  • Fixed wildcard inheritance in Phalcon\Acl\Adapter\Memory #12004

  • Dropped support of Oracle #12008

  • Improved Phalcon\Mvc\Collection::findById. Added check if a id in a valid format #12010

  • Added convert option to Phalcon\Validation\Validator\Uniqueness to convert values to do the database lookup #12005

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处,尊重他人劳动共创开源社区。
转载请注明:文章转载自 开源中国社区 [http://www.oschina.net]
本文标题:PhalconPHP 3.0.0 正式发布,高性能 PHP 框架
分享
评论(24)
最新评论
0

引用来自“__Untitled”的评论

只能说Yaf实现了MVC的核心而已,Phalcon是一个全栈式框架,两者不是一个量级的。用Yaf需要配合一大堆第三方库才能完成一个项目(比如基本的数据访问都没有),而Phalcon基本很少依赖第三方库。

不过我在CentOS 7 x64的阿里云无法编译,长时间的磁盘读操作,看看有没有其他人遇到。
阿里云ECS无法编译C的解决方法(通过开启swap分区)
https://www.ksphp.com/docs/Phalcon/install?lang=zh-CN
慢慢等下会成功的,我用55元的试过,后面升级1G内存要相对快点!
0

引用来自“__Untitled”的评论

只能说Yaf实现了MVC的核心而已,Phalcon是一个全栈式框架,两者不是一个量级的。用Yaf需要配合一大堆第三方库才能完成一个项目(比如基本的数据访问都没有),而Phalcon基本很少依赖第三方库。

不过我在CentOS 7 x64的阿里云无法编译,长时间的磁盘读操作,看看有没有其他人遇到。
解决了吗 我也遇到了 阿里云卡死
0
WELL DONE!
0
@红白机 鸟哥的Yaf实现了MVC,不复杂,对PHP性能影响不大,不会搞出什么ORM/AR/模板引擎这些玩意.而且毕竟是大神的成名作,不喜欢也可以看看:
http://cn2.php.net/manual/zh/yaf.tutorials.php
0

引用来自“eechen”的评论

鸟哥在月初发布了纯C开发的PHP框架Yaf版本3.0.3,支持PHP7:
http://pecl.php.net/package/yaf
http://cn2.php.net/manual/zh/book.yaf.php
提供有Windows上的DLL文件:
http://pecl.php.net/package/yaf/3.0.3/windows
你不是无框架支持者么?
0

引用来自“__Untitled”的评论

只能说Yaf实现了MVC的核心而已,Phalcon是一个全栈式框架,两者不是一个量级的。用Yaf需要配合一大堆第三方库才能完成一个项目(比如基本的数据访问都没有),而Phalcon基本很少依赖第三方库。

不过我在CentOS 7 x64的阿里云无法编译,长时间的磁盘读操作,看看有没有其他人遇到。

引用来自“alexleft”的评论

鸟哥推荐使用PDO来操作数据库,大多数场景下没必要再引入一个复杂的ORM。
必须的.ORM是一种为了迎合OOP,过度抽象的失败的模式, 不仅增加了学习成本,还影响性能,而且欠缺灵活性(比如难以实现复杂的SQL JOIN查询). 对数据库而言,SQL的表达能力和灵活性根本不是ORM能比的. 而且PHP关联数组本身就能够充分表达(存储)关系查询的结果,比用对象存储更合适. ORM这种设计,简直就是跟SQL和PHP背道而驰. Java的数组没有PHP灵活,而且过度依赖类和对象(完全面向对象的锅),所以才会把SQL关系映射成对象. 拒绝框架ORM/AR,SQL+PHP关联数组才是王道.
http://my.oschina.net/eechen/blog/663332

PDO普通查询:
$db = new PDO('mysql:dbname=mybase;host=127.0.0.1;port=3306','user','pass');
var_export($db->query('SELECT * FROM posts WHERE id = '.intval($_GET['id']))->fetchAll());

PDO预处理绑定参数查询:
$db = new PDO('mysql:dbname=mybase;host=127.0.0.1;port=3306','user','pass');
$stmt = $db->prepare('SELECT * FROM posts WHERE id = ?');
$stmt->execute(array($_GET['id']));
var_export($stmt->fetchAll());
0

引用来自“__Untitled”的评论

只能说Yaf实现了MVC的核心而已,Phalcon是一个全栈式框架,两者不是一个量级的。用Yaf需要配合一大堆第三方库才能完成一个项目(比如基本的数据访问都没有),而Phalcon基本很少依赖第三方库。

不过我在CentOS 7 x64的阿里云无法编译,长时间的磁盘读操作,看看有没有其他人遇到。

引用来自“二戒”的评论

我的编译成功了,自己的服务器,centos 6.8 x64, 用的iuscommunity.org的php 7.0.9包,编译时卡住了,负载上升到30多。我都以为卡死了,没想到2-3分钟后,好了。
自己写个30-phalcon3.ini文件,内容为
[phalcon]
extension=phalcon.so
然后将这个文件放到/etc/php.d中去。
重启php-fpm成功了。
不能直接编辑到/etc/php.ini,否则出错。

引用来自“炮炮”的评论

求编译方法

引用来自“二戒”的评论

按官方说明编译就行了呀,安装php-devel pcre-devel后,下载phalcon源码包,解压后,进入build 目录,运行 ./install 自动就开始编译了。
汗。。。 我还在用之前的方法——
yum install re2c -y
cd ~
git clone https://github.com/phalcon/zephir.git
cd zephir
./install -c

git clone https://github.com/phalcon/cphalcon.git
cd cphalcon
zephir build --backend=ZendEngine3

原来现在可以直接编译了,我在阿里云上(7.2.1511)编译成功了【lnmp是编译安装的】
多谢!
0

引用来自“__Untitled”的评论

只能说Yaf实现了MVC的核心而已,Phalcon是一个全栈式框架,两者不是一个量级的。用Yaf需要配合一大堆第三方库才能完成一个项目(比如基本的数据访问都没有),而Phalcon基本很少依赖第三方库。

不过我在CentOS 7 x64的阿里云无法编译,长时间的磁盘读操作,看看有没有其他人遇到。

引用来自“二戒”的评论

我的编译成功了,自己的服务器,centos 6.8 x64, 用的iuscommunity.org的php 7.0.9包,编译时卡住了,负载上升到30多。我都以为卡死了,没想到2-3分钟后,好了。
自己写个30-phalcon3.ini文件,内容为
[phalcon]
extension=phalcon.so
然后将这个文件放到/etc/php.d中去。
重启php-fpm成功了。
不能直接编辑到/etc/php.ini,否则出错。

引用来自“炮炮”的评论

求编译方法
按官方说明编译就行了呀,安装php-devel pcre-devel后,下载phalcon源码包,解压后,进入build 目录,运行 ./install 自动就开始编译了。
0

引用来自“__Untitled”的评论

只能说Yaf实现了MVC的核心而已,Phalcon是一个全栈式框架,两者不是一个量级的。用Yaf需要配合一大堆第三方库才能完成一个项目(比如基本的数据访问都没有),而Phalcon基本很少依赖第三方库。

不过我在CentOS 7 x64的阿里云无法编译,长时间的磁盘读操作,看看有没有其他人遇到。

引用来自“二戒”的评论

我的编译成功了,自己的服务器,centos 6.8 x64, 用的iuscommunity.org的php 7.0.9包,编译时卡住了,负载上升到30多。我都以为卡死了,没想到2-3分钟后,好了。
自己写个30-phalcon3.ini文件,内容为
[phalcon]
extension=phalcon.so
然后将这个文件放到/etc/php.d中去。
重启php-fpm成功了。
不能直接编辑到/etc/php.ini,否则出错。
求编译方法
0
很好,3.0终于来了
0
定位不好.还是laravel
0
简单操作orm,复杂的querybuilder,再复杂就phql了
0
毫不夸张的说,phalcon是php全栈框架里面最屌的,没有之一。更重要的是性能卓越,当然,开发中黑盒是一个弊端。但对于追求极致的开发者和协同规范的团队来说,非常值得采用。
0

引用来自“eechen”的评论

鸟哥在月初发布了纯C开发的PHP框架Yaf版本3.0.3,支持PHP7:
http://pecl.php.net/package/yaf
http://cn2.php.net/manual/zh/book.yaf.php
提供有Windows上的DLL文件:
http://pecl.php.net/package/yaf/3.0.3/windows
OSC最讨厌的人:@eechen ,同意的右下角。via Bery http://my.oschina.net/bery/tweet/9658008
@eechen真的很菜,一个冒泡算法都能写如此糟糕,真的很无语:http://my.oschina.net/eechen/tweet/4105363
osc的大神 @eechen 和他的盗版作品 在知乎惨遭吊打,osc的小伙伴赶紧过去支援,传送门:https://www.zhihu.com/question/48350013 via falconchen
0
专门为php7发布的?是lts吗
0

引用来自“__Untitled”的评论

只能说Yaf实现了MVC的核心而已,Phalcon是一个全栈式框架,两者不是一个量级的。用Yaf需要配合一大堆第三方库才能完成一个项目(比如基本的数据访问都没有),而Phalcon基本很少依赖第三方库。

不过我在CentOS 7 x64的阿里云无法编译,长时间的磁盘读操作,看看有没有其他人遇到。
我的编译成功了,自己的服务器,centos 6.8 x64, 用的iuscommunity.org的php 7.0.9包,编译时卡住了,负载上升到30多。我都以为卡死了,没想到2-3分钟后,好了。
自己写个30-phalcon3.ini文件,内容为
[phalcon]
extension=phalcon.so
然后将这个文件放到/etc/php.d中去。
重启php-fpm成功了。
不能直接编辑到/etc/php.ini,否则出错。
0
好东西,个人就喜欢高性能的框架,任何以增加硬件获得的性能持平都是耍流氓。
0
不错,有高性能要求的业务可以考虑phalcon,因为这货是俄罗斯的,所以影响力不太强,感觉极客用的比较多。
0
当然支持PHP7了,orm觉的复杂,可以不用呀
0

引用来自“AngusXer”的评论

我就问问这个版本支持PHP7了没有
貌似支持了,官网上说On top of that we have been working in making Zephir PHP7 compatible so that you can enjoy Phalcon in your PHP7 application.
顶部