02.19
php
saved
dardosordi
Note
stores data in a config file
stores data in a config file
- {
- $content = '';
- foreach ($data as $key => $value) {
- $content .= "\$config['$name']['$key']";
- $content .= " = array(";
- foreach ($value as $key1 => $value2) {
- $value2 = $this->__formatArray($value2);
- $content .= "'$key1' => $value2, ";
- }
- $content .= "\n);\n";
- } else {
- $value = $value?'true':'false';
- }
- $content .= " = $value;\n";
- }
- }
- $content = "<?php\n".$content."?>";
- uses('File');
- if ($file->open('w')) {
- $file->append($content);
- }
- $file->close();
- if ($read) {
- Configure::load($name);
- }
- }
- return $data?'true':'false';
- }
- }
- return $data;
- }
- $content = " array(";
- foreach ($data as $key => $value) {
- $value = $this->__formatArray($value, $level + 1);
- $content .= "\n$tab'$key' => $value,";
- }
- $content .= "\n$tab)";
- return $content;
- }
Parsed in 0.099 seconds, using GeSHi 1.0.7.14