PHP warning

finfo_file(/mnt/data/shnoulle/nginx/www/master/upload/themes/question/inline_columns/survey/questions/answer/listradio/assets/preview.png): failed to open stream: No such file or directory

/mnt/data/shnoulle/nginx/www/master/framework/utils/CFileHelper.php(282)

270      * PHP extension is available. This parameter has been available since version 1.1.3.
271      * @param boolean $checkExtension whether to check the file extension in case the MIME type cannot be determined
272      * based on finfo and mime_content_type. Defaults to true. This parameter has been available since version 1.1.4.
273      * @return string the MIME type. Null is returned if the MIME type cannot be determined.
274      */
275     public static function getMimeType($file,$magicFile=null,$checkExtension=true)
276     {
277         if(function_exists('finfo_open'))
278         {
279             $options=defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
280             $info=$magicFile===null ? finfo_open($options) : finfo_open($options,$magicFile);
281 
282             if($info && ($result=finfo_file($info,$file))!==false)
283                 return $result;
284         }
285 
286         if(function_exists('mime_content_type') && ($result=mime_content_type($file))!==false)
287             return $result;
288 
289         return $checkExtension ? self::getMimeTypeByExtension($file) : null;
290     }
291 
292     /**
293      * Determines the MIME type based on the extension name of the specified file.
294      * This method will use a local map between extension name and MIME type.

Stack Trace

#1
+
 /mnt/data/shnoulle/nginx/www/master/application/core/LSYii_ImageValidator.php(46): CFileHelper::getMimeType("/mnt/data/shnoulle/nginx/www/master/upload/themes/question/inlin...")
41 
42         /** @var array<string, mixed> */
43         $result =[];
44 
45         /** @var ?? */
46         $checkImage = CFileHelper::getMimeType($path);
47         $result['debug'] = $checkImage;
48 
49         // TODO: Why hard-coded?
50         /** @var string[] */
51         $allowedImageFormats = array(
#2
+
 /mnt/data/shnoulle/nginx/www/master/application/models/QuestionTemplate.php(428): LSYii_ImageValidator::validateImage("/mnt/data/shnoulle/nginx/www/master/upload/themes/question/inlin...")
423                                 $aQuestionTemplates[$file]['title'] = $templateName;
424                             }
425                             if (!empty($oConfig->files->preview->filename)){
426                                 $fileName = json_decode(json_encode($oConfig->files->preview->filename), TRUE)[0];
427                                 $previewPath = $sFullPathToQuestionTemplate."/assets/".$fileName;
428                                 $check = LSYii_ImageValidator::validateImage($previewPath);
429                                 if(is_file($previewPath) && $check['check']) {
430                                     $aQuestionTemplates[$file]['preview'] = App()->getAssetManager()->publish($previewPath);
431                                 } else {
432                                     /* Log it a theme.question.$oConfig->name as error, review ? */
433                                     Yii::log("Unable to use $fileName for preview in $sFullPathToQuestionTemplate/assets/",'error','theme.question.'.$oConfig->metadata->name);
#3
+
 /mnt/data/shnoulle/nginx/www/master/application/models/QuestionTemplate.php(386): QuestionTemplate::getQuestionTemplateUserList("L")
381      * @param string $type
382      * @return array
383      */
384     static public function getQuestionTemplateList($type)
385     {
386         $aUserQuestionTemplates = self::getQuestionTemplateUserList($type);
387         $aCoreQuestionTemplates = self::getQuestionTemplateCoreList($type);
388         $aQuestionTemplates     = array_merge($aUserQuestionTemplates, $aCoreQuestionTemplates);
389         return $aQuestionTemplates;
390     }
391 
2019-09-17 06:38:25 nginx/1.16.1 Yii Framework/1.1.21