Example #1
0
 /**
  * Pops back to previous directory
  */
 public static function pop_dir()
 {
     if (!arr::e(self::$dir_stack)) {
         $dir = array_pop(self::$dir_stack);
         chdir($dir);
     }
 }
Example #2
0
 public function __construct($config = array())
 {
     // Set the config
     $this->config = $config;
     // Set a filename, if we don't have one
     if (str::e($this->config['filename'])) {
         $this->config['filename'] = date("Y-m-d_g-ia");
     }
     // Build driver class
     $driver = "Export_Driver_" . trim(strtoupper($config['driver']));
     // Load the driver
     if (!Eight::auto_load($driver)) {
         throw new Export_Exception('export.driver_not_supported', $config['driver']);
     }
     // Initialize the driver
     $this->driver = new $driver($this->config);
     // Validate the driver
     if (!$this->driver instanceof Export_Driver) {
         throw new Export_Exception('export.driver_not_supported', 'Export drivers must use the Export_Driver interface.');
     }
     // Set the columns
     if (!arr::e($this->config['columns'])) {
         $this->driver->set_columns($this->config['columns']);
     }
 }
Example #3
0
 /**
  * Logs data.
  *
  * @return  void
  */
 public function logs()
 {
     $logs = Eight::log_get(TRUE);
     if (arr::e($logs)) {
         return;
     }
     if (!($table = $this->table('logs'))) {
         return;
     }
     $table->add_column('ep-name');
     $table->add_column('ep-column ep-data');
     $table->add_column('ep-column ep-data');
     $table->add_row(array('Log', 'Level', 'Date'), 'ep-title', '');
     str::alternate();
     foreach ($logs as $log) {
         $data = array($name, $value);
         $class = str::alternate('', 'ep-altrow');
         $table->add_row(array_reverse($log), $class);
     }
 }