You are here

class ActionUploadInit in N1ED - Visual editor as CKEditor plugin with Bootstrap support 7

Hierarchy

Expanded class hierarchy of ActionUploadInit

1 file declares its use of ActionUploadInit
Actions.php in vendor/edsdk/file-uploader-server-php/src/lib/Actions.php

File

vendor/edsdk/file-uploader-server-php/src/lib/action/ActionUploadInit.php, line 16

Namespace

EdSDK\FileUploaderServer\lib\action
View source
class ActionUploadInit extends AAction {
  public function getName() {
    return "uploadInit";
  }
  public function run($req) {
    $alphabeth = "abcdefghijklmnopqrstuvwxyz0123456789";
    do {
      $id = "";
      for ($i = 0; $i < 6; $i++) {
        $charNumber = rand(0, strlen($alphabeth) - 1);
        $id .= substr($alphabeth, $charNumber, 1);
      }
      $dir = $this->m_config
        ->getTmpDir() . "/" . $id;
    } while (file_exists($dir));
    if (!mkdir($dir)) {
      throw new MessageException(Message::createMessage(Message::UNABLE_TO_CREATE_UPLOAD_DIR));
    }
    return new RespUploadInit($id, $this->m_config);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AAction::$m_config protected property
AAction::setConfig public function
AAction::validateBoolean protected function
AAction::validateInteger protected function
AAction::validateString protected function
ActionUploadInit::getName public function Overrides AAction::getName
ActionUploadInit::run public function Overrides AAction::run