Changeset 26365


Ignore:
Timestamp:
06/14/10 19:58:10 (7 years ago)
Author:
piotras
Message:

Added methods:

enable_dbus
enable_replication
enable_quota
is_enabled_dbus
is_enabled_replication
is_enabled_quota

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ragnaroek/midgard/apis/php5/php_midgard_connection.c

    r25338 r26365  
    570570        ZEND_ARG_INFO(0, callback)
    571571        ZEND_ARG_INFO(0, userdata)
     572ZEND_END_ARG_INFO()
     573
     574static PHP_METHOD(midgard_connection, enable_dbus)
     575{
     576        CHECK_MGD;
     577        zend_bool toggle;
     578
     579        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &toggle) == FAILURE)
     580                return;
     581
     582        MidgardConnection *mgd =__midgard_connection_get_ptr();
     583
     584        midgard_connection_enable_dbus (mgd, toggle);
     585        return;
     586}
     587
     588ZEND_BEGIN_ARG_INFO_EX(arginfo_midgard_connection_enable_dbus, 0, 0, 1)
     589        ZEND_ARG_INFO(0, toggle)
     590ZEND_END_ARG_INFO()
     591
     592static PHP_METHOD(midgard_connection, enable_replication)
     593{
     594        CHECK_MGD;
     595        zend_bool toggle;
     596
     597        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &toggle) == FAILURE)
     598                return;
     599
     600        MidgardConnection *mgd =__midgard_connection_get_ptr();
     601
     602        midgard_connection_enable_replication (mgd, toggle);
     603        return;
     604}
     605
     606ZEND_BEGIN_ARG_INFO_EX(arginfo_midgard_connection_enable_replication, 0, 0, 1)
     607        ZEND_ARG_INFO(0, toggle)
     608ZEND_END_ARG_INFO()
     609
     610static PHP_METHOD(midgard_connection, enable_quota)
     611{
     612        CHECK_MGD;
     613        zend_bool toggle;
     614
     615        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &toggle) == FAILURE)
     616                return;
     617
     618        MidgardConnection *mgd =__midgard_connection_get_ptr();
     619
     620        midgard_connection_enable_quota (mgd, toggle);
     621        return;
     622}
     623
     624ZEND_BEGIN_ARG_INFO_EX(arginfo_midgard_connection_enable_quota, 0, 0, 1)
     625        ZEND_ARG_INFO(0, toggle)
     626ZEND_END_ARG_INFO()
     627
     628static PHP_METHOD(midgard_connection, is_enabled_dbus)
     629{
     630        CHECK_MGD;
     631
     632        if (zend_parse_parameters_none() == FAILURE)
     633                return;
     634
     635        MidgardConnection *mgd =__midgard_connection_get_ptr();
     636        if (midgard_connection_is_enabled_dbus (mgd))
     637                RETURN_TRUE;
     638
     639        RETURN_FALSE;
     640}
     641
     642ZEND_BEGIN_ARG_INFO(arginfo_midgard_connection_is_enabled_dbus, 0)
     643ZEND_END_ARG_INFO()
     644
     645static PHP_METHOD(midgard_connection, is_enabled_replication)
     646{
     647        CHECK_MGD;
     648
     649        if (zend_parse_parameters_none() == FAILURE)
     650                return;
     651
     652        MidgardConnection *mgd =__midgard_connection_get_ptr();
     653        if (midgard_connection_is_enabled_replication (mgd))
     654                RETURN_TRUE;
     655
     656        RETURN_FALSE;
     657}
     658
     659ZEND_BEGIN_ARG_INFO(arginfo_midgard_connection_is_enabled_replication, 0)
     660ZEND_END_ARG_INFO()
     661
     662static PHP_METHOD(midgard_connection, is_enabled_quota)
     663{
     664        CHECK_MGD;
     665
     666        if (zend_parse_parameters_none() == FAILURE)
     667                return;
     668
     669        MidgardConnection *mgd =__midgard_connection_get_ptr();
     670        if (midgard_connection_is_enabled_quota (mgd))
     671                RETURN_TRUE;
     672
     673        RETURN_FALSE;
     674}
     675
     676ZEND_BEGIN_ARG_INFO(arginfo_midgard_connection_is_enabled_quota, 0)
    572677ZEND_END_ARG_INFO()
    573678
     
    620725                PHP_ME(midgard_connection,      set_loglevel,
    621726                                arginfo_midgard_connection_set_loglevel,        ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
     727                PHP_ME(midgard_connection,      enable_dbus,
     728                                arginfo_midgard_connection_enable_dbus,         ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
     729                PHP_ME(midgard_connection,      enable_replication,
     730                                arginfo_midgard_connection_enable_replication,  ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
     731                PHP_ME(midgard_connection,      enable_quota,
     732                                arginfo_midgard_connection_enable_quota,        ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
     733                PHP_ME(midgard_connection,      is_enabled_dbus,
     734                                arginfo_midgard_connection_is_enabled_dbus,     ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
     735                PHP_ME(midgard_connection,      is_enabled_replication,
     736                                arginfo_midgard_connection_is_enabled_replication, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
     737                PHP_ME(midgard_connection,      is_enabled_quota,
     738                                arginfo_midgard_connection_is_enabled_quota,    ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
    622739                {NULL, NULL, NULL}
    623740        };
Note: See TracChangeset for help on using the changeset viewer.