Skip to content
Browse files

Merge pull request #66 from piotras/ratatoskr

Added MidgardRepligard class for easier database updates. Closes gh-118
  • Loading branch information...
2 parents 030cb05 + 72fcc02 commit 48a0c95592763006352bd28772b56930031dc01a @piotras piotras committed Nov 2, 2011
Showing with 42 additions and 1 deletion.
  1. +1 −1 config.m4
  2. +1 −0 midgard.c
  3. +1 −0 php_midgard.h
  4. +39 −0 php_midgard_repligard.c
View
2 config.m4
@@ -56,7 +56,7 @@ if test "$PHP_MIDGARD2" != "no"; then
php_midgard_urlwrapper.c php_midgard_query.c php_midgard_query_storage.c php_midgard_query_holders.c \
php_midgard_query_constraints.c php_midgard_reflector_object.c php_midgard_reflector_property.c \
php_midgard_query_executors.c php_midgard_g_mainloop.c php_midgard_workspace_storage.c php_midgard_base_interface.c \
- , $ext_shared)
+ php_midgard_repligard.c, $ext_shared)
PHP_ADD_EXTENSION_DEP(midgard2, spl)
else
AC_MSG_ERROR(Ooops ! no pkg-config found .... )
View
1 midgard.c
@@ -376,6 +376,7 @@ PHP_MINIT_FUNCTION(midgard2)
PHP_MINIT(midgard2_view)(INIT_FUNC_ARGS_PASSTHRU);
PHP_MINIT(midgard2_reflector_object)(INIT_FUNC_ARGS_PASSTHRU);
PHP_MINIT(midgard2_reflector_property)(INIT_FUNC_ARGS_PASSTHRU);
+ PHP_MINIT(midgard2_repligard)(INIT_FUNC_ARGS_PASSTHRU);
/* Register midgard_metadata class */
static zend_class_entry midgard_metadata_class_entry;
View
1 php_midgard.h
@@ -223,6 +223,7 @@ PHP_MINIT_FUNCTION(midgard2_base_abstract);
PHP_MINIT_FUNCTION(midgard2_base_interface);
PHP_MINIT_FUNCTION(midgard2_reflector_object);
PHP_MINIT_FUNCTION(midgard2_reflector_property);
+PHP_MINIT_FUNCTION(midgard2_repligard);
zend_class_entry *php_midgard_get_baseclass_ptr(zend_class_entry *ce);
zend_class_entry *php_midgard_get_baseclass_ptr_by_name(const char *name TSRMLS_DC);
View
39 php_midgard_repligard.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2009 Piotr Pokora <piotrek.pokora@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "php_midgard.h"
+#include "php_midgard_gobject.h"
+#include "php_midgard_object.h"
+
+#include "php_midgard__helpers.h"
+
+zend_class_entry *php_midgard_repligard_class = NULL;
+
+PHP_MINIT_FUNCTION(midgard2_repligard)
+{
+ /* Register midgard_repligard class */
+ static zend_class_entry php_midgard_repligard_ce;
+ INIT_CLASS_ENTRY(php_midgard_repligard_ce, "MidgardRepligard", NULL);
+
+ php_midgard_repligard_class = zend_register_internal_class_ex(&php_midgard_repligard_ce, php_midgard_dbobject_class, "MidgardDBObject" TSRMLS_CC);
+ php_midgard_repligard_class->ce_flags = ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
+
+ zend_register_class_alias("midgard_repligard", php_midgard_repligard_class);
+
+ return SUCCESS;
+}

0 comments on commit 48a0c95

Please sign in to comment.
Something went wrong with that request. Please try again.