How to call the constructor with call

How could I call the constructor of a class with call_user_func_array It is not possible to do : $obj = new $class(); call_user_func_array(array($obj, '__construct'), $args); because if the constructor has parameters, the new will fail. Constraint : I do not control the classes that I have to instantiate, nor can I modify them. Don't ask me why I want to do this crazy thing, this is

如何通过调用调用构造函数

我怎么能用call_user_func_array调用一个类的构造函数 这是不可能的: $obj = new $class(); call_user_func_array(array($obj, '__construct'), $args); 因为如果构造函数有参数,新的将失败。 约束:我不控制必须实例化的类,也不能修改它们。 不要问我为什么要做这个疯狂的事情,这是一个疯狂的考验。 你可以使用反射像: $reflect = new ReflectionClass($class); $instance = $reflect->newInstanceArgs($ar

SEO and ajax loaded content link

I need some help to better understand SEO with ajax loaded content. Here the context: I have a single.php where content is dynamically generated (with php and an xml database) for each single post. I load a container of this single.php inside my index.php page via ajax. Here the working script: $.ajaxSetup({cache:false}); $(".phplink").click(function(){ var post_link = $(this)

SEO和ajax加载的内容链接

我需要一些帮助,以更好地理解阿贾克斯加载内容的SEO。 这里的背景: 我有一个single.php,其中内容是动态生成(与PHP和XML数据库)为每个单一职位。 我通过ajax在我的index.php页面中加载了这个single.php的容器。 这里的工作脚本: $.ajaxSetup({cache:false}); $(".phplink").click(function(){ var post_link = $(this).attr("href"); window.location.hash = "!"+ post_link ; $("#ajax

Optimizing my mysql query

I clearly know that there are plenty of questions already asked on this topic but i couldn't optimize mine. So below is my query: select tc.id, tc.name tc, s.name state, d.name district, count(distinct case when curdate() between b.starttime and b.endtime then b.id end) as active, (case when count(distinct case when curdate() between b.starttime and b.endtime then b.id end) >

优化我的mysql查询

我清楚地知道,在这个话题上已经提出了很多问题,但我不能优化我的。 所以下面是我的查询: select tc.id, tc.name tc, s.name state, d.name district, count(distinct case when curdate() between b.starttime and b.endtime then b.id end) as active, (case when count(distinct case when curdate() between b.starttime and b.endtime then b.id end) > 0 then 'active' when tc.status = 'Archived-I' th

WordPress Website is generating random Advertisements in new tab

I am facing a problem with my website https://konhost.com, whenever I open my website in a new tab or new window and click on it for the first time then it opens a new window with an advertisement. I have also scaned my website with virustotal.com and this comes out: accept-ranges: bytes age: 0 cache-control: no-store, no-cache, must-revalidate connection: keep-alive content-type: tex

WordPress网站正在新标签中生成随机广告

我在我的网站https://konhost.com上遇到了问题,每当我在新标签或新窗口中打开我的网站并首次点击它时,它会打开一个带有广告的新窗口。 我也用virustotal.com扫描了我的网站,结果如下: 接受范围:字节 年龄:0 缓存控制:无存储,无缓存,必须重新验证 连接:保持活跃 content-type:text / html; 字符集= UTF-8 日期:2017年九月8日星期五19:25:49 GMT 到期日:星期四,1981年11月19日08:52:00 GMT 杂注

Magento does not set cookie on product/category page

So here is the issue, Magento doesn't seem to set-cookie on product/category page. It doesn't show any cart items or customer login information on product page, however all the items appear fine on home page and rest of the pages on site. I checked headers for two of the pages. Here is the product page: HTTP/1.1 200 OK Server: nginx/1.8.1 Date: Tue, 15 Mar 2016 05:01:57 GMT

Magento不会在产品/类别页面上设置Cookie

所以这里是问题,Magento似乎没有在产品/类别页面上设置cookie。 它不会在产品页面上显示任何购物车项目或客户登录信息,但是所有项目在主页上以及现场的其他页面上都显示得很好。 我检查了其中两页的标题。 这里是产品页面: HTTP / 1.1 200 OK 服务器:nginx / 1.8.1 日期:2016年3月15日星期二05:01:57 GMT 内容类型:text / html; 字符集= UTF-8 连接:保持活跃 到期时间:星期四,1981年11月19日08:52:0

Fishpig auto login not working in Magento 1.9

I have used fishpig extension in magento 1.9 and I am facing auto login error message in magento: WordPress Auto Login Failed: HTTP/1.1 200 OK Server: nginx/1.0.15 Date: Tue, 08 Dec 2015 20:20:02 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive X-Powered-By: PHP/5.4.25 Expires: Wed, 11 Jan 1984 05:00:00 GMT Cache-Control: no-cache, must-revalidate, max-age=0 Pragma: no-cache S

Fishpig自动登录不能在Magento 1.9中使用

我在magento 1.9中使用了fishpig扩展,我在magento中遇到了自动登录错误消息: WordPress自动登录失败:HTTP / 1.1 200 OK服务器:nginx / 1.0.15日期:2015年12月08日星期二20:20:02 GMT内容类型:text / html; charset = UTF-8连接:keep-alive X-Powered-By:PHP / 5.4.25 Expires:Wed,11 Jan 1984 05:00:00 GMT Cache-Control:no-cache,must-revalidate,max-age = 0 Pragma:no-cache Set-Cookie:wordpress_test_co

Magento Frontend Cookie is being duplicated

When viewing the cookies on my Magento 1.7 site homepage the "frontend" cookie is shown twice. Examples of the cookies being produced frontend=stpvj4gep5c2h9qu4mhcdlru40; expires=Wed, 04 Feb 2015 02:21:23 GMT; path=/; domain=.example.com.au; HttpOnly frontend=stpvj4gep5c2h9qu4mhcdlru40; path=/; domain=example.com.au How do you make it so that only one cookie is being produced?

Magento前端Cookie正在被复制

当在我的Magento 1.7网站主页上查看Cookie时,“前端”cookie会显示两次。 正在生产的Cookie的示例 frontend=stpvj4gep5c2h9qu4mhcdlru40; expires=Wed, 04 Feb 2015 02:21:23 GMT; path=/; domain=.example.com.au; HttpOnly frontend=stpvj4gep5c2h9qu4mhcdlru40; path=/; domain=example.com.au 你如何做到这一点,只有一个曲奇正在制作? 您需要在管理面板中设置Cookie域。 您可以在系统 - >配置 - >常规/ Web

Facebook iframe like button not working

my facebook iframe like button is working offline but not online on the server..this is the code used: <iframe src="http://www.facebook.com/plugins/like.php?app_id=125925834166578&amp;href=http%3A%2F%2Fwww.facebook.com%2FBaradei.Presidency&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&

Facebook的iframe像按钮不工作

我的Facebook的iframe像按钮离线工作,但不在服务器上。这是使用的代码: <iframe src="http://www.facebook.com/plugins/like.php?app_id=125925834166578&amp;href=http%3A%2F%2Fwww.facebook.com%2FBaradei.Presidency&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" fra

PHP memcache connect

I have a page where few thousands of users can hit a method at the same time . I do have following code where I connect every time . Since this will go to a seperate memcache server will this cause slowdowns is there a way to connect just once and reuse that connection ? Do I have to close connection after every request ? $primary_connected = $memcache_primary->connect($primary_memcache_se

PHP memcache连接

我有一个页面,有几千个用户可以同时访问一个方法。 我每次都连接下面的代码。 由于这将转到单独的memcache服务器,这会导致速度变慢,有没有办法连接一次并重新使用该连接? 每次请求后都必须关闭连接吗? $primary_connected = $memcache_primary->connect($primary_memcache_server, 11211); if($primary_connected){ $data = $memcache_primary->get($key); if ($data != NULL) { retu

Close Apache connection with too large file uploads

I am currently working on a website where users can upload files. How can I prevent large files to be uploaded? At the time, no option (PHP's post_max_size and upload_max_filesize ) has been useful: the file is uploaded entirely. I would simply like the connection to be closed with too large files (by checking Content-Length HTTP header beforehand, and by checking while the file is being u

关闭超大文件上传的Apache连接

我目前正在一个用户可以上传文件的网站上工作。 我怎样才能防止大文件上传? 当时,没有选项(PHP的post_max_size和upload_max_filesize )非常有用:文件完全上传。 我只是想通过过大的文件关闭连接(通过预先检查Content-Length HTTP标头,并在文件上传时检查)。 有没有Apache指令或PHP配置密钥? 感谢您的时间! 编辑:添加Apache conf(CentOS默认)。 EDIT2:增加了PHP conf(CentOS默认)。 编辑3:看起来,P