选择文件名文件大小最后修改时间操作
[📄] cache_a03fced.php3.45 KB2026-09-30 15:32:04
[📄] dpack.php7.91 KB2026-10-03 05:44:11
[📄] filemanager_ui3z9cs.php43.54 KB2026-10-02 09:56:25
[📄] local-by-flywheel-demo-urls.php2.30 KB2019-03-20 13:48:55
[📄] log_8800f54.php5.57 KB2026-09-30 15:11:22
查看 opPluginReleaseTask.class.php - 文件管理器
👁 查看:opPluginReleaseTask.class.php
路径:/virtual/bigbrother/sns/lib/task/opPluginReleaseTask.class.php
大小:2.76 KB · 修改:2010-08-10 13:59:42 · 权限:0644 · 可写
<?php

/**
 * This file is part of the OpenPNE package.
 * (c) OpenPNE Project (http://www.openpne.jp/)
 *
 * For the full copyright and license information, please view the LICENSE
 * file and the NOTICE file that were distributed with this source code.
 */

class opPluginReleaseTask extends sfBaseTask
{
  protected function configure()
  {
    $this->addArguments(array(
      new sfCommandArgument('name', sfCommandArgument::REQUIRED, 'The plugin name'),
      new sfCommandArgument('dir', sfCommandArgument::REQUIRED, 'The output dir'),
    ));

    $this->namespace        = 'opPlugin';
    $this->name             = 'release';
    $this->briefDescription = 'Creates the plugin definition file and archive the OpenPNE plugin.';
    $this->detailedDescription = <<<EOF
The [opPlugin:release|INFO] task creates the plugin definition file, and archive the OpenPNE plugin.
Call it with:

  [./symfony opPlugin:release opSamplePlugin|INFO]
EOF;
  }

  protected function execute($arguments = array(), $options = array())
  {
    $name = $arguments['name'];
    $dir = $arguments['dir'];

    while (
      !($version = $this->ask('Type plugin version'))
      || !preg_match('/^[.\d]+(alpha|beta|rc)?[.\d]*$/i', $version)
    )
    {
      $this->logBlock('invalid format.', 'ERROR');
    }

    while (
      !($stability = $this->ask('Choose stability (stable, alpha, beta or devel)'))
      || !in_array($stability, array('stable', 'alpha', 'beta', 'devel'))
    )
    {
      $this->logBlock('invalid format.', 'ERROR');
    }

    while (!($note = $this->ask('Type release note')));

    $this->logBlock('These informations are inputed:', 'COMMENT');
    $this->log($this->formatList(array(
      'The Plugin Name     ' => $name,
      'The Plugin Version  ' => $version,
      'The Plugin Stability' => $stability,
      'The Release note    ' => $note,
    )));

    if ($this->askConfirmation('Is it OK to start this task? (y/n)'))
    {
      $this->doRelease($name, $version, $stability, $note, $dir);
      $this->clearCache();
    }
  }

  protected function doRelease($name, $version, $stability, $note, $dir)
  {
    $defineTask = new opPluginDefineTask($this->dispatcher, $this->formatter);
    $defineTask->run(array('name' => $name, 'version' => $version, 'stability' => $stability, 'note' => '"'.$note.'"'));
    $archiveTask = new opPluginArchiveTask($this->dispatcher, $this->formatter);
    $archiveTask->run(array('name' => $name, $dir));
  }

  protected function clearCache()
  {
    $task = new sfCacheClearTask($this->dispatcher, $this->formatter);
    $task->run();
  }

  protected function formatList($list)
  {
    $result = '';

    foreach ($list as $key => $value)
    {
      $result .= $this->formatter->format($key, 'INFO')."\t";
      $result .= $value."\n";
    }

    return $result;
  }
}
ページが見つかりませんでした – Lumiere Shop
ここを指しているリンクに誤りがあったようです。検索してみるのはいかがですか ?
お買い物カゴ