Exemplo n.º 1
0
 /**
  * Konstruktor
  * @param string $filename Dateiname
  * @param string $filepath Dateipfad
  * @param string $content Dateiinhalt
  */
 public function __construct($filename = '', $filepath = '', $content = '')
 {
     $filename = 'rev' . $filename . '.php';
     parent::__construct($filename, $filepath, $content);
     if ($this->exists() && !$this->content) {
         $this->init();
     }
 }
Exemplo n.º 2
0
 /**
  * Konstruktor
  * @param string $filename Dateiname
  * @param string $filepath Dateipfad
  * @param string $content Dateiinhalt
  * @param bool $initDB Datenbank-Eintrag initialisieren
  * @param bool $forceInit Initialisierung erzwingen
  */
 public function __construct($filename = '', $filepath = '', $content = '')
 {
     if (!$filepath) {
         $filepath = \fpcm\classes\baseconfig::$dbdumpDir;
     }
     parent::__construct($filename, $filepath, $content);
     if (!$this->exists()) {
         return false;
     }
     $finfo = new \finfo(FILEINFO_MIME_TYPE);
     $this->mimetype = $finfo->file($this->fullpath);
 }
Exemplo n.º 3
0
 /**
  * Datei-Inhalt zurückgeben
  * @return string
  */
 public function getContent()
 {
     return strip_tags(parent::getContent(), $this->getAllowedTags());
 }
Exemplo n.º 4
0
 /**
  * Konstruktor
  * @param string $filename Dateiname
  * @param string $content Dateiinhalt
  */
 public function __construct($filename = '', $content = '')
 {
     parent::__construct(md5($filename) . '.tmp', \fpcm\classes\baseconfig::$tempDir, $content);
     $this->init();
 }
Exemplo n.º 5
0
 /**
  * initialisiert Bild-Objekt
  * @param bool $initDB
  * @return boolean
  */
 protected function init($initDB)
 {
     if ($initDB) {
         $dbData = $this->dbcon->fetch($this->dbcon->select($this->table, 'id, smileycode, filename', "smileycode " . $this->dbcon->dbLike() . " ?", array($this->smileycode)));
         if (!$dbData) {
             return false;
         }
         foreach ($dbData as $key => $value) {
             $this->{$key} = $value;
         }
     }
     if (parent::exists()) {
         $fileData = getimagesize($this->fullpath);
         if (is_array($fileData)) {
             $this->width = $fileData[0];
             $this->height = $fileData[1];
             $this->whstring = $fileData[3];
             $this->mimetype = $fileData['mime'];
         }
     }
 }
Exemplo n.º 6
0
 /**
  * initialisiert Bild-Objekt
  * @param bool $initDB
  * @return boolean
  */
 protected function init($initDB)
 {
     if ($initDB) {
         $dbData = $this->dbcon->fetch($this->dbcon->select($this->table, '*', 'filename = ?', array($this->filename)));
         if (!$dbData) {
             return false;
         }
         foreach ($dbData as $key => $value) {
             $this->{$key} = $value;
         }
     }
     $ext = pathinfo($this->fullpath, PATHINFO_EXTENSION);
     $this->extension = $ext ? $ext : '';
     $this->filesize = filesize($this->fullpath);
     if (parent::exists()) {
         $fileData = getimagesize($this->fullpath);
         if (is_array($fileData)) {
             $this->width = $fileData[0];
             $this->height = $fileData[1];
             $this->whstring = $fileData[3];
             $this->mimetype = $fileData['mime'];
         }
     }
 }
Exemplo n.º 7
0
 /**
  * Konstruktor
  * @param string $filename Dateiname
  * @param string $filepath Dateipfad
  * @param string $content Dateiinhalt
  * @param bool $initDB Datenbank-Eintrag initialisieren
  * @param bool $forceInit Initialisierung erzwingen
  */
 public function __construct($filename = '', $filepath = '', $content = '')
 {
     parent::__construct($filename, \fpcm\classes\baseconfig::$articleTemplatesDir . $filepath, $content);
 }