Beispiel #1
0
 public function next()
 {
     $num = $this->di->getFileContents(false);
     $num = is_inumeric($num) ? 1 * $num + $this->step : null;
     $num = is_integer($num) && $num <= $this->max ? $num : $this->min;
     $this->di->putToFile($num);
     return $num;
 }
Beispiel #2
0
 /**
  * Сохраняет глобальные настройки в Globals.php
  */
 public function save2file()
 {
     if (!$this->hasModified()) {
         return;
         //--- Нет модифицированных свойств
     }
     $content = $this->getPhpFileContents();
     check_condition($this->FileMtime === $this->DI->getModificationTime(), 'Файл глобальных настроек был изменён с момента загрузки');
     $this->DI->putToFile($content);
     $this->FileMtimeUpdate();
     //"Коммитим" настройки
     /* @var $prop PsGlobalProp */
     foreach ($this->GLOBALS as $prop) {
         $prop->commit();
     }
 }
Beispiel #3
0
 public function save($content, $mtime)
 {
     check_condition($this->isCanSave($mtime), $this->di->getNameNoExt() . ' был изменён с момента открытия');
     $this->di->putToFile($content);
 }