English 中文(简体)
如何测试是否安装了真菌?
原标题:Opencart how to test if vqmod installed?

我撰写了一个单元,用于开放式艺术。 如果从行政单元内安装真菌,我如何检查?

我愿在单元内发出警告,如果安装了真象检查? 更糟糕的是,如果它有正确的书面许可,可以生成有卡的档案,并写给死者。 记录

这样做的最佳方式是什么?

PS:如果你能够用真菌表示问题,就会冷静。 我有足够的声誉来创造新的标签。

最佳回答
<?php
    if(class_exists( VQMod )) {
         // vqmod exists
    }
?>
问题回答
/vqmod/install

如果安装,将告诉你“已经安装了真菌”。

为了通过守则进行核查,你需要这样做。

global $vqmod;
if(!empty($vqmod) && is_a($vqmod,  VQMod )) {
    // INSTALLED
} else {
    //
}

While @NADH s is along the right lines, it only checks that vqmod s class has been included, not that it s been set to the $vqmod variable

Edit

截至2.4.0,这不再奏效,并建议使用亚非人权联盟的方法。

根据您的意见 @John,因为你重新寻找VQmod的装置也正确执行,因此,最安全的事情是检查你预期出现在vqmod/cache目录中的档案名称。 如果你建立了真菌/xml定义档案,你就知道档案名称。

You could also check for the VQMod class existing like @NADH suggested, but it doesn t mean that its working correctly. A bit like writing unit tests, always assert on the desired output. In this case its the cache file you are creating.





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签