Esempio n. 1
0
 /**
  * Usage (from command line):
  *
  * php oil r setupassets:less
  *
  * @return string
  */
 public static function less()
 {
     try {
         $result_message = self::compile_less();
     } catch (\FuelException $e) {
         return \Util_Task::output_message(sprintf('Compile less error: %s', $e->getMessage()), false);
     }
     return \Util_Task::output_result_message(true, $result_message);
 }
Esempio n. 2
0
 /**
  * Usage (from command line):
  *
  * php oil r setupfiles:htaccess
  *
  * @return string
  */
 public static function update_htaccess()
 {
     try {
         $result = self::change_rewrite_base();
     } catch (\FuelException $e) {
         return \Util_Task::output_message($e->getMessage(), false);
     }
     return \Util_Task::output_result_message($result, __FUNCTION__, 'Update .htaccess');
 }
Esempio n. 3
0
 /**
  * Usage (from command line):
  *
  * php oil r setupmodule
  *
  * @return string
  */
 public static function run($target_module = null)
 {
     $is_execued = false;
     try {
         $modules = $target_module ? (array) $target_module : \Module::loaded();
         if (!$modules) {
             return;
         }
         foreach ($modules as $module => $module_dir_path) {
             if ($messages = self::setup_assets($module, $module_dir_path)) {
                 foreach ($messages as $message) {
                     echo $message . PHP_EOL;
                 }
                 $is_execued = true;
             }
         }
     } catch (\FuelException $e) {
         return \Util_Task::output_message(sprintf('Setup modules error: %s', $e->getMessage()), false);
     }
     return $is_execued ? \Util_Task::output_result_message(true, 'setup modules') : '';
 }
Esempio n. 4
0
 /**
  * Usage (from command line):
  *
  * php oil r setupdb:drop
  *
  * @return string
  */
 public static function insert_default_data()
 {
     \Config::load('db_fixture', 'db_fixture');
     try {
         $db_fixtures = \Config::get('db_fixture');
         $result = self::load_fixtures($db_fixtures);
     } catch (\FuelException $e) {
         return \Util_Task::output_message(sprintf('Insert default data error: %s', $e->getMessage()), false);
     }
     return \Util_Task::output_result_message($result, __FUNCTION__ . ' db', 'Insert default data.');
 }
Esempio n. 5
0
 /**
  * Usage (from command line):
  *
  * php oil r filecleaner:clean_cache
  *
  * @return string
  */
 public static function clean_cache()
 {
     try {
         \Cache::delete_all();
     } catch (\FuelException $e) {
         return \Util_Task::output_message(sprintf('%s error: %s', __FUNCTION__, $e->getMessage()), false);
     }
     return \Util_Task::output_result_message(true, __FUNCTION__, 'Delete all caches.');
 }