( ! ) Deprecated: Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers. in /var/www/html/wp-includes/functions.php on line 6131
Call Stack
#TimeMemoryFunctionLocation
10.0000484048{main}( ).../index.php:0
20.0005484400require( '/var/www/html/wp-blog-header.php ).../index.php:17
30.24544099696require_once( '/var/www/html/wp-includes/template-loader.php ).../wp-blog-header.php:19
40.25034128688include( '/var/www/html/wp-content/themes/twentyfifteen/single.php ).../template-loader.php:125
50.25034128688get_header( $name = ???, $args = ??? ).../single.php:10
60.25034128904locate_template( $template_names = [0 => 'header.php'], $load = TRUE, $load_once = TRUE, $args = [] ).../general-template.php:48
70.25034129000load_template( $_template_file = '/var/www/html/wp-content/themes/twentyfifteen/header.php', $load_once = TRUE, $args = [] ).../template.php:749
80.25064129544require_once( '/var/www/html/wp-content/themes/twentyfifteen/header.php ).../template.php:814
90.25084136952wp_head( ).../header.php:18
100.25084136952do_action( $hook_name = 'wp_head' ).../general-template.php:3197
110.25084137168WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
120.25084137168WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
130.25094140584wp_enqueue_scripts( '' ).../class-wp-hook.php:341
140.25094140584do_action( $hook_name = 'wp_enqueue_scripts' ).../script-loader.php:2311
150.25094140800WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
160.25094140800WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
170.25114142688twentyfifteen_scripts( '' ).../class-wp-hook.php:341
180.25124144208wp_style_add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../functions.php:440
190.25124144208WP_Styles->add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../functions.wp-styles.php:245
200.25124144208WP_Dependencies->add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../class-wp-styles.php:385
210.25124144208_deprecated_argument( $function_name = 'WP_Dependencies->add_data()', $version = '6.9.0', $message = 'IE conditional comments are ignored by all supported browsers.' ).../class-wp-dependencies.php:317
220.25124150160wp_trigger_error( $function_name = '', $message = 'Function WP_Dependencies->add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:5925
230.25134269696trigger_error( $message = 'Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:6131

( ! ) Deprecated: Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers. in /var/www/html/wp-includes/functions.php on line 6131
Call Stack
#TimeMemoryFunctionLocation
10.0000484048{main}( ).../index.php:0
20.0005484400require( '/var/www/html/wp-blog-header.php ).../index.php:17
30.24544099696require_once( '/var/www/html/wp-includes/template-loader.php ).../wp-blog-header.php:19
40.25034128688include( '/var/www/html/wp-content/themes/twentyfifteen/single.php ).../template-loader.php:125
50.25034128688get_header( $name = ???, $args = ??? ).../single.php:10
60.25034128904locate_template( $template_names = [0 => 'header.php'], $load = TRUE, $load_once = TRUE, $args = [] ).../general-template.php:48
70.25034129000load_template( $_template_file = '/var/www/html/wp-content/themes/twentyfifteen/header.php', $load_once = TRUE, $args = [] ).../template.php:749
80.25064129544require_once( '/var/www/html/wp-content/themes/twentyfifteen/header.php ).../template.php:814
90.25084136952wp_head( ).../header.php:18
100.25084136952do_action( $hook_name = 'wp_head' ).../general-template.php:3197
110.25084137168WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
120.25084137168WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
130.25094140584wp_enqueue_scripts( '' ).../class-wp-hook.php:341
140.25094140584do_action( $hook_name = 'wp_enqueue_scripts' ).../script-loader.php:2311
150.25094140800WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
160.25094140800WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
170.25114142688twentyfifteen_scripts( '' ).../class-wp-hook.php:341
180.27724270800wp_style_add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../functions.php:444
190.27724270800WP_Styles->add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../functions.wp-styles.php:245
200.27734270800WP_Dependencies->add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../class-wp-styles.php:385
210.27734270800_deprecated_argument( $function_name = 'WP_Dependencies->add_data()', $version = '6.9.0', $message = 'IE conditional comments are ignored by all supported browsers.' ).../class-wp-dependencies.php:317
220.27734271120wp_trigger_error( $function_name = '', $message = 'Function WP_Dependencies->add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:5925
230.27744271344trigger_error( $message = 'Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:6131

Google Guice Example

最近在研究Google 的 Guice,感觉用起来挺简单的,入门应该比Spring要容易的多,这也许是因为Guice刚刚出世,很功能还没有完善吧,但据说Google内部已经在用了,我想再过一段时间取Spring而代之也不是没有可能,至少也能跟Spring平分天下吧。

下面是一个简单的小实例

1.业务逻辑接口

package com.hawkunion.guice;

/**

*

* @author 杜庆明

*/

public interface Work {

     public void sayHello(String userName);

}

2.实现接口的业务逻辑

package com.hawkunion.guice;

/**

*

* @author 杜庆明

*/

public class WorkImpl implements Work{

   

     public void sayHello(String userName) {

         System.out.println(“Hello! 欢迎你:”+userName);

     }

   

}

3.要用到业务逻辑的类

package com.hawkunion.guice;

import com.google.inject.Inject;

/**

*

* @author 杜庆明

*/

public class RunWorkClass {

   

     private Work work = null;

   

     @Inject

     public void setWork(Work workimpl){

         this.work = workimpl;

     }

   

     public void runWork(){

         work.sayHello(“阿杜”);

     }   

}

4.Module

package com.hawkunion.guice;

import com.google.inject.Binder;

import com.google.inject.Module;

/**

*

* @author 杜庆明

*/

public class MyModule implements Module {

     public void configure(Binder binder) {

         binder.bind(Work.class).to(WorkImpl.class);

     }

}

5.测试

package com.hawkunion.guice;

import com.google.inject.Guice;

import com.google.inject.Injector;

import com.google.inject.Module;

/**

*

* @author 杜庆明

*/

public class TestWork {

   

     public static void main(String args[]){

         RunWorkClass runWorkClass = new RunWorkClass();

         Module module = new MyModule();

       

         Injector in = Guice.createInjector(module);//把module给Guice

         in.injectMembers(runWorkClass);//让Guice把需要注入的业务逻辑注入给对象

         runWorkClass.runWork();//   运行work

     }

}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.