我在 /app/Console/Command 中编写了一个名为 SyncVeevaShell.php 的 Shell 文件(它基本上是一些控制器函数的复制/粘贴),它应该每 10 分钟通过一次 cronjob 运行一次,但它不起作用。当我尝试通过命令“sh cake SyncVeevaShell.php”手动运行 shell 时,我收到一条错误消息,提示找不到插件 SyncVeevaShell。我不明白为什么它会提到一个插件,因为我不想使用它。
同步VeevaShell.php:
<?php
App::uses('AppShell', 'Console/Command');
class SyncVeevaShell extends AppShell {
public $uses = array('Asset', 'VeevaVault');
public function main()
{
$this->autoRender = false;
App::import('Model', 'Segment');
$Segment = new Segment();
App::import('Vendor', 'phpVeeva', array('file' => 'veeva' . DS . 'veeva.php'));
$veeva = new phpVeeva();
$veevaList = $veeva->getDocList();
$this->remove_veeva_asset($veevaList);
$i = 0;
while ($i < count($veevaList))
{
$obj = $veevaList[$i];
$filename = $obj->{$veeva::LIST_VALUES}[8];
$major_ver = $obj->{$veeva::LIST_VALUES}[6];
$minor_ver = $obj->{$veeva::LIST_VALUES}[7]; …Run Code Online (Sandbox Code Playgroud)