想在 FreeBSD 系統上開發網頁, 看了 wordpress, joomla, Laravel,...., 嗯! 30 分鐘就有一個網站雛型, 真快! 但網站上我還想加一些東西, 於是挑上了 Phalcon, 希望能揪結下一些同好一起學習,.....(Mail: alexk1107@gmail.com)
Phalcon 2.1... 目前是 RC1 它支援 PHP 7 (PHP 與 Phalcon 同樣都是 C 開發的), 推測 8 月中旬會釋出 Phalcon 2.1 正式版,
說明文件->https://docs.phalconphp.com/en/latest/index.html
討論區->https://forum.phalconphp.com/
Phalcon 2.1 的改變如下:
https://blog.phalconphp.com/
Changes in Phalcon 2.1
PHP 5.3 is no longer supported
Phalcon\Mvc\Model\Validation is now deprecated in favor of Phalcon\Validation
The default encrypt mode in Phalcon\Crypt is now changed to MCRYPT_MODE_CFB
Changed default hash algorithm in Phalcon\Security to CRYPT_BLOWFISH_Y
Changed constructor of Phalcon\Mvc\Model allowing you to pass an array of initialization data
Removed support for prefixes strategy in Phalcon\Loader
Phalcon\Mvc\View now supports many views directories
An absolute path can now be used for Mvc\View::setLayoutsDir
Fixed odd view behavior #1933 related to setLayout() and pick()
Phalcon\Di is now bound to service closures allowing use Phalcon\Di as $this to access services within the closures
If an object is returned after firing the event beforeServiceResolve in Phalcon\Di it overrides the default service localization process
Placeholders :controller and :action in Mvc\Router now default to /([\\w0-9\_\-]+) instead of /([\\a-zA-Z0-9\_\-]+)
Modifier #u (PCRE_UTF8) is now the 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 and view behavior
Phalcon\Mvc\Model now implements JsonSerializable making easy serialize model instances
When destructing a Mvc\Model\Manager PHQL cache is cleared
Method isSetOption in Phalcon\Validation\ValidatorInterface marked as deprecated. You can now use hasOption instead
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
Phalcon\Events\Event now 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 is renamed to Phalcon\Mvc\Model\Criteria::getOrderBy
Added method getOption() in Phalcon\Mvc\Model\RelationInterface
Added ability to spoof the 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. You can now pass objects to Phalcon\Acl\AdapterInterface::isAllowed as roleName and resourceName, which will be automatically passed to the function defined in Phalcon\Acl\AdapterInterface::allow or Phalcon\Acl\AdapterInterface::deny by type
Phalcon\Acl\AdapterInterface::allow and Phalcon\Acl\AdapterInterface::deny have now a 4th argument - function, which will be called when using Phalcon\Acl\AdapterInterface::isAllowed
Phalcon\Acl\AdapterInterface::isAllowed has now a 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 the 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
Fire the dispatch:beforeException event when there is an 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
Mcrypt is replaced with openssl in Phalcon\Crypt
Removed methods setMode(), getMode(), getAvailableModes() in Phalcon\CryptInterface
Added Phalcon\Assets\Manager::exists() to check if collection exists
好消息 Phalcon 3.0 正式版釋出, 已支援 PHP 7 了, 快來測試一下.....
Test OK!
step 1: 下載 xampp-win32-7.0.8-0-VC14-installer.exe 安裝 XAMPP (v3.2.2 for PHP 7) 在 D 碟.
step 2: 下載 Phalcon 動態連結庫 phalcon_x86_vc14_php7.0.0_3.0.0.zip, 解壓後將 php_phalcon.dll copy 至 D:\xampp\php\ext 目錄中 (XAMPP安裝在 D 碟).
step 3: 編輯 D:\xampp\php\php.ini, 在 921 行插入 extension=php_phalcon.dll 後儲存離開.
step 4: 重啟動 Apache Stop --> Star, 點 Admin 按鈕, 在瀏覽器右上方點選 PHPinfo 的菜單, 顯示 PHP 7 相關資訊.
step 5: Ctrl + F 找尋 Phalcon, 可看到 Phalcon v3.0 的相關資訊, 表示 Window 下 Phalcon 安裝成功.
Dear all,
又往前邁進了一步:
Step 1: 在 D:\xampp\htdocs 創建一個新目錄 tutorial.
Step 2: 開啟 https://github.com/phalcon/tutorial 網頁的右側 Clone or Download 下拉按鈕的 Download Zip 選項下載 Phalcon 一個簡單的範例, 將其檔案內容解壓到D:\xampp\htdocs\tutorial 目錄中.
Step 2: 開啟 Google or IE 瀏覽器, URL 輸入 http://localhost/tutorial/index.php 即可見 Hello! 畫面, 搞定!
只是 MySQL 資料庫連不上(我的資料庫是 MariaDB).