예제 #1
0
파일: Category.php 프로젝트: studio-v/nano
 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;
     }
 }
예제 #2
0
 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);
 }
예제 #3
0
파일: Db.php 프로젝트: studio-v/nano
 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];
 }
예제 #4
0
파일: Browser.php 프로젝트: studio-v/nano
 public function __construct()
 {
     $this->reset();
     $this->determine();
     Nano_Log::message(var_export($this, true));
     Nano_Log::message(var_export($_SERVER, true));
 }
예제 #5
0
파일: LogTest.php 프로젝트: studio-v/nano
 protected function tearDown()
 {
     Nano_Log::clear();
 }
예제 #6
0
파일: WebTest.php 프로젝트: studio-v/nano
 protected function tearDown()
 {
     if ($this->clearDbAfterTest) {
         Nano_Db::clean();
     }
     if ($this->clearLogAfterTest) {
         Nano_Log::clear();
     }
     parent::tearDown();
 }
예제 #7
0
파일: Setting.php 프로젝트: studio-v/nano
 /**
  * @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;
     }
 }
예제 #8
0
파일: String.php 프로젝트: studio-v/nano
 /**
  * @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;
 }