本文整理汇总了PHP中Ftp::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Ftp::find方法的具体用法?PHP Ftp::find怎么用?PHP Ftp::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ftp
的用法示例。
在下文中一共展示了Ftp::find方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ItemModelId
function ItemModelId($path)
{
/* find pol, sol and the type of item */
list($pol_id, $sol_id, $rest) = sscanf($path, "/opt/xplico/pol_%d/sol_%d/%s");
$type = strtok($rest, '/');
/* set sol id and pol id to avoid error permision in the controller */
$this->Session->write('pol', $pol_id);
$this->Session->write('sol', $sol_id);
/* controller and id */
$control = null;
$id = null;
switch ($type) {
case 'http':
/* load model */
$Feed = new Feed_xml();
/* find id */
$control = 'Feed_xml';
$conditions = array('Feed_xml.rs_body' => $path);
$param = array('recursive' => 0, 'fields' => array('Feed_xml.id'), 'conditions' => $conditions);
$id = $Feed->find('first', $param);
if ($id == null) {
/* load model */
$Web = new Web();
/* find id */
$control = 'Web';
$conditions = array("or" => array('Web.rq_header' => $path, 'Web.rs_header' => $path, 'Web.rq_body' => $path, 'Web.rs_body' => $path));
$param = array('recursive' => 0, 'fields' => array('Web.id'), 'conditions' => $conditions);
$id = $Web->find('first', $param);
}
break;
case 'fbwchat':
/* load model */
$Fbc = new Fbchat();
/* find id */
$control = 'Fbchat';
$conditions = array('Fbchat.chat' => $path);
$param = array('recursive' => 0, 'fields' => array('Fbchat.id'), 'conditions' => $conditions);
$id = $Fbc->find('first', $param);
break;
case 'ftp':
/* load model */
$Ftp = new Ftp_file();
/* find id */
$control = 'Ftp_file';
$conditions = array('Ftp_file.file_path' => $path);
$param = array('recursive' => 0, 'fields' => array('Ftp_file.id'), 'conditions' => $conditions);
$id = $Ftp->find('first', $param);
if ($id == null) {
/* load model */
$Ftp = new Ftp();
/* find id */
$control = 'Ftp';
$conditions = array('Ftp.cmd_path' => $path);
$param = array('recursive' => 0, 'fields' => array('Ftp.id'), 'conditions' => $conditions);
$id = $Ftp->find('first', $param);
}
break;
case 'ipp':
case 'pjl':
/* load model */
$Pjl = new Pjl();
/* find id */
$control = 'Pjl';
$conditions = array("or" => array('Pjl.pcl_path' => $path, 'Pjl.pdf_path' => $path));
$param = array('recursive' => 0, 'fields' => array('Pjl.id'), 'conditions' => $conditions);
$id = $Pjl->find('first', $param);
break;
case 'mail':
/* load model */
$Mail = new Email();
/* find id */
$control = 'Email';
$conditions = array('Email.mime_path' => $path);
$param = array('recursive' => 0, 'fields' => array('Email.id'), 'conditions' => $conditions);
$id = $Mail->find('first', $param);
break;
case 'mms':
/* load model */
$Mms = new Mmscontent();
/* find id */
$control = 'Mmscontent';
$conditions = array('Mmscontent.file_path' => $path);
$param = array('recursive' => 0, 'fields' => array('Mmscontent.id'), 'conditions' => $conditions);
$id = $Mms->find('first', $param);
break;
case 'nntp':
/* load model */
$Nntp = new Nntp_article();
/* find id */
$control = 'Nntp_article';
$conditions = array('Nntp_article.mime_path' => $path);
$param = array('recursive' => 0, 'fields' => array('Nntp_article.id'), 'conditions' => $conditions);
$id = $Nntp->find('first', $param);
break;
case 'telnet':
/* load model */
$Teln = new Telnet();
/* find id */
$control = 'Telnet';
$conditions = array('Telnet.cmd' => $path);
//.........这里部分代码省略.........