Skip to content

Commit

Permalink
Merge pull request #1795 from sjinks/issue-1108
Browse files Browse the repository at this point in the history
Make Phalcon\Session\AdapterInterface compatible with SessionHandlerInterface
  • Loading branch information
Phalcon committed Jan 13, 2014
2 parents d46117f + f04064e commit a659ac7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
- 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\Tag:
- Fixed bugs (#903)
- Fixed radio button generation (#947)
Expand Down
2 changes: 1 addition & 1 deletion ext/session/adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static const zend_function_entry phalcon_session_adapter_method_entry[] = {
PHP_ME(Phalcon_Session_Adapter, remove, arginfo_phalcon_session_adapterinterface_remove, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Session_Adapter, getId, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Session_Adapter, isStarted, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Session_Adapter, destroy, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Session_Adapter, destroy, arginfo_phalcon_session_adapterinterface_destroy, ZEND_ACC_PUBLIC)
PHP_FE_END
};

Expand Down
2 changes: 1 addition & 1 deletion ext/session/adapterinterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static const zend_function_entry phalcon_session_adapterinterface_method_entry[]
PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, remove, arginfo_phalcon_session_adapterinterface_remove)
PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, getId, NULL)
PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, isStarted, NULL)
PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, destroy, NULL)
PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, destroy, arginfo_phalcon_session_adapterinterface_destroy)
PHP_FE_END
};

Expand Down
4 changes: 4 additions & 0 deletions ext/session/adapterinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapterinterface_setoptions, 0, 0
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapterinterface_destroy, 0, 0, 0)
ZEND_ARG_INFO(0, session_id)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapterinterface_get, 0, 0, 1)
ZEND_ARG_INFO(0, index)
ZEND_ARG_INFO(0, defaultValue)
Expand Down
12 changes: 12 additions & 0 deletions ext/tests/issue-1108.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--TEST--
Phalcon\Session\AdapterInterface should be compatible with SessionHandlerInterface - https://github.com/phalcon/cphalcon/issues/1108
--SKIPIF--
<?php include('skipif.inc'); ?>
<?php if (PHP_VERSION_ID < 50400) die('skip SessionHandlerInterface is available on PHP 5.4+'); ?>
--FILE--
<?php
abstract class X extends Phalcon\Session\Adapter implements \SessionHandlerInterface
{
}
?>
--EXPECT--

0 comments on commit a659ac7

Please sign in to comment.