只是似乎无法从其类中调用的函数中获得结果......
require_once($_SERVER['DOCUMENT_ROOT']."/youradmin_v2/scripts/php/IPTC.php");
类媒体{
function Media() { // connects to db } function getMetaData($mediaID){ global $select; $mediaDB = $select->mediaSelect($mediaID); $filePath=$mediaDB['filePath']; $itpc =new Image_IPTC($filePath); return $itpc->getTag($tag,0)." called?"; }
函数 newFileProcessing($file_name){ 全局 $func;
全局 $select、$insert、$update;$mediaID=$insert->addMedia($file_name, $filetype, $filePathImg,$testI); $mediaDB = $select->mediaSelect($mediaID); $filePath=$_SERVER['DOCUMENT_ROOT'].$mediaDB['pathToFile']; $update->updateQuery('media',"title='".$this->getMetaData($mediaID)."'");
}
} $media = 新媒体;
当我在 php 页面上使用 $media->getMetaData($mediaID) 时它可以工作吗?没有错误,什么时候在类“调用?”中调用它?已添加到条目中,因此我认为它与 $itpc =new Image_IPTC($filePath) 部分有关,可以在此处查看;
谁能看到我做错了什么?!任何指针表示赞赏。
最好的,丹。