How to use getDestinationDirectory method of html class

Best Atoum code snippet using html.getDestinationDirectory

ProjectExporter.class.php

Source:ProjectExporter.class.php Github

copy

Full Screen

...291 * Returns the destination directory292 * 293 * @return string294 */295 public function getDestinationDirectory($relative_path = true) {296 if ($this->relative_path && $relative_path) {297 return $this->getBasePath() . '/' . $this->project->getSlug() . '/' . $this->relative_path;298 } else {299 return $this->getBasePath() . '/' . $this->project->getSlug();300 } // if301 } // getDestinationDirectory302 303 /**304 * Destination path for the specified file 305 * 306 * @param string $file307 * @return string308 */309 public function getUploadedFilePath($file) {310 return $this->getBasePath() . '/' . $this->project->getSlug() . '/' . $this->files_relative_path . '/' . $file;311 } // getUploadedFilePath312 313 /**314 * Uploaded files directory315 * 316 * @param void317 * @return string318 */319 public function getUploadedFilesDirectory() {320 return $this->getBasePath() . '/' . $this->project->getSlug() . '/' . $this->files_relative_path;321 } // getUploadedFilesDirectory322 323 /**324 * Destination path for the specified avatar 325 * 326 * @param string $avatar327 * @return string328 */329 public function getUploadedAvatarPath($avatar) {330 return $this->getBasePath() . '/' . $this->project->getSlug() . '/' . $this->files_relative_path . '/'. $this->avatars_relative_path . '/' . $avatar;331 } // getUploadedAvatarPath332 333 /**334 * Uploaded avatars directory335 * 336 * @param void337 * @return string338 */339 public function getUploadedAvatarDirectory() {340 return $this->getBasePath() . '/' . $this->project->getSlug() . '/' . $this->files_relative_path . '/' . $this->avatars_relative_path;341 } // getUploadedAvatarDirectory342 343 /**344 * Store file in uploads folder345 * 346 * @param string $original_filename347 * @param string $filename_on_the_system348 * @return string349 */350 public function storeFile($original_filename, $source_path, $return_link = false) {351 $pathinfo = pathinfo($original_filename);352 $new_filename = $pathinfo['filename'] . '_' . make_string(15) . ($pathinfo['extension'] ? '.' . $pathinfo['extension'] : null);353 $destination_path = $this->getUploadedFilePath($new_filename);354 355 if (copy($source_path, $destination_path)) {356 if ($return_link) {357 return '<a href="' . $this->url_prefix . $this->files_relative_path . '/' . $new_filename . '" target="_blank">' . $original_filename . '</a>';358 } else {359 return $this->url_prefix . $this->files_relative_path . '/' . $new_filename;360 } // if361 } // if362 363 $this->addWarning(lang('Failed to copy :file file', array('file' => $source_path)));364 return false;365 } // storeFile366 367 /**368 * Store avatar in avatars folder369 * 370 * @param string $original_filename371 * @param string $filename_on_the_system372 * @return string373 */374 public function storeAvatar($original_filename, $source_path, $return_link = false) {375 $pathinfo = pathinfo($original_filename);376 $new_filename = 'avatar' . '_' . $pathinfo['filename'] . ($pathinfo['extension'] ? '.' . $pathinfo['extension'] : null);377 $destination_path = $this->getUploadedAvatarPath($new_filename);378 if (copy($source_path, $destination_path)) {379 if ($return_link) {380 return '<img src="' . $this->url_prefix . $this->files_relative_path . '/' . $this->avatars_relative_path . '/' . $new_filename . '" alt="'.$new_filename.'" />';381 } else {382 return $new_filename;383 } // if384 } // if385 386 $this->addWarning(lang('Failed to copy :avatar avatar', array('avatar' => $source_path)));387 return false;388 } // storeFile389 390 /**391 * Display user links, and cache users392 */393 public function getUserLink($user_id, $name, $email) {394 if (!isset($this->users[$user_id])) {395 $this->users[$user_id] = Users::findById($user_id);396 397 if (!($this->users[$user_id] instanceof User)) {398 $this->users[$user_id] = new AnonymousUser($name, $email);399 } // if400 } // if401 402 return '<a href="' . $this->users[$user_id]->getEmail() . '">' . $this->users[$user_id]->getDisplayName() . '</a>';403 } // if404 405 /**406 * Render template into destination file407 * 408 * @param string $template_name409 * @param array $variables410 * @param string $destination411 */412 public function renderTemplate($template_name, $destination) {413// SMARTY OPTION414 $this->storage['template_file'] = get_view_path($template_name, 'exporter', $this->active_module, AngieApplication::INTERFACE_DEFAULT);415 $this->storage['fetched'] = $this->smarty->fetch($this->storage['template_file']);416 $this->storage['compiled'] = str_replace('{$content_for_layout}', $this->storage['fetched'], $this->wireframe);417 $this->storage['compiled'] = str_replace('{$main_navigation}', $this->navigation, $this->storage['compiled']);418 $this->storage['compiled'] = str_replace('{$url_prefix}', $this->url_prefix, $this->storage['compiled']);419 $this->storage['compiled'] = str_replace('{$project_name}', $this->project->getName(), $this->storage['compiled']);420 $this->storage['compiled'] = str_replace('{$year}', DateTimeValue::now()->getYear(), $this->storage['compiled']);421 422 file_put_contents($destination, $this->storage['compiled']);423 424// PHP OPTION425// file_put_contents($destination, $this->fetchTemplate($template_name, $variables));426 } // renderTemplate427 428 /**429 * Fetch the specified template430 * 431 * @param string $template_name432 * @param array $variables433 * @return string434 */435 public function fetchTemplate($template_name, $variables) {436 extract($variables);437 $template_file = get_view_path($template_name, 'exporter', $this->active_module, AngieApplication::INTERFACE_DEFAULT);438 ob_start();439 include $template_file;440 $fetch = ob_get_contents();441 ob_end_clean();442 return $fetch;443 } // fetchTemplate444 445 /**446 * Do the export447 */448 public function export() {449 if (!$this->getBasePath()) {450 throw new Error(lang('Base export directory for :exporter_class has not been set', array('exporter_class' => get_class($this))));451 } // if452 453 // create folder for this exporter 454 if ($this instanceof SystemProjectExporter) {455 $this->cleanup();456 } //if457 458 // create folder structure for this exporter459 if (!is_dir($this->getDestinationDirectory())) {460 if (!recursive_mkdir($this->getDestinationDirectory(), 0777, $this->getBasePath())) {461 throw new DirectoryCreateError($this->getDestinationDirectory());462 } // if463 } // if464 465 if (!is_dir($this->getUploadedFilesDirectory())) {466 if (!recursive_mkdir($this->getUploadedFilesDirectory(), 0777, $this->getBasePath())) {467 throw new DirectoryCreateError($this->getUploadedFilesDirectory());468 } // if469 } //if470 471 if (!is_dir($this->getUploadedAvatarDirectory())) {472 if (!recursive_mkdir($this->getUploadedAvatarDirectory(), 0777, $this->getBasePath())) {473 throw new DirectoryCreateError($this->getUploadedAvatarDirectory());474 } // if475 } //if476 477 if ($this instanceof SystemProjectExporter) {478 // copy assets 479 copy_dir(PROJECT_EXPORTER_MODULE_PATH . '/resources/html_assets', $this->getDestinationPath('_assets', false), null, true);480 } // if481 } // export482 483 /***484 * Do the pre/post export cleanup485 * 486 * @param void487 * @return null488 */489 public function cleanup() {490 if (is_dir($this->getDestinationDirectory(false))) {491 if (!delete_dir($this->getDestinationDirectory(false))) {492 throw new DirectoryDeleteError($this->getDestinationDirectory(false));493 } // if494 } //if495 return true;496 } // cleanup497 498 /**499 * Finalize export500 * 501 * @param int $compress502 * @return null503 */504 public function finalize($compress) {505 $return = array(506 'compress' => 0,507 'info_path' => $this->getDestinationDirectory(false)508 );509 if ($compress) {510 if (!CAN_USE_ZIP) {511 throw new Error(lang('Zlib extension not loaded, could not create archive file :archive. Exported files are available in folder :folder', array("archive" => $this->getCompressedPath(), "folder" => $this->getDestinationDirectory())));512 } else {513 require_once ANGIE_PATH . '/classes/PclZip.class.php';514 $archive = new PclZip($this->getCompressedPath());515 if ($archive->create($this->getDestinationDirectory(),PCLZIP_OPT_REMOVE_PATH,$this->getBasePath()) === 0) {516 throw new Error(lang('Could not create archive file :archive. Exported files are available in folder :folder', array("archive" => $this->getCompressedPath(), "folder" => $this->getDestinationDirectory())));517 } else {518 $this->cleanup();519 $return['compress'] = 1;520 $return['info_path'] = Router::assemble('project_exporter_download_export',array('project_slug' => $this->project->getSlug()));521 }//if522 }//if523 } //if524 return $return;525 } // finalize526 527 public static function exportExists($project,$base_path) {528 return is_file($base_path . '/project_' . $project->getId() . '.zip');529 } //exportExists530 ...

Full Screen

Full Screen

getDestinationDirectory

Using AI Code Generation

copy

Full Screen

1$destinationDir = $html->getDestinationDirectory();2echo $destinationDir;3$destinationDir = $html->getDestinationDirectory();4echo $destinationDir;5$destinationDir = $html->getDestinationDirectory();6echo $destinationDir;7$destinationDir = $html->getDestinationDirectory();8echo $destinationDir;9$destinationDir = $html->getDestinationDirectory();10echo $destinationDir;

Full Screen

Full Screen

getDestinationDirectory

Using AI Code Generation

copy

Full Screen

1require_once("classes/html.php");2$obj = new html;3echo $obj->getDestinationDirectory();4require_once("classes/html.php");5$obj = new html;6echo $obj->getDestinationDirectory();7require_once("classes/html.php");8$obj = new html;9echo $obj->getDestinationDirectory();10require_once("classes/html.php");11$obj = new html;12echo $obj->getDestinationDirectory();13require_once("classes/html.php");14$obj = new html;15echo $obj->getDestinationDirectory();16require_once("classes/html.php");17$obj = new html;18echo $obj->getDestinationDirectory();19require_once("classes/html.php");20$obj = new html;21echo $obj->getDestinationDirectory();22require_once("classes/html.php");23$obj = new html;24echo $obj->getDestinationDirectory();25require_once("classes/html.php");26$obj = new html;27echo $obj->getDestinationDirectory();28require_once("classes/html.php");29$obj = new html;30echo $obj->getDestinationDirectory();

Full Screen

Full Screen

getDestinationDirectory

Using AI Code Generation

copy

Full Screen

1$destinationDirectory = $html->getDestinationDirectory();2$destinationFile = $html->getDestinationFile();3$destinationPath = $html->getDestinationPath();4$destinationUrl = $html->getDestinationUrl();5$destinationUrl = $html->getDestinationUrl();6$destinationUrl = $html->getDestinationUrl();7$destinationUrl = $html->getDestinationUrl();8$destinationUrl = $html->getDestinationUrl();9$destinationUrl = $html->getDestinationUrl();10$destinationUrl = $html->getDestinationUrl();11$destinationUrl = $html->getDestinationUrl();12$destinationUrl = $html->getDestinationUrl();13$destinationUrl = $html->getDestinationUrl();14$destinationUrl = $html->getDestinationUrl();15$destinationUrl = $html->getDestinationUrl();16$destinationUrl = $html->getDestinationUrl();17$destinationUrl = $html->getDestinationUrl();

Full Screen

Full Screen

getDestinationDirectory

Using AI Code Generation

copy

Full Screen

1$dir = $html->getDestinationDirectory();2$dir = $html->getDestinationDirectory();3$dir = $html->getDestinationDirectory();4$dir = $html->getDestinationDirectory();5$dir = $html->getDestinationDirectory();6$dir = $html->getDestinationDirectory();7$dir = $html->getDestinationDirectory();8$dir = $html->getDestinationDirectory();9$dir = $html->getDestinationDirectory();10$dir = $html->getDestinationDirectory();11$dir = $html->getDestinationDirectory();12$dir = $html->getDestinationDirectory();13$dir = $html->getDestinationDirectory();14$dir = $html->getDestinationDirectory();15$dir = $html->getDestinationDirectory();16$dir = $html->getDestinationDirectory();17$dir = $html->getDestinationDirectory();18$dir = $html->getDestinationDirectory();19$dir = $html->getDestinationDirectory();20$dir = $html->getDestinationDirectory();21$dir = $html->getDestinationDirectory();22$dir = $html->getDestinationDirectory();23$dir = $html->getDestinationDirectory();24$dir = $html->getDestinationDirectory();

Full Screen

Full Screen

getDestinationDirectory

Using AI Code Generation

copy

Full Screen

1require_once 'HTML/QuickForm.php';2require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';3$form = new HTML_QuickForm('form1');4$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($smarty);5$form->accept($renderer);6$smarty->assign('form1', $renderer->toArray());7require_once 'HTML/QuickForm.php';8require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';9$form = new HTML_QuickForm('form2');10$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($smarty);11$form->accept($renderer);12$smarty->assign('form2', $renderer->toArray());13require_once 'HTML/QuickForm.php';14require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';15$form = new HTML_QuickForm('form3');16$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($smarty);17$form->accept($renderer);18$smarty->assign('form3', $renderer->toArray());19require_once 'HTML/QuickForm.php';20require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';21$form = new HTML_QuickForm('form4');22$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($smarty);23$form->accept($renderer);24$smarty->assign('form4', $renderer->toArray());25require_once 'HTML/QuickForm.php';26require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';27$form = new HTML_QuickForm('form5');28$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($smarty);29$form->accept($renderer);30$smarty->assign('form5', $renderer->toArray());31require_once 'HTML/QuickForm.php';32require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';33$form = new HTML_QuickForm('

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful