當前位置: 首頁>>代碼示例>>PHP>>正文


PHP N2Filesystem::fileexists方法代碼示例

本文整理匯總了PHP中N2Filesystem::fileexists方法的典型用法代碼示例。如果您正苦於以下問題:PHP N2Filesystem::fileexists方法的具體用法?PHP N2Filesystem::fileexists怎麽用?PHP N2Filesystem::fileexists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在N2Filesystem的用法示例。


在下文中一共展示了N2Filesystem::fileexists方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: subform

 public function subform($appType, $configurationXmlFile, $values, $control_name, $name)
 {
     if (N2Filesystem::fileexists($configurationXmlFile)) {
         N2Loader::import('libraries.form.form');
         $form = new N2Form($appType);
         $form->loadArray($values);
         //$subformValue = array();
         //$subformValue[N2Post::getVar('name')] = N2Post::getVar('value');
         //$form->loadArray($subformValue);
         $form->loadXMLFile($configurationXmlFile);
         ob_end_clean();
         // To clear the output of the platform
         ob_start();
         $subform = $form->getSubFormAjax(N2Post::getVar('tab'), $name);
         $subform->initAjax($control_name);
         echo $subform->renderForm();
         //echo N2AssetsManager::generateAjaxCSS();
         $scripts = N2AssetsManager::generateAjaxJS();
         $html = ob_get_clean();
         $response = array('html' => $html, 'scripts' => $scripts);
     } else {
         $response = array('error' => 'Configuration file not found: ' . $configurationXmlFile);
     }
     return $response;
 }
開發者ID:MBerguer,項目名稱:wp-demo,代碼行數:25,代碼來源:ajax.php

示例2: replaceHTMLImage

 public function replaceHTMLImage($found)
 {
     $path = N2Filesystem::absoluteURLToPath(self::addProtocol($found[2]));
     if ($path == $found[2]) {
         return $found[0];
     }
     if (N2Filesystem::fileexists($path)) {
         if (!isset($this->imageTranslation[$path])) {
             $fileName = strtolower(basename($path));
             while (in_array($fileName, $this->usedNames)) {
                 $fileName = $this->uniqueCounter . $fileName;
                 $this->uniqueCounter++;
             }
             $this->usedNames[] = $fileName;
             $this->files['images/' . $fileName] = file_get_contents($path);
             $this->imageTranslation[$path] = $fileName;
         } else {
             $fileName = $this->imageTranslation[$path];
         }
         return str_replace($found[2], 'images/' . $fileName, $found[0]);
     } else {
         return $found[0];
     }
 }
開發者ID:MBerguer,項目名稱:wp-demo,代碼行數:24,代碼來源:export.php

示例3: defined

<?php

defined('N2LIBRARY') or die;
$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
foreach (N2Filesystem::folders($dir) as $folder) {
    $file = $dir . $folder . DIRECTORY_SEPARATOR . $folder . '.php';
    if (N2Filesystem::fileexists($file)) {
        require_once $file;
    }
}
開發者ID:MBerguer,項目名稱:wp-demo,代碼行數:10,代碼來源:loadplugin.php

示例4: actionImportFromServer

 public function actionImportFromServer()
 {
     if ($this->validatePermission('smartslider_edit')) {
         if (N2Request::getInt('save')) {
             if ($this->validateToken()) {
                 $data = new N2Data(N2Request::getVar('slider'));
                 $file = $data->get('import-file');
                 if (empty($file)) {
                     N2Message::error(n2_('Please select a file!'));
                     $this->refresh();
                 } else {
                     $dir = N2Platform::getPublicDir();
                     if (N2Filesystem::fileexists($dir . '/' . $file)) {
                         N2Loader::import('libraries.import', 'smartslider');
                         $import = new N2SmartSliderImport();
                         $sliderId = $import->import($dir . '/' . $file, $data->get('image-mode', 'clone'), $data->get('linked-visuals', 0));
                         if ($sliderId !== false) {
                             if ($data->get('delete')) {
                                 @unlink($dir . '/' . $file);
                             }
                             N2Message::success(n2_('Slider imported.'));
                             $this->redirect(array("slider/edit", array("sliderid" => $sliderId)));
                         } else {
                             N2Message::error(n2_('Import error!'));
                             $this->refresh();
                         }
                     } else {
                         N2Message::error(n2_('The chosen file is missing!'));
                         $this->refresh();
                     }
                 }
             } else {
                 $this->refresh();
             }
         }
         $this->addView('importFromServer');
         $this->render();
     }
 }
開發者ID:RenatoToasa,項目名稱:Pagina-Web,代碼行數:39,代碼來源:Sliders.php


注:本文中的N2Filesystem::fileexists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。