Example #1
0
 public function write($data)
 {
     $path = sprintf("%s/%s", $this->generatedPath, $this->configFilename);
     // Use dirname here in case configFilename contains dir
     $dir = dirname($path);
     if (!is_dir($dir)) {
         mkdir($dir, 0777, true);
     }
     return file_put_contents($path, PhpExporter::export($data, 'Auto generated, any changes will be lost'));
 }
Example #2
0
 public function set()
 {
     $ns = [];
     foreach (array_keys($this->namespaces) as $name) {
         $ns[$name] = true;
     }
     $data = PhpExporter::export($ns);
     $mask = umask(0);
     file_put_contents($this->file, $data);
     umask($mask);
     self::$nsCache[$this->file] = $ns;
 }
Example #3
0
 public function set($data)
 {
     $fileName = $this->getFilename();
     $this->prepare();
     $key = $this->getCacheKey();
     self::$cache[$key] = $data;
     file_put_contents($fileName, PhpExporter::export($data));
     @chmod($fileName, 0666);
     $this->nsCache->set();
     return $data;
 }