Fenos\Notifynder\Translator\Compiler::cacheFile PHP Method

cacheFile() public method

Cache the file in json format.
public cacheFile ( array $contents ) : boolean | integer
$contents array
return boolean | integer
    public function cacheFile(array $contents)
    {
        $contents = json_encode($contents);
        return $this->files->put($this->getFilePath(), $contents);
    }

Usage Example

Beispiel #1
0
 /**
  * Get the translations from the
  * array of the config file and it
  * will cache them.
  *
  * @return array
  */
 protected function cacheFromConfig()
 {
     // If is expire then I retrieve directly the array
     $fileTranslation = $this->config->get('notifynder.translations');
     // I put the edited content in the cached file
     $this->compiler->cacheFile($fileTranslation);
     // return the translations
     return $fileTranslation;
 }
All Usage Examples Of Fenos\Notifynder\Translator\Compiler::cacheFile