Elgg  Version 3.0
SettingsMigrator.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Config;
4 
5 use Elgg\Database;
6 
12 abstract class SettingsMigrator {
13 
17  protected $db;
18 
22  protected $settings_path;
23 
32  public function __construct(Database $db, $settings_path) {
33  $this->db = $db;
34  $this->settings_path = $settings_path;
35  }
36 
43  protected function append($bytes) {
44  $result = file_put_contents($this->settings_path, $bytes, FILE_APPEND | LOCK_EX);
45  if ($result === false) {
46  return false;
47  }
48 
49  return true;
50  }
51 
58  abstract public function migrate();
59 }
migrate()
Attempt to read the setting from the database and update the settings file Returns the value found in...
Migrates DB values to settings.php.
append($bytes)
Write bytes to settings files.
__construct(Database $db, $settings_path)
Constructor.