コード例 #1
0
 private function add_sys_cmd_checks()
 {
     $cmds_cache_path = Util::normalize_path($this->get('CACHE_PRV_PATH') . '/cmds.json', false);
     $cmds = Json::load($cmds_cache_path);
     if (sizeof($cmds) === 0 || $this->refresh) {
         $cmds['command'] = Util::exec_0('command -v command');
         $cmds['which'] = Util::exec_0('which which');
         $cmd = false;
         if ($cmds['command']) {
             $cmd = 'command -v';
         } else {
             if ($cmds['which']) {
                 $cmd = 'which';
             }
         }
         foreach (['avconv', 'convert', 'du', 'ffmpeg', 'gm', 'tar', 'zip'] as $c) {
             $cmds[$c] = $cmd !== false && Util::exec_0($cmd . ' ' . $c);
         }
         Json::save($cmds_cache_path, $cmds);
     }
     foreach ($cmds as $c => $has) {
         $this->set('HAS_CMD_' . strtoupper($c), $has);
     }
 }
コード例 #2
0
ファイル: class-context.php プロジェクト: Txuritan/h5ai
 public function get_l10n($iso_codes)
 {
     $results = [];
     foreach ($iso_codes as $iso_code) {
         $file = $this->setup->get('CONF_PATH') . '/l10n/' . $iso_code . '.json';
         $results[$iso_code] = Json::load($file);
         $results[$iso_code]['isoCode'] = $iso_code;
     }
     return $results;
 }