public function testGet() { Nano_Log::message('some string'); self::assertFileExists(Nano_Log::getFile()); self::assertEquals('some string' . PHP_EOL, Nano_Log::get()); Nano_Log::clear(); self::assertEquals('', Nano_Log::get()); }
public static function append($name, $title, $description = null) { try { $category = self::create(__CLASS__, array('name' => $name, 'title' => $title, 'description' => $description, 'order' => self::getNexOrderValue())); $category->save(); self::invalidate(); return true; } catch (PDOException $e) { Nano_Log::message($e); return false; } }
public function saveAction() { $settings = isset($_POST['setting']) ? (array) $_POST['setting'] : array(); Nano_Log::message(var_export($settings, true)); if (empty($settings)) { $this->redirect('/cp/settings'); } foreach ($settings as $category => $options) { foreach ($options as $name => $value) { Setting::set($category, $name, $value); } } $this->redirect('/cp/settings/' . $category); }
public function getCell($query) { Nano_Log::message($query); $row = $this->query($query)->fetch(PDO::FETCH_NUM); Nano_Log::message(var_export($row, true)); return $row[0]; }
public function __construct() { $this->reset(); $this->determine(); Nano_Log::message(var_export($this, true)); Nano_Log::message(var_export($_SERVER, true)); }
/** * @return boolean * @param string $category * @param string $type * @param string $name * @param string $title * @param string $description * @param scalar $default * @param array $values */ public static function append($category, $type, $name, $title, $description = null, $default = null, array $values = array()) { try { $categoryId = Setting_Category::get($category)->setting_category_id; $setting = parent::create(__CLASS__, array('setting_category_id' => $categoryId, 'type' => $type, 'name' => $name, 'value' => null, 'title' => $title, 'description' => $description, 'default' => $default, 'values' => $values ? null : serialize($values), 'order' => self::getNexOrderValue($categoryId))); $setting->save(); return true; } catch (Nano_Exception $e) { Nano_Log::message($e); return false; } }
/** * @return String * @param int width * @param string $break */ public function wrap($width = 80, $break = PHP_EOL) { $this->value = preg_replace('#(\\S{' . $width . ',})#e', "chunk_split('\$1', " . $width . ", '" . $break . "')", $this->value); Nano_Log::message(var_export($this->value, true)); return $this; }