Phalcon v1.3.0 Release Notes

Release Date: 2014-03-19 // about 10 years ago
    • Make the source code compatible with PHP 5.6-dev and PHP 5.7-dev (#1762)
    • Code cleanup: get rid of compiler warnings, dead code elimination, code deduplication, use static code analysers to eliminate possible bugs (#801, #802, #810, #825, #827, #838, #849, #942, #968, #1001, #1093, #1169, #1214, #1223, #1224, #1375, #1430, #1787, #1794, #1828)
    • Fixed various memory leaks (#469, #860, #910, #914, #916, #1031, #1067, #1249, #1273, #1291, #1309, #1345, #1455, #1470, #1700)
    • Fixed memory access violations / segmentation faults / etc (#469, #849, #851, #852, #858, #860, #861, #895, #911, #918, #927, #928, #1000, #1077, #1112, #1113, #1131, #1149, #1173, #1272, #1284, #1302, #1340, #1343, #1368, #1369, #1371, #1376, #1379, #1392, #1451, #1466, #1485, #1494, #1501, #1504, #1509, #1567, #1607, #1983, #1006)
    • Fixed PHP notices, warnings and other incompatibilities (#894, #1222, #1315, #1413, #1427, #1428, #1529, #1988, #1998)
    • Fixed inheritance chain for Phalcon\Forms\Exception, Phalcon\Loader\Exception, Phalcon\Http\Request\Exception (#1770)
    • Major source code optimizations (#1785, #1972, #2003)
    • Control Phalcon behavior via INI settings (#1796)
    • Security fixes:
    • Phalcon Kernel:
      • 32 and 64 bit hashes can be computed on the same CPU architecture (#817)
      • Reduced overall memory usage (#834, #891, #893)
      • Memory allocation optimizations (#912, #1220, #1987)
      • Faster internal array and string manipulation (#822, #823, #830, #833, #837, #890, #1972)
      • Camelize does not ignore the last character of a string anymore (#1436)
      • Fixed bug in phalcon_fix_path() (#1601)
      • Use native counterparts for memory_get_usage(), gettype(), json_encode(), json_decode(), session_XXX(), header(), headers_sent(), debug_backtrace(), lcfirst(), ob_XXX(), array_unshift(), array_values(), array_keys(), htmlentities() (#836, #847, #936, #945, #1099)
      • Hash functions tailored for object handlers (#842)
      • Optimization of calls to userland functions and methods (#843, #954)
      • Read/modify/update optimization on properties (#848)
      • Added support for self/parent/static scopes in static properties (#943)
      • Scope lookup optimizations (#948)
      • Do not restore memory frames from kernel functions (#960, #976)
      • Diagnostic messages when Phalcon is compiled in dev mode (#1009, #1054, #1097)
      • Return Value Optimization (#1046, #1047, #1075)
      • Fixed locale issue (#1095)
      • Added support for interned strings (PHP 5.4+)
      • Static property fetch/update optimization (#1293)
      • Fix misleading diagnostics on exception (#1297)
      • Use preallocated permanent zvals instead of null, true, false, 0 and 1 (#1302)
      • Bug fix in phalcon_fix_path() (#1591)
      • Persistent function cache for Phalcon methods (#1825)
      • Function call optimization (#1846)
      • Use Native Reflection API (#1957)
    • Phalcon\Acl:
      • Fixed broken ACL inheritance (#905)
      • Bug fix when ACL allowed access to forbidden resources (#1303)
      • Fixed bug with ACL * wildcard (#1409)
      • Fixed bug with numeric resources (#1513)
      • Phalcon\Acl\Adapter now implements Phalcon\Acl\AdapterInterface (#1852)
    • Phalcon\Annotations:
      • Fixed getProperty() bug in AnnotationsAdapter (#996)
      • Phalcon\Annotations optimizations (#1141)
      • Fixed parsing of annotations containing / (#1480)
      • Phalcon\Annotations\Adapter now implements Phalcon\Annotations\AdapterInterface (#1852)
      • Annotation parser optimization (#1957)
    • Phalcon\Assets:
      • Fixed bugs when minifier produced no output at all (#811, #821)
      • Fixed joining issue (#951)
      • Added support for UTF-8 characters in jsmin
      • Fixed chaining of CSS/JS filters (#1198)
      • Phalcon\Assets\Filters\CssMin and JsMin implement Phalcon\Assets\FilterInterface (#1539)
      • Added Phalcon\Assets\Collection::setTargetLocal() (#1532)
    • Phalcon\Cache:
      • Added Libmemcached cache backend (#913)
      • Added support for APCu 4.0.2+ (#1234)
      • Implemented Phalcon\Cache\Backend\Memory::queryKeys() (#1093)
      • Bug fixes in Phalcon\Cache\Backend\Xcache (#1406)
      • Phalcon\Cache\Frontend\Data optimizations (#1093)
      • Phalcon\Cache\Frontend\None optimizations (#1093)
      • Phalcon\Cache\Frontend\Base64 optimizations (#1093)
      • Phalcon\Cache\Frontend\Igbinary optimizations (#1093)
      • Phalcon\Cache\Frontend\Output optimizations (#1093)
      • Phalcon\Cache\Frontend\Json optimizations (#1093)
      • Phalcon\Cache\Backend optimizations (#1093)
      • Phalcon\Cache\Backend\Memory optimizations (#1093)
      • Phalcon\Cache\Backend\File optimizations (#1093)
      • Phalcon\Cache\Backend\Apc optimizations (#1093)
      • Phalcon\Cache\Backend\Xcache optimizations (#1093)
      • Phalcon\Cache\Backend\Memcache optimizations (#1093)
      • Phalcon\Cache\Backend\Mongo optimizations (#1093)
      • Phalcon\Cache\Backend\Libmemcached optimizations and bug fixes (#1093)
      • Added increment() and decrement() methods (#1374)
      • Added flush() method (#1352)
      • Phalcon\Cache\Backend now implements Phalcon\Cache\BackendInterface (#1852)
      • Ability to disable key tracking for Memcache/Libmemcached backends (#1550)
    • Phalcon\Config:
      • Faster Phalcon\Config implementation using object handlers (#837, #1277)
      • Phalcon\Config now support numeric properties as well (#837)
      • Implemented Phalcon\Config::offsetUnset() (#732)
      • Phalcon\Config\Adapter\Ini correctly handles empty sections and INI files without any sections (#829, #837)
      • Added Phalcon\Adapter\Config\Json class to read JSON configs (#844)
      • Phalcon\Config::merge now works with derived classes (#1024)
      • Dot-delimited directives in INI-files are now prsed correctly (#872)
      • Support for PHP arrays as config files (#1439)
    • Phalcon\Crypt:
      • Added support for various padding schemes (PKCS7, ANSI X.923, ISO 10126, ISO/IEC 7816-4, zero padding, space padding) to Phalcon\Crypt (#864, #887)
      • Reduced peak memory usage (#1237)
      • encryptBase64() and decryptBase64() can optionally use RFC 4648 flavor of BASE64 (#1353, #1919)
    • Phalcon\Db:
      • Added support for DECIMAL scale (#940)
      • Fixed invalid sequence names for PostgreSQL (#1022)
      • Added support for MySQL DOUBLE type (#1128)
      • Database dialects now support BOOLEAN data type (#816)
      • Added support for POINT type in MySQL (#1536)
      • Fixed issue with RawValue('default') on composite primary key (#1534)
      • Added support for AUTO_INCREMENT columns to addColumn() (MySQL, SQLite) and modifyColumn() (MySQL) (#1695)
      • Phalcon\Db\Dialect\Mysql::getColumnDefinition() now returns INT instead of INT(0) (#1695)
      • Added support for the following fetch modes from PDO: FETCH_LAZY, FETCH_BOUND, FETCH_COLUMN, FETCH_CLASS, FETCH_INTO, FETCH_FUNC, FETCH_NAMED, FETCH_KEY_PAIR (#1642)
      • Added support for the following fetch mode modifiers from PDO: FETCH_GROUP, FETCH_UNIQUE, FETCH_CLASSTYPE, FETCH_SERIALIZE, FETCH_PROPS_LATE (#1642)
      • Phalcon\Db optimizations (#1693)
      • Phalcon\Db\Adapter optimizations (#1693)
      • Phalcon\Db\Index optimizations (#1693)
      • Phalcon\Db\Profiler optimizations (#1693)
      • Phalcon\Db\Reference optimizations (#1693)
      • Phalcon\Db\Result\Pdo optimizations (#1693)
      • Phalcon\Db\Adapter now implements Phalcon\Db\AdapterInterface (#1852)
      • Phalcon\Db\Dialect now implements Phalcon\Db\DialectInterface (#1852)
    • Phalcon\Debug:
      • Added support for UTF-8 to \Phalcon\Debug (#1099)
      • Phalcon\Debug::uri now supports both http and https (#987)
      • Fixed array to string conversion notice (#1103)
      • Add support for xdebug.file_link_format (#1401)
    • Phalcon\DI:
      • Phalcon\Di optimizations (#1014) with workarounds for NuSphere DBG (#1714)
      • Added Phalcon\Di\Service::isResolved() method (#1242)
      • Make sure that 'persistent' is resolved only when accessed for the first time (#1637)
      • Faster DI implementation by using object handlers (#1473)
      • Changes to Phalcon\DiInterface (#2034)
        • removed setShared() method because it is a shorthand for set($name, $definition, true);
        • removed attempt() method because it is a shorthand for has() + set()
        • renamed setRaw() to setService() because getRaw() is actually getService() + $service->getDefinition()
        • setRaw() is now an alias for setService() but it will spit E_DEPRECATED
        • removed getRaw() because it is getService() + $service->getDefinition()
        • modified setService($name, $raw_definition) to setService($raw_definition) because service name can be retrieved from the definition
    • Phalcon\Dispatcher:
      • Dispatching parameters now can be modified in 'beforeExecuteRoute' events
      • 'beforeException' events can now handle exceptions occurred when executing actions (#140)
      • Added Phalcon\Dispatcher::getHandlerClass and Phalcon\Dispatcher::getActionMethod
      • Implemented afterInitialize event (#782)
      • Phalcon\Dispatcher optimizations (#782)
      • Added getPreviousControllerName(), getPreviousActionName() (#1462)
      • If an event handler throws an exception, call dispatch:beforeException and break the dispatch loop (#1763)
      • Phalcon\Dispatcher::_handleException() is invoked regardless whether the event manager is present (#1953)
    • Phalcon\Element:
      • Phalcon\Element::addFilter() incorrectly prepends NULL as the first element (#1019)
    • Phalcon\Escaper:
      • Fixed bugs in Phalcon\Escaper (#917)
      • Phalcon\Escaper optimizations (#1015)
      • Fix phalcon_escape_multi() to generate valid UTF-8 (#1681)
    • Phalcon\Events:
      • Added support for weak references (#663)
      • Bug fix in Phalcon\Events\manager::attach() (#1331, #1337)
    • Phalcon\Flash:
      • Phalcon\Flash\Session::getMessage('key') returns now an empty array if the key is not found (#908, #920)
      • Phalcon\Flash\Session::getMessages() incorrectly removed all messages (#1575)
      • Implemented Phalcon\Flash\Session::isset() (#1342)
    • Phalcon\Forms:
      • Phalcon\Forms\Element* classes now implement Phalcon\Form\ElementInterface
      • Added support for HTML attributes to Phalcon\Forms\Form::label() (#1029)
      • Phalcon\Forms\Form::getMessages() does not generate a fatal error if the form is valid (#1349)
      • Improvements to Phalcon\Forms\Form::add() (#1386)
      • Added Phalcon\Forms\Element\Radio class (#1646)
      • Phalcon\Forms\Form::hasMessagesFor() returns boolean (#1764)
      • Iterators for Phalcon\Forms\Form implemented via Zend API (#1765)
      • Phalcon\Forms\Form::count() implemented via Zend API (#1765)
      • Phalcon\Forms\Form optimizations (#1765)
      • Phalcon\Forms\Element now implements Phalcon\Forms\ElementInterface (#1852)
      • Fixed Phalcon\Forms\Element\Select::addOption() (#1955)
    • Phalcon\Http:
      • Phalcon\Http\Cookie can be used without sessions (#875)
      • Phalcon\Http\Cookie does not ignore expire time (#897)
      • Phalcon\Http\Request fully supports file arrays (#884, #888)
      • Phalcon\Http\Request optimizations (#889)
      • Added getKey(), getError(), isUploadedFile() methods to Phalcon\Http\Request\File (#878, #888)
      • Fixed regression in \Phalcon\Http\Request::getRawBody() (#1091)
      • Bug fix in Phalcon\Http\Request::getQuery() (#1226)
      • Fixed broken Phalcon\Http\Response::setFileToSend() method (#831, #832)
      • Redirects use status descriptions from RFC 2616 (#1175)
      • Phalcon\Http\Response::setFileToSend() can now show the file in the browser instead of offering to download it (#853)
      • Added Phalcon\Http\Response\Headers::toArray() (#1008)
      • getJsonRawBody() may return an associative array (#1241)
      • Added getURI(), getBasicAuth(), getDigestAuth() methods to Phalcon\Http\Request (#1250)
      • Added getPut()/hasPut() methods to Phalcon\Http\Request (#680, #1403)
      • Implemented Phalcon\Http\Request\File::getRealType (#1442, #1444)
      • External URLs are now automatically detected by Phalcon\Http\Response::redirect() (#1182)
      • Fixed error in Phalcon\Http\Response\Headers::send() when no headers were set (#2047)
    • Phalcon\Image:
    • Phalcon\Logger:
      • Added FirePHP Log Adapter and Formatter (#845, #1333, #1483)
      • Implemented Phalcon\Logger\Adapter::isTransaction() (#1238)
      • Fixed a bug preventing the EMERGENCY log type from being displayed correctly (#1498)
      • Added Phalcon\Logger\Adapter\File::getPath() (#1495, #1508)
      • Phalcon\Logger optimizations (#1716)
      • Phalcon\Logger\Adapter::setLogLevel() is honored by transactions (#1716)
      • Phalcon\Logger\Adapter::commit() now clears the queue (#1742)
      • Phalcon\Logger\Adapter now implements Phalcon\Logger\AdapterInterface (#1852)
      • Phalcon\Logger\Formatter now implements Phalcon\Logger\FormatterInterface (#1852)
      • Phalcon\Logger\Adapter and Phalcon\Logger\AdapterInterface are now PSR-3 compliant (#1873, #1888)
      • Added Phalcon\Logger\Adapter::critical() method (#1888)
      • For PHP 5.3.9+ when phalcon.register_psr3_classes php.ini option is set, Phalcon\Logger\Adapter implements Psr\Log\LoggerInterface (#1888)
      • When phalcon.register_psr3_classes php.ini option is set, Phalcon\Logger\Adapter and derived classes throw Psr\Log\InvalidArgumentException instead of Phalcon\Logger\Exception when the arguments are not valid (#1888)
    • Phalcon\Mvc:
      • Added support for route names in Phalcon\Mvc\Micro\Collection (#1868)
      • Phalcon\Mvc\Application::handle() now checks whether the class exists before include()'ing its file (#812, #818)
      • Phalcon\Mvc\Model\Criteria::fromInput() now sets _modelName (#866, #873)
      • Phalcon\Mvc\Model\Query\Builder may now use both integer and string placeholders (#701)
      • Mvc\Model\getMessages() is filterable now (#885)
      • Fixed hasManyToMany relation implementation (#938)
      • Fixed regular expression in \Phalcon\Mvc\Model\Validator\Email (#1243)
      • Phalcon\Mvc\Model::hasOne/hasMany/belongsTo/hasManyToMany/addBehavior() are now public methods (#1166)
      • Added Phalcon\Mvc\Model\Row::toArray() method (#1506)
      • Phalcon\Mvc\Model\Validator::getOption() returns NULL if the option does not exist (#1530)
      • Bug with a custom Events Manager in Phalcon\Mvc\Models (#1314)
      • Phalcon\Mvc\Model\Query\Builder::__construct() does not ignore joins anymore (#1327)
      • Fixed HAVING handling in Phalcon\Mvc\Model\Query\Builder (#1396)
      • Micro Collections return Phalcon\Mvc\Micro\CollectionInterface (#1130)
      • Phalcon\Mvc\Url::get() can append query params (#723, #877)
      • Regular Expression Optimization for Phalcon\Mvc\Router (#977)
      • PHQL: added placeholders support to LIMIT (#1023)
      • Added Phalcon\Mvc\Router::getDefautXXX() methods (#1087)
      • Allow HAVING without GROUP BY in query builder (#1115)
      • mvc/model/query.c optimizations (#1129, #1132)
      • Added support for array(limit, offset) as a 'limit' constructor key in Query Builder (#1208)
      • Added support for 'conditions' in Phalcon\Mvc\Model\Query\Builder::__construct() (#1236)
      • Added Phalcon\Mvc\View::isDisabled(), Phalcon\Mvc\View::getRenderLevel(), Phalcon\Mvc\View::getDisabledLevels() (#907, #1320)
      • Added Phalcon\Mvc\View::getCurrentRenderLevel() (#907, #1326)
      • Bug fix in Phalcon\Mvc\Model\Resultset\Simple::toArray() (#1377)
      • Bug fixes in Volt compiler (#1387)
      • Volt compiler optimizations (#1729)
      • Phalcon\Mvc\Model\Query\Builder optimizations (#1414)
      • Allow to set dirs without trailing slashes in Phalcon\Mvc\View (#406, #1440)
      • Phalcon\Mvc\Model\Validator::getOption() returns null if option does not exists (#1531)
      • Added Phalcon\Mvc\Model::selectWriteConnection() (#1519)
      • Added Phalcon\Mvc\Router\Group::convert()/getConverters() (#1555, #1572)
      • Added Phalcon\Mvc\Router\Route::getGroup() (#1682)
      • Added Phalcon\Mvc\Router\Group::getName() and setName() (#1682)
      • Faster Phalcon\Mvc\Model\Row (#1606)
      • Optimized Phalcon\Mvc\Router\Group (#1682)
      • Bug fix: no arguments were passed to beforeMatch handler in Phalcon\Mvc\Router (#1556)
      • Added diagnostics when a validator returns false but does not call appendMessage() (#1664)
      • Fixed handling of numeric namespaces/modules/controllers/actions (#1688)
      • Added Phalcon\Mvc\View::exists() and Phalcon\Mvc\View(\Simple)::getRegisteredEngines() (#1707)
      • Volt: fixed bug in email_filed() (#1723)
      • Fixed deprecation warnings in Phalcon\Mvc\Collection::save() and Phalcon\Mvc\Collection::delete() (#1783)
      • Phalcon\Mvc\Model\Behavior now implements Phalcon\Mvc\Model\BehaviorInterface (#1852)
      • Phalcon\Mvc\Model\Metadata now implements Phalcon\Mvc\Model\MetadataInterface (#1852)
      • Phalcon\Mvc\Model\Validator now implements Phalcon\Mvc\Model\ValidatorInterface (#1852)
      • Phalcon\Mvc\View\Engine now implements Phalcon\Mvc\View\EngineInterface (#1852)
      • Phalcon\Mvc\Model\Validator::getOption()/getOptions()/isSetOption() methods are now public (#1904)
      • Phalcon\Mvc\Model::findFirst() now works when phqlLiterals is false (#886)
      • Fixed notices when phalcon.orm.column_renaming is 0 (#1801)
      • Implemented reset() for metadata adapters other than memory (#1934)
      • Relaxed the requirement for the route to start with a slash (#1938)
      • Phalcon\Mvc\Router\Group: merge slashes when the route prefix ends and the route pattern starts with a slash (#1938)
      • Phalcon\Mvc\Model\Criteria::fromInput() now works with column maps (#1903)
    • Phalcon\Paginator:
      • Phalcon\Paginator\Adapter\Model returns correct results even when page number is incorrect (#1654)
      • Optimized Phalcon\Paginator\Adapter\QueryBuilder (#1632)
      • setCurrentPage() returns $this for all adapters (#1633)
      • Optimized Phalcon\Paginator\Adapter\NativeArray (#1653)
    • Phalcon\Queue:
      • Fixed bug in Phalcon\Queue\Beanstalk::read() (#1348, #1612)
      • Bug fixes in beanstalkd protocol implementation (#1650)
      • Optimizations (#1621)
      • Added peekDelayed() and peekburied() to Phalcon\Queue\Beanstalk (#1650)
      • Added kick(), bury(), release(), touch() to Phalcon\Queue\Beanstalk\Job (#1650)
    • Phalcon\Registry (#1209, #1935)
    • Phalcon\Security:
      • Phalcon\Security\Exception inherits from Phalcon\Exception, not from \Phalcon\DI\Exception
      • Added Phalcon\Security::computeHmac() (#1347)
      • Bug fixes (#1347)
      • Constant-time string comparison in Phalcon\Security::checkHash() to prevent timing attacks (#1755)
      • Phalcon\Security::checkHash() now correctly handles non-bcrypt hashes (#1912)
      • Support all hashes supported by crypt() in Phalcon\Security::hash() (#1971)
      • Phalcon\Security::getSaltBytes() dies not require OpenSSL anymore (#1971)
    • Phalcon\Session:
      • Fix Phalcon\Session\Bag::remove() (#1637)
      • Add remove() to Phalcon\Session\BagInterface (#1917)
      • Phalcon\Session\Adapter::get() may optionally remove the data from session (#1358)
      • Phalcon\Session\Adapter optimizations (#1624)
      • Phalcon\Session\Adapter::__destruct() now calls session_write_close() (#1624)
      • Phalcon\Session\AdapterInterface is compatible with SessionHandlerInterface (#1108)
      • Phalcon\Session\Adapter now implements Phalcon\Session\AdapterInterface (#1852)
      • Phalcon\Session\Bag::__get() now returns by reference (unlike get()) (#1895)
      • Phalcon\Session\Bag implements ArrayAccess, Countable, IteratorAggregate interfaces (#1917)
      • Phalcon\Session\Adapter implements ArrayAccess, Countable, IteratorAggregate interfaces (#1917)
      • Optimized Phalcon\Session\Adapter using object handlers (#1917)
    • Phalcon\Tag:
      • Fixed bugs (#903)
      • Fixed radio button generation (#947)
      • Fixed inconsistent behavior of setAutoescape() (#1263)
      • Added missing HTML5 input types (#824, #1323)
      • Added Phalcon\Tag::setTitleSeparator() (#1365)
      • Added support for (#1422)
      • Fixed inconsistency in Tag::stylesheetLink/javascriptInclude w.r.t. local URLs (#1486)
    • Phalcon\Translate:
      • Optimized Phalcon\Translate\Adapter, Phalcon\Translate\Adapter\NativeArray by using object handlers (#1668)
      • Phalcon\Translate\Adapter\NativeArray::query() now replaces placeholders even if the string is not found in the language content (#2044)
    • Phalcon\Validation:
      • Added support for error codes (#1171)
      • Bug fixes (#1399)
      • Optimized Phalcon\Validation\Message\Group by using native iterators (#1657)
      • Optimized Phalcon\Validation\Message\Group by using object handlers (#1765)
      • Phalcon\Validation\Validator now implements Phalcon\Validation\ValidatorInterface (#1852)
    • Psr\Log:
      • when phalcon.register_psr3_classes php.ini option is set, Psr\Log\LoggerAwareInterface, Psr\Log\LoggerInterface, Psr\Log\AbstractLogger, Psr\Log\InvalidArgumentException, Psr\Log\LogLevel, Psr\Log\NullLogger, Psr\Log\LoggerAwareTrait (PHP 5.4+), Psr\Log\LoggerTrait (PHP 5.4+) are registered as internal interfaces/classes/traits by Phalcon (#1888)
    • Unit tests:
    • Documentation bug fixes (#1069, #1070, #1072, #1145, #1146, #1205, #1372, #1397, #1521, #1523, #1586, lots of them)
    • Refactored, improved and optimized build script (#1218)
    • Other bug fixes (#1051, #1131, #1040, #1275, #1392, #1396, #1399, #1425, #1426...)