Non-static method should not be called statically

Issue #6 resolved
cornelistjendra created an issue

Run on: -Yii version 1.1.13 -Windows 7 Home Premium -Version Apache/2.4.3 (Win32) -PHP/5.4.7

Non-static method DDMediaDirectory::pathToUnix() should not be called statically, assuming $this from incompatible context

Non-static method DDMediaDirectory::pathToWindows() should not be called statically, assuming $this from incompatible context

Non-static method DDMediaDirectory::getSubDirs() should not be called statically, assuming $this from incompatible context

stack trace C:\xampp\htdocs\NewsShowcase\protected\modules\media\controllers\DefaultController.php(64)

52 Yii::app()->user->setFlash('success',Yii::t('MediaModule.main','The file <em>{oldName}</em> has been uploaded as <em>{name}</em>.',array('{name}'=>$mediaAction->name, '{oldName}'=>$mediaAction->oldName))); 53 break; 54 case 'newdir': 55 Yii::app()->user->setFlash('success',Yii::t('MediaModule.main','The directory <em>{p1}</em> has been created.',array('{p1}'=>$mediaAction->p1))); 56 break; 57 } 58 } else { 59 Yii::app()->user->setFlash('error',sprintf("<b>Error!</b><br />Couldn't do action <em>%s</em> on item <em>%s</em>",$mediaAction->action, $mediaAction->path)); 60 } 61 62 } 63 } 64 $basePath = DDMediaDirectory::pathToUnix(realpath(Yii::app()->basePath.'/../files')); 65 // Get base path from module settings 66 //$basePath = $DDMediaDirectory->pathToUnix(realpath($this->module->baseDir)); 67 // DDMediaDirectory::pathToUnix(realpath($this->module->baseDir)); 68 // DEBUG echo "<li>basePath: $basePath"; 69 / 70 if(!is_dir($basePath)) 71 throw new CHttpException(500, 'Directory '.$basePath.' is not a valid directory'); 72 / 73 $defaultPath = '.'; 74 $path = isset($_GET['p']) ? urldecode($_GET['p']) : '.'; 75 $currentPath = DDMediaDirectory::pathToUnix(realpath($basePath.'/'.$path)); 76 // DEBUG echo "<li>currentPath: $currentPath";

Comments (2)

  1. Log in to comment