本文整理汇总了PHP中N2Filesystem::existsFile方法的典型用法代码示例。如果您正苦于以下问题:PHP N2Filesystem::existsFile方法的具体用法?PHP N2Filesystem::existsFile怎么用?PHP N2Filesystem::existsFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类N2Filesystem
的用法示例。
在下文中一共展示了N2Filesystem::existsFile方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isCached
private function isCached($fileName)
{
if (N2Filesystem::existsFile($this->getStorageFilePath($fileName))) {
return true;
}
return false;
}
示例2: renderInline
public function renderInline($fileName, $params = array(), $path = null, $absolutePathInFilename = false)
{
if ($absolutePathInFilename) {
$path = "";
} elseif (is_null($path)) {
$path = $this->appType->path . NDS . "inline" . NDS;
}
if (!strpos($fileName, ".php")) {
$fileName = $fileName . ".php";
}
/**
* Hack for something
*
* @todo write an example, maybe a bug
*/
/*
if (strlen($path) < 3 && $path != '') {
$path = "";
}
*/
if (!N2Filesystem::existsFile($path . $fileName)) {
throw new N2ViewException("View file ({$fileName}) not found in {$path}");
}
extract($params);
/** @noinspection PhpIncludeInspection */
include $path . $fileName;
}
示例3: isCached
private function isCached($file)
{
if (N2Filesystem::existsFile($file)) {
return true;
}
return false;
}
示例4: makeCache
public function makeCache($fileName, $hash, $callable)
{
$variations = 1;
if (N2Filesystem::existsFile($this->getManifestFilePath('variations'))) {
$variations = intval(N2Filesystem::readFile($this->getManifestFilePath('variations')));
}
return parent::makeCache($fileName . mt_rand(1, $variations), $hash, $callable);
}
示例5: clean
public function clean($fileName)
{
if (N2Filesystem::existsFile($this->getManifestFilePath($fileName))) {
unlink($this->getManifestFilePath($fileName));
}
if (N2Filesystem::existsFile($this->getStorageFilePath($fileName))) {
unlink($this->getStorageFilePath($fileName));
}
}
示例6: loadXMLFile
function loadXMLFile($file)
{
if (!N2Filesystem::existsFile($file)) {
echo "xml file not found ('{$file}')! <br /><strong>" . __FILE__ . ":" . __LINE__ . "</strong>";
n2_exit(true);
//throw new Exception("xml file not found ('{$file}')! <br /><strong>" . __FILE__ . ":" . __LINE__."</strong>");
}
// @fix Warning: simplexml_load_file(): I/O warning : failed to load external entity
$this->_xml = simplexml_load_string(file_get_contents($file));
$this->_xmlfile = $file;
$this->xmlFolder = dirname($file);
}
示例7: render
public function render($params = array(), $layoutName = false)
{
$controller = strtolower($this->appType->controllerName);
$path = $this->appType->path . NDS . "views" . NDS . $controller . NDS;
$call = false;
if (N2Filesystem::existsFile($path . NDS . "_view.php")) {
require_once $path . NDS . "_view.php";
$call = array("class" => "N2{$this->appType->app->name}{$this->appType->type}{$controller}View", "method" => $this->appType->actionName);
$this->viewObject = $this->preCall($call, $this->appType);
}
if ($layoutName) {
$this->renderLayout($layoutName, $params);
}
}
示例8: editForm
/**
* @param array $data
*/
private function editForm($data = array())
{
$this->simpleEditForm($data);
$slidersModel = new N2SmartsliderSlidersModel();
$slider = $slidersModel->get(N2Request::getInt('sliderid', 0));
$slidersSliderXml = call_user_func(array('N2SSPluginType' . $slider['type'], "getPath")) . '/slide.xml';
if ((!isset($data['static-slide']) || $data['static-slide'] != 1) && N2Filesystem::existsFile($slidersSliderXml)) {
$form = new N2Form();
$form->loadArray($data);
$form->loadXMLFile($slidersSliderXml);
echo $form->render('slide');
}
if (isset($data['generator_id']) && $data['generator_id'] > 0) {
$form = new N2Form();
$form->loadArray($data);
$form->loadXMLFile(dirname(__FILE__) . '/forms/slide_generator.xml');
echo $form->render('slide');
}
N2JS::addFirstCode("new NextendForm('smartslider-form','', {});");
}