Devuelve la fecha de última modificación de los ficheros de la plantilla activa.

@param $name
@param null $dir
@return \DateTime|null
438658
public function fileExists($name, $dir = null)
    {
//        $this->dump($name . ':' . $dir);
        $reflection = new \ReflectionClass(get_class($this));
        if(($themeBundle = $this->getParam("themeBundle", 'eDemyMainBundle', "eDemyThemeBundle")) !== 'themeBundle') {
            $dir = $this->getBundlePath($themeBundle, true) . '/Resources/views/' . $dir;
        }
        // Si se está ejecutando desde la caché
        if(strpos($reflection->getFileName(), '/cache/')) {
            // subimos hasta el directorio raíz de la aplicación (3 niveles)
            $basedir = dirname($reflection->getFileName()) . '/../../..';
        } else {
            // si no subimos 6 niveles hasta el directorio raíz de la aplicación
            $basedir = dirname($reflection->getFileName()) . '/../../../../../..';
        }
        $fs = new Filesystem();
        //die(var_dump($basedir . $dir . $name));
        //if($fs->exists($basedir . $dir . $name)) {
        if($fs->exists($dir . $name)) {

            return true;
        }

        return false;
    }
708076
private function move($directory, $name = null) {
        if (!is_dir($directory)) {
            if (false === @mkdir($directory, 0777, true)) {
                throw new FileException(sprintf('Unable to create the "%s" directory', $directory));
            }
        } elseif (!is_writable($directory)) {
            throw new FileException(sprintf('Unable to write in the "%s" directory', $directory));
        }

        $target = $directory . (null === $name ? $this->getFileName() : $name);

        if (!@rename($this->prePersistName, $target)) {
            $error = error_get_last();
            throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s)', $this->getPathname(), $target, strip_tags($error['message'])));
        }

        @chmod($target, 0666 & ~umask());

        return new File($target);
    }
766854
protected function allowCreate($dir, $name, $isDir = null) {
		$path = $this->joinPathCE($dir, $name);
		$perm = null;
		
		if ($this->access) {
			$perm = call_user_func($this->access, 'write', $path, $this->options['accessControlData'], $this, $isDir);			
			if ($perm !== null) {
				return !!$perm;
			}
		}
		
		$testPath = $this->separator.$this->relpathCE($path);
		
		for ($i = 0, $c = count($this->attributes); $i < $c; $i++) {
			$attrs = $this->attributes[$i];
			
			if (isset($attrs['write']) && isset($attrs['pattern']) && preg_match($attrs['pattern'], $testPath)) {
				$perm = $attrs['write'];
			} 
		}
		
		return $perm === null ? true : $perm;
	}
181124
public function getAction($name, $need = TRUE)
    {
        return $this->hasActions()
            ? $this->getComponent(Action::ID)->getComponent($name, $need)
            : NULL;
    }
852152
public function moveToDir($dir, $mode=null) {
		if($this->isIn($dir))
			return;
		return $this->rename($dir.'/'.$this->getName(), $mode);
	}
1241762
public function run($id, $name)
    {
        /** @var \bariew\postAbstractModule\models\Item $model */
        $model = $this->controller->findModel($id);
        if ($model->deleteFile($name)) {
            Yii::$app->session->setFlash('success', Yii::t('app', 'File successfully deleted'));
        } else {
            Yii::$app->session->setFlash('error', Yii::t('app', 'File delete error'));
        }
        return $this->controller->redirect(Yii::$app->request->referrer);
    }
249516
public function name($name = null)
    {
        if (func_num_args() > 0) {
            $this->_name = str_replace(DIRECTORY_SEPARATOR, '/', $name);
        }
        return $this->_name;
    }
281490
public function logDir($dir)
    {
        $this->logDir = $dir;

        $this->buildFileLogger($this->logDir);

        return $this;
    }
382061
protected function createNewDirectoryChecker($name, DirectoryResource $resource = null)
    {
        $resource = $resource ?: new DirectoryResource($this->getResource()->getResource().'/'.$name);
        $this->directories[$name] = new NewDirectoryStateChecker($this->getBag(), $resource, $this->getEventsMask());
    }
116503
public static function getNameDate($name)
    {
        $matches = [];
        for ($i = 1; $i <= 12; ++$i) {
            foreach (static::$data[$i] as $day => $values) {
                $values = explode(', ', $values);
                foreach ($values as $value) {
                    $check = mb_stripos($value, $name);
                    if (false !== $check) {
                        $matches[] = [$i, $day, $value, levenshtein($name, $value)];
                    }
                }
            }
        }

        usort(
            $matches,
            function ($a, $b) {
                return $a[3] > $b[3];
            }
        );

        if (0 === count($matches)) {
            return null;
        }

        $date = new \DateTime();
        $date->setDate(date('Y'), $matches[0][0], $matches[0][1]);

        return $date;
    }
448036
public function findActionByName(string $name)
    {
        foreach ($this->actions as $action) {
            if ($action->getAction() === $name) {
                return $action;
            }
        }

        return null;
    }
718026
public function createDir($name = null)
    {
        unlink($dir = $this->createFile());

        if (false === mkdir($dir)) {
            throw FileSystemException::lastError($dir);
        }

        if (null !== $name) {
            $dir .= DIRECTORY_SEPARATOR . $name;

            if (false === mkdir($dir)) {
                throw FileSystemException::lastError($dir);
            }
        }

        return $dir;
    }
352550
protected function uninstallPathes($name, $directory = 'migrations')
    {
        $package = $this->manager->getAvailableExtensions()->findByName($name);

        if ($package === null) {
            return [];
        }

        $basePath = $package->getPath();

        return [
            "{$basePath}/resources/database/{$directory}/",
            "{$basePath}/resources/{$directory}/",
            "{$basePath}/src/{$directory}/",
        ];
    }
542564
protected function getBlock($name = null)
    {
        return ($name == null) ? $this->block : (isset($this->block[$name]) ? $this->block[$name] : false);
    }
685351
public function getDataDefault($name)
    {
        return isset($this->dataDefaults[$name]) ? $this->dataDefaults[$name] : null;
    }
1272962
public function add($name,$dir){
		if ($dir === false)
			$this->request->set_sort($name);
		else
			$this->request->set_sort($name,$dir);
	}
477261
public function createDir($dir)
    {
        $oldMask = umask(0);
        @mkdir($dir, self::PERMISSION, true);
        umask($oldMask);
    }