开发者

how @usedby tag work in phpdoc

By using @usedby tag hyperlink is not coming in documentation.

Class Content
{
    /**
    * simple db class variable
    * @access public
    */
    var $_db=null; // db
    /**
    * s3 class instance
    */
    private $_s3=null; //  s3
    /**
    * application variable array for creating instance of each object 
    * @var array
    * @usedby Content::upload() this is compared 
    */
   开发者_StackOverflow public $application=array(
        'image'=>array(
                'createthumb'=>'createimagethumb'
                ),
        'audio'=>array(
                'createthumb'=>'createaudiothumb'
                ),
        'video'=>array(
                'createthumb'=>'createvideothumb'
                ),
        'link'=>array(
                'createthumb'=>'createlinkthumb'
                )
        );
/**
    * for uploading new content or you can say add new content :)
    *
    * @return json of new contents 
    **/
    function upload()
    {
        if ($_POST['gibname']=='' or $_POST['gibview']=='') {
            $msg=createmessage(false, 'Please enter gibname and gib view where you want to place content');
        }
        $maxFileSize = 100 * 1024 * 1024;   // Max file size 100 MB
        $thumb = $status =$imgWidth = $imgHeight = '';
        $headers = apache_request_headers();        // Get file size from Apache headers
        $fileSize=(int)$headers['Content-Length'];
        $fileType = (string)$headers['Content-Type']; // Get MIME type from Apache headers
        $clientfileType = $fileType;
        if (preg_match("/^multipart/", $fileType) ) $fileType = $_FILES['qqfile']['type'];
        if ($fileType=='application/octet-stream') $fileType="video/flv";
        if ($fileSize == 0) {
            return array('success'=>false, 'error'=>"File is empty.");
        }               
        if ($fileSize > $maxFileSize) {
            return array('success'=>false, 'error'=>"File is too large.");
        }
        $pathinfo = pathinfo($_REQUEST['qqfile']);        // Put data of pathinfo() array into $pathinfo    
        $filename = $pathinfo['filename'];// Get file name - eg: myphoto
        $ext = $pathinfo['extension'];        // Get extension - eg: .jpg
        if ($ext=='') $ext=substr(strrchr($_FILES['qqfile']['name'], '.'), 1);
        $originalName = $filename.'.'.$ext;
        $randName = uniqid();               // Generate unique id for the current object
        $fileTempName =  $randName . '.' . $ext;    // Unique file name with extension
        $fullTempName = "uploads/".$fileTempName;        // Set temp directory where files will be written temporarily        // Complete temp file name and path
        if (!preg_match("/^multipart/", $clientfileType)) { // Upload the file to temp directory on .net server
            $input = fopen("php://input", "r");
            $fp = fopen($fullTempName, "w");
            while ($data = fread($input, 1024)) {
                fwrite($fp,$data);
            }
            fclose($fp);
            fclose($input);         
        } else
            move_uploaded_file($_FILES["qqfile"]["tmp_name"], $fullTempName);
        $objecttype=mb_substr($fileType,0,-mb_strlen(strrchr($fileType,"/")));
        //for uploading of link url is neccesssary
        if ($_POST['url']!='' or $_POST['refername']!='') {
            $objecttype="link";
            $url=$_POST['url'];
            $filename=$_POST['filename'];
        } else {
            $url=CLOUDFRONT.$fileTempName;
            $filename=$fileTempName;
        }
        if (class_exists($objecttype) && $_POST['refername']=='') {
            $object=new $objecttype();
            $str=$this->application[$objecttype]['createthumb'];
            $thumb=$object->{$str}($fullTempName,$fileType);
            $thumbnail=$thumb['thumb'];
            $preview=$thumb['preview'];
            $imgWidth=$object->imagewidth;
            $imgHeight=$object->imageheight;
            $resize=$object->resize;
        }
}

While @usedby is not the warning is coming telling unknown tag . phpdocumentor version is 1.4.3 why it is saying the unknown tag .


The "@usedby" tag is not a code documentation tag that phpDocumentor looks for in your docblocks. There is a "@uses" tag that says "this particular element uses the one I'm listing in this tag". phpDocumentor will see this tag, show this tag on the element's doc, make a link to the other element, and put a @usedby tag in the documentation for that other element.

In short, you put @uses in ThisElement's docblock to point from ThisElement to ThatElement, and phpDocumentor will put @usedby in ThatElement's documentation to point from ThatElement back to ThisElement.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜