original_string: static function getUploadDir($withUploadUrl = TRUE)
      {
          $dir = __DIR__ . '/../../../../web/';
          if (!is_dir($dir))
          {
              $dir = __DIR__ . '/../../../../../web';
              if (!is_dir($dir))
              {
                  $dir = __DIR__ . '/../../../../../../web';
                  if (!is_dir($dir))
                  {
                      throw new \Exception('Upload dir not found');
                  }
              }
          }
          if (!is_dir($dir . self::getUploadUrl()))
          {
              if (!is_writable($dir))
              {
                  throw new \Exception($dir . ' is not writable');
              }
              else
              {
                  mkdir($dir . self::getUploadUrl());
              }
          }
          return $withUploadUrl ? $dir . self::getUploadUrl() : $dir;
      }
code: static function getUploadDir($withUploadUrl = TRUE)
      {
          $dir = __DIR__ . '/../../../../web/';
          if (!is_dir($dir))
          {
              $dir = __DIR__ . '/../../../../../web';
              if (!is_dir($dir))
              {
                  $dir = __DIR__ . '/../../../../../../web';
                  if (!is_dir($dir))
                  {
                      throw new \Exception('Upload dir not found');
                  }
              }
          }
          if (!is_dir($dir . self::getUploadUrl()))
          {
              if (!is_writable($dir))
              {
                  throw new \Exception($dir . ' is not writable');
              }
              else
              {
                  mkdir($dir . self::getUploadUrl());
              }
          }
          return $withUploadUrl ? $dir . self::getUploadUrl() : $dir;
      }
code_tokens: static function getUploadDir ( $ withUploadUrl = TRUE ) { $ dir = __DIR__ . '/../../../../web/' ; if ( ! is_dir ( $ dir ) ) { $ dir = __DIR__ . '/../../../../../web' ; if ( ! is_dir ( $ dir ) ) { $ dir = __DIR__ . '/../../../../../../web' ; if ( ! is_dir ( $ dir ) ) { throw new \ Exception ( 'Upload dir not found' ) ; } } } if ( ! is_dir ( $ dir . self :: getUploadUrl ( ) ) ) { if ( ! is_writable ( $ dir ) ) { throw new \ Exception ( $ dir . ' is not writable' ) ; } else { mkdir ( $ dir . self :: getUploadUrl ( ) ) ; } } return $ withUploadUrl ? $ dir . self :: getUploadUrl ( ) : $ dir ; }
docstring: Get upload file dir
  
  @throws \Exception
docstring_tokens: Get upload file dir