Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactoring

  • Loading branch information...
commit c55a28344594540eb8e626a789845fac2d39df2b 1 parent e4adc95
@nicolasff nicolasff authored
Showing with 31 additions and 3 deletions.
  1. +7 −2 mkdeb-apache2.sh
  2. +21 −1 php_redis.h
  3. +3 −0  redis.c
View
9 mkdeb-apache2.sh
@@ -12,12 +12,17 @@ mkdir -p debian/$DIR
cp debian.control debian/DEBIAN/control
+UBUNTU=`uname -v | grep -ci ubuntu`
mkdir -p debian/etc/php5/apache2/conf.d/
-mkdir -p debian/etc/php5/cli/conf.d/
+if [ $UBUNTU = "0" ]; then
+ mkdir -p debian/etc/php5/cli/conf.d/
+fi
echo "extension=redis.so" >> debian/etc/php5/apache2/conf.d/redis.ini
-cp debian/etc/php5/apache2/conf.d/redis.ini debian/etc/php5/cli/conf.d/redis.ini
+if [ $UBUNTU = "0" ]; then
+ cp debian/etc/php5/apache2/conf.d/redis.ini debian/etc/php5/cli/conf.d/redis.ini
+fi
cp modules/redis.so debian/$DIR
dpkg -b debian phpredis-`uname -m`.deb
View
22 php_redis.h
@@ -167,7 +167,27 @@ PHPAPI void set_pipeline_current(zval *object, request_item *current);
ZEND_BEGIN_MODULE_GLOBALS(redis)
ZEND_END_MODULE_GLOBALS(redis)
-#define PHP_REDIS_VERSION "0.1"
+typedef enum {ATOMIC, MULTI, PIPELINE} redis_mode;
+
+struct redis_queued_item {
+
+ /* reading function */
+ zval * (*fun)(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, ...);
+
+ char *cmd;
+ int cmd_len;
+
+ struct redis_queued_item *next;
+};
+
+struct redis {
+ int fd;
+ redis_mode mode;
+ struct redis_queued_item *head;
+};
+
+
+#define PHP_REDIS_VERSION "2.0"
#endif
View
3  redis.c
@@ -437,6 +437,9 @@ PHP_METHOD(Redis, connect)
id = zend_list_insert(redis_sock, le_redis_sock);
add_property_resource(object, "socket", id);
+ int fd = socket(AF_INET, SOCK_STREAM, 0);
+ printf("fd=%d\n", fd);
+
RETURN_TRUE;
}
/* }}} */
Please sign in to comment.
Something went wrong with that request. Please try again.