亚洲必赢766net:filter扩展模块,arcmap中查找扩展

作者:计算机知识

 

private void ExtensionList(IApplication application)
{
    List < string > loadedExtensions = new List < string > ();
    List < string > unloadedExtensions = new List < string > ();

    //All extensions returned by extension manager have been loaded at startup.
    IExtensionManager regularExtManager = application as IExtensionManager;
    for (int i = 0; i < regularExtManager.ExtensionCount; i  )
    {
        IExtension ext = regularExtManager.get_Extension(i);
        loadedExtensions.Add(ext.Name);
    }

    //Use IsLoaded to test if a JIT extension has already been loaded by request.
    IJITExtensionManager jitExtManager = application as IJITExtensionManager;
    for (int i = 0; i < jitExtManager.JITExtensionCount; i  )
    {
        UID extID = jitExtManager.get_JITExtensionCLSID(i);
        if (jitExtManager.IsLoaded(extID))
        {
            IExtension ext = application.FindExtensionByCLSID(extID);
            loadedExtensions.Add(ext.Name);
        }
        else
        //Just show the extension ID.
        {
            unloadedExtensions.Add(extID.Value.ToString());
        }
    }

    //Print extension information.
    Console.WriteLine("Extensions loaded in Application:");
    foreach (string ext in loadedExtensions)
        Console.WriteLine("t"   ext);
    Console.WriteLine("CLSID of extensions haven't been loaded yet:");
    foreach (string extID in unloadedExtensions)
        Console.WriteLine("t"   extID);
}
在我们写扩展时,就像YAF不会是用一个类文件来完成一个扩展功能,所以我们要在一个扩展模块里
调起几个类的实例,同类之间的方法,可以相互调用,不同类之间的实例,应该也可以调用,下面我
们就用一个例子来说明。
首先我们先创建play扩展模块,再创建adf扩展模块,最后创建udf扩展模块,
我们要做到的是php -m中显示加载了play,我们可以调用adf类和udf类。

第一步:
    在adf和udf类中各实现set get方法,然后初始化minit中的内容
    运行成功后,将adf.c php_adf.h和udf.c php_udf.h拷入play文件中

第二步
修改play文件夹中的config.m4:
if test -z "$PHP_DEBUG" ; then 
  PHP_NEW_EXTENSION(play, play.c udf.c adf.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)

在play.c的MINIT函数中加上
    ZEND_MODULE_STARTUP_N(udf) (INIT_FUNC_ARGS_PASSTHRU);
    ZEND_MODULE_STARTUP_N(adf) (INIT_FUNC_ARGS_PASSTHRU);

第三步执行
phpize 
./configure --with-php-config=/usr/bin/php-config --enable-debug
make && make install


adf.c 


zend_class_entry *adf_ce;


//新增定义
ZEND_BEGIN_ARG_INFO_EX(global_setkey_arg, 0, 0, 2)
    ZEND_ARG_INFO(0, key1)
    ZEND_ARG_INFO(0, key2)
ZEND_END_ARG_INFO()

ZEND_METHOD(adf,__construct){

    RETURN_NULL();
}

ZEND_METHOD(adf,set){



    zval *param1;
    zval *param2;

    array_init(param2);

    //int zend_parse_parameters ( int num_args TSRMLS_DC, char* type_spec, ... )

    if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|z",&param1,&param2) == FAILURE) {
        RETURN_FALSE;
    }

    zend_update_property(adf_ce, getThis(), "param1", sizeof("param1")-1, param1 TSRMLS_CC);
    zend_update_property(adf_ce, getThis(), "param2", sizeof("param2")-1, param2 TSRMLS_CC);

    RETURN_NULL();
}


ZEND_METHOD(adf,get){

    array_init(return_value);

    zval  *get1;
    zval  *get2;

    zval  param1; //php >=7.0
    zval  param2; //php >=7.0

    get1 = zend_read_property(adf_ce, getThis(), "param1", sizeof("param1")-1, 0, &param1 TSRMLS_DC);
    get2 = zend_read_property(adf_ce, getThis(), "param2", sizeof("param2")-1, 0, &param2 TSRMLS_DC);


    add_next_index_string(return_value,Z_STRVAL_P(get1));
    add_next_index_string(return_value,Z_STRVAL_P(get2));
    //add_assoc_string(return_value, "param1", ZEND_STRL("test1"));
    //add_assoc_string(return_value, "param2", ZEND_STRL("test2"));

    RETURN_ZVAL(return_value, 1, 0);

}



const zend_function_entry adf_functions[] = {

    PHP_ME(adf, __construct,NULL,ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
    PHP_ME(adf,set,global_setkey_arg,ZEND_ACC_PUBLIC)
    PHP_ME(adf,get,NULL,ZEND_ACC_PUBLIC)
    PHP_ME(adf,calladf,NULL,ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)

    PHP_FE_END  /* Must be the last line in adf_functions[] */
};


PHP_MINIT_FUNCTION(adf)
{
    /* If you have INI entries, uncomment these lines
    REGISTER_INI_ENTRIES();
    */

        zend_class_entry ce;
        INIT_CLASS_ENTRY(ce, "adf", adf_functions);
    adf_ce = zend_register_internal_class(&ce TSRMLS_CC);

    return SUCCESS;
}



play.c中代码:

PHP_MINIT_FUNCTION(play)
{
    /* If you have INI entries, uncomment these lines
    REGISTER_INI_ENTRIES();
    */

    ZEND_MODULE_STARTUP_N(udf) (INIT_FUNC_ARGS_PASSTHRU);
    ZEND_MODULE_STARTUP_N(adf) (INIT_FUNC_ARGS_PASSTHRU);
    return SUCCESS;
}

Ubuntu下启用FrameBuffer模块

 

 

  • 亚洲必赢766net:filter扩展模块,arcmap中查找扩展模块和调用扩展模块。请尊重本人劳动成功,能够专擅转发但保留以下音讯
  • 我:岁月经年
  • 时间:2016年03月
  • 首发:

壹. 编纂 /etc/initramfs-tools/modules,在当中加入:
fbcon
vesafb
vga16fb

  • 跻身lnmp目录张开lnmp.conf配置文件

调用

  1. 编排 /etc/modprobe.d/blacklist-framebuffer,注释掉以下两行:
    blacklist vesafb
    blacklist vga16fb

  2. 修改/boot/grub/ 内的menu.lst ,找到类似如下几行代码,在kernel一行结尾加入fb分辨率参数:
    例如:
    title        Ubuntu 8.10, kernel 2.6.27-9-generic
    uuid        328eed5f-0f89-41b8-b021-730ae3f167d1
    kernel        /boot/vmlinuz-2.6.27-9-generic root=UUID=328eed5f-0f89-41b8-b021-730ae3f167d1 ro quiet splash vga=0x314
    initrd        /boot/initrd.img-2.6.27-9-generic
    quiet

本文由bwin必赢发布,转载请注明来源

关键词: 亚洲必赢252 arcgis php7扩展开发