コード例 #1
0
ファイル: File.php プロジェクト: alexpagnoni/jphp
 function setFilePath($path)
 {
     if (File::validClass($path)) {
         $this->path = $path->getFilePath();
     } else {
         $this->path = StringBuffer::validClass($path) ? $path->toString() : $path;
     }
 }
コード例 #2
0
ファイル: FilenameFilter.php プロジェクト: alexpagnoni/jphp
 function accept($fileobj, $dirname)
 {
     if (File::validClass($fileobj) && (StringBuffer::validClass($dirname) || is_string($dirname))) {
         return TRUE;
     } else {
         return FALSE;
     }
 }
コード例 #3
0
 function toStringBuffer($object)
 {
     if (StringBuffer::validClass($object)) {
         return $object;
     }
     if (isset($object) && $object != '') {
         if (is_object($object) && method_exists($object, 'tostring')) {
             return new StringBuffer($object->toString());
         } else {
             return new StringBuffer($object);
         }
     }
     return NULL;
 }
コード例 #4
0
ファイル: HttpRequest.php プロジェクト: alexpagnoni/jphp
 /**
  * move the upload file to another location of the given parameter name
  * @param string|core.StringBuffer  parameter name
  * @param string|core.StringBuffer|core.File  parameter name
  * @return core.StringBuffer  the uploaded file name
  * @see jphp.http.interface.IHttpRequest#moveUploadedFileTo
  */
 function moveUploadedFileTo($key, $path)
 {
     $file = NULL;
     $basefile = $this->files->get($key);
     if (isset($basefile)) {
         if (File::validClass($path) || StringBuffer::validClass($path) || is_string($path)) {
             $targetfile = new File($path);
             return $basefile->moveTo($targetfile);
         }
     }
     return FALSE;
 }