Beispiel #1
0
      
    </div>
    
    <footer>
      <hr />
      <div class="container">
        <p>
          <a href="http://sourcebans.net" target="_blank"><img alt="SourceBans" src="<?php 
echo Yii::app()->theme->baseUrl;
?>
/images/logo_footer.png" /></a>
          <br /><strong><?php 
echo Yii::t('sourcebans', 'Version');
?>
 <?php 
echo SourceBans::getVersion();
?>
</strong>
          <br />"<?php 
echo SourceBans::app()->quote->text;
?>
" - <em><?php 
echo SourceBans::app()->quote->name;
?>
</em>
        </p>
<?php 
if (YII_DEBUG) {
    ?>
        <p><em><?php 
    echo Yii::app()->db->stats[0];
Beispiel #2
0
 /**
  * Execute the action.
  * @param array command line parameters specific for this command
  */
 public function run($args)
 {
     $this->appOptions = array('fileTypes' => array('php'), 'exclude' => array('.svn', '/yiic.php', '/commands/docs', '/commands/DocsCommand', '/config', '/controllers', '/data', '/extensions', '/messages', '/migrations', '/modules', '/plugins', '/tests', '/vendors', '/views'));
     $this->yiiOptions = array('fileTypes' => array('php'), 'exclude' => array('.svn', '/yiilite.php', '/yiit.php', '/cli', '/i18n/data', '/messages', '/vendors', '/views', '/web/js', '/web/widgets/views', '/utils/mimeTypes.php', '/gii/assets', '/gii/components', '/gii/controllers', '/gii/generators', '/gii/models', '/gii/views', '/test'));
     if (!isset($args[0])) {
         $this->usageError('the output directory is not specified.');
     }
     if ($args[0] == 'check') {
         $checkFiles = CFileHelper::findFiles(BUILD_PATH, $this->appOptions);
         $model = new DocsModel();
         $model->check($checkFiles);
         exit;
     }
     if (!is_dir($docPath = $args[0])) {
         $this->usageError("the output directory {$docPath} does not exist.");
     }
     if (isset($args[1]) && $args[1] == "noviews") {
         $this->enableViews = false;
     }
     $offline = true;
     if (isset($args[1]) && $args[1] === 'online') {
         $offline = false;
     }
     $this->version = SourceBans::getVersion();
     /*
      * development version - link to trunk
      * release version link to tags
      */
     if (substr($this->version, -3) == 'dev') {
         $this->baseSourceUrl .= '/master/web/application';
     } else {
         $this->baseSourceUrl .= '/' . $this->version . '/web/application';
     }
     if (substr(Yii::getVersion(), -3) == 'dev') {
         $this->frameworkSourceUrl .= '/master/framework';
     } else {
         $this->frameworkSourceUrl .= '/' . Yii::getVersion() . '/framework';
     }
     $this->pageTitle = 'API « ' . Yii::app()->name;
     $themePath = dirname(__FILE__) . '/docs';
     echo "\nBuilding.. : " . Yii::app()->name . "\n";
     echo "Type...... : " . ($offline ? "offline" : "online") . "\n";
     echo "Version... : " . $this->version . " (using Yii " . Yii::getVersion() . ")\n";
     echo "Source URL : " . $this->baseSourceUrl . "\n\n";
     echo "Building model...\n";
     $model = $this->buildModel(BUILD_PATH);
     $this->classes = $model->classes;
     $this->packages = $model->packages;
     $this->views = $model->views;
     echo "Building pages...\n";
     if ($offline) {
         $this->buildOfflinePages($docPath . DIRECTORY_SEPARATOR . 'api', $themePath);
     } else {
         $this->buildOnlinePages($docPath . DIRECTORY_SEPARATOR . 'api', $themePath);
         $this->buildKeywords($docPath);
         $this->buildPackages($docPath);
     }
     echo "Done.\n\n";
 }
Beispiel #3
0
 public function actionVersion()
 {
     $version = @file_get_contents('http://www.sourcebans.net/public/versionchecker/?type=rel');
     if (empty($version) || strlen($version) > 8) {
         Yii::app()->end(CJSON::encode(array('error' => Yii::t('sourcebans', 'controllers.admin.version.error'))));
     }
     Yii::app()->end(CJSON::encode(array('version' => $version, 'update' => version_compare($version, SourceBans::getVersion()) > 0)));
 }