当前位置: 首页>>代码示例>>PHP>>正文


PHP Yii::getVersion方法代码示例

本文整理汇总了PHP中Yii::getVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP Yii::getVersion方法的具体用法?PHP Yii::getVersion怎么用?PHP Yii::getVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Yii的用法示例。


在下文中一共展示了Yii::getVersion方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 /**
  * Execute the action.
  * @param array $args command line parameters specific for this command
  * @return integer non zero application exit code after printing help
  */
 public function run($args)
 {
     $runner = $this->getCommandRunner();
     $commands = $runner->commands;
     if (isset($args[0])) {
         $name = strtolower($args[0]);
     }
     if (!isset($args[0]) || !isset($commands[$name])) {
         if (!empty($commands)) {
             echo "Yii command runner (based on Yii v" . Yii::getVersion() . ")\n";
             echo "Usage: " . $runner->getScriptName() . " <command-name> [parameters...]\n";
             echo "\nThe following commands are available:\n";
             $commandNames = array_keys($commands);
             sort($commandNames);
             echo ' - ' . implode("\n - ", $commandNames);
             echo "\n\nTo see individual command help, use the following:\n";
             echo "   " . $runner->getScriptName() . " help <command-name>\n";
         } else {
             echo "No available commands.\n";
             echo "Please define them under the following directory:\n";
             echo "\t" . Yii::app()->getCommandPath() . "\n";
         }
     } else {
         echo $runner->createCommand($name)->getHelp();
     }
     return 1;
 }
开发者ID:upmunspel,项目名称:abiturient,代码行数:32,代码来源:CHelpCommand.php

示例2: startTool

 /**
  * @return $this
  */
 public function startTool()
 {
     $this->stdoutN('Yii2 (' . \Yii::getVersion() . ')');
     $this->stdoutN(\Yii::$app->cms->moduleCms()->getDescriptor()->toString());
     $this->stdoutN('App:' . \Yii::$app->id);
     $this->hr();
     return $this;
 }
开发者ID:Liv1020,项目名称:cms,代码行数:11,代码来源:Controller.php

示例3: beforeAction

 public function beforeAction($action, $params)
 {
     $path = Yii::getPathOfAlias($this->migrationPath);
     if ($path === false || !is_dir($path)) {
         die('Error: The migration directory does not exist: ' . $this->migrationPath . "\n");
     }
     $this->migrationPath = $path;
     $yiiVersion = Yii::getVersion();
     echo "\nYii Migration Tool v1.0 (based on Yii v{$yiiVersion})\n\n";
     return true;
 }
开发者ID:arduanov,项目名称:eco,代码行数:11,代码来源:MigrateCommand.php

示例4: run

 /**
  * Execute the action.
  * @param array $args command line parameters specific for this command
  */
 public function run($args)
 {
     if (is_file($composerAutoload = __DIR__ . '/../../vendor/autoload.php')) {
         require $composerAutoload;
     }
     $options = array('fileTypes' => array('php'), 'exclude' => array('.gitignore', '/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'));
     if (!isset($args[0])) {
         $this->usageError('the output directory is not specified.');
     }
     if ($args[0] == 'check') {
         $checkFiles = CFileHelper::findFiles(YII_PATH, $options);
         $model = new ApiModel();
         $model->check($checkFiles);
         exit;
     }
     if (!is_dir($docPath = $args[0])) {
         $this->usageError("the output directory {$docPath} does not exist.");
     }
     $offline = true;
     if (isset($args[1]) && $args[1] === 'online') {
         $offline = false;
     }
     $this->version = Yii::getVersion();
     /*
      * development version - link to master
      * release version link to tags
      */
     if (substr($this->version, -3) == 'dev') {
         $this->baseSourceUrl .= '/master/framework';
     } else {
         $this->baseSourceUrl .= '/' . $this->version . '/framework';
     }
     $this->pageTitle = 'Yii Framework Class Reference';
     $themePath = dirname(__FILE__) . '/api';
     echo "\nBuilding.. : " . $this->pageTitle . "\n";
     echo "Type...... : " . ($offline ? "offline" : "online") . "\n";
     echo "Version... : " . $this->version . "\n";
     echo "Source URL : " . $this->baseSourceUrl . "\n\n";
     echo "Building model...\n";
     $model = $this->buildModel(YII_PATH, $options);
     $this->classes = $model->classes;
     $this->packages = $model->packages;
     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";
 }
开发者ID:super-d2,项目名称:codeigniter_demo,代码行数:56,代码来源:ApiCommand.php

示例5: getServiceInfo

 /**
  * Returns basic service info, such as uptime, Yii version, etc. Uses
  * cache to store that information for a minute.
  * 
  * @return string[] Server and software information in :title => :value
  * format.
  * @since 0.1.0
  */
 public function getServiceInfo()
 {
     $cache = \Yii::app()->cacheHelper->get('serviceStatus');
     if (!$cache) {
         $cache = array('yiiVersion' => \Yii::getVersion(), 'twigVersion' => $this->getTwigVersion(), 'phpVersion' => PHP_VERSION, 'os' => php_uname(), 'uptime' => $this->getUptime(), 'serverTime' => date('Y-m-d H:i'));
         \Yii::app()->cacheHelper->set('serviceStatus', $cache, 60);
     }
     foreach ($cache as $key => $value) {
         unset($cache[$key]);
         $cache[\Yii::t('templates', 'status.' . $key)] = $value;
     }
     return $cache;
 }
开发者ID:DavBfr,项目名称:BlogMVC,代码行数:21,代码来源:ApplicationService.php

示例6: beforeAction

 public function beforeAction($action, $params)
 {
     $yiiVersion = Yii::getVersion();
     echo "\nData Patch  Migration Tool v1.0 (based on Yii v{$yiiVersion} Migration Tool)\n\n";
     echo 'Data Patch Migration Table : ' . self::migrationTable . "\n\n";
     echo 'Data Patch Path : ' . $this->dataPatchPath . "\n\n";
     $path = $this->dataPatchPath;
     if ($path === false || !is_dir($path)) {
         echo 'Error: The migration directory does not exist: ' . $this->dataPatchPath . "\n";
         exit(1);
     }
     return parent::beforeAction($action, $params);
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:13,代码来源:DataPatchCommand.php

示例7: getViewFile

 /**
  * Generates the resulting view file path.
  * @param string source view file path
  * @return string resulting view file path
  */
 protected function getViewFile($file)
 {
     if ($this->useRuntimePath) {
         $crc = sprintf('%x', crc32(get_class($this) . Yii::getVersion() . dirname($file)));
         $viewFile = Yii::app()->getRuntimePath() . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . $crc . DIRECTORY_SEPARATOR . basename($file);
         if (!is_file($viewFile)) {
             @mkdir(dirname($viewFile), $this->filePermission, true);
         }
         return $viewFile;
     } else {
         return $file . 'c';
     }
 }
开发者ID:hansenmakangiras,项目名称:yiiframework-cms,代码行数:18,代码来源:CViewRenderer.php

示例8: addPrimaryKey

 public function addPrimaryKey($name, $table, $columns)
 {
     $info = explode('.', Yii::getVersion());
     if ($info[0] == 1 && $info[1] == 1 && $info[2] <= 12) {
         $result = $this->execute("ALTER TABLE {$table} ADD CONSTRAINT {$name} PRIMARY KEY ({$columns})");
         if ($result) {
             return true;
         } else {
             return false;
         }
     } else {
         return parent::addPrimaryKey($name, $table, $columns);
     }
 }
开发者ID:hung5s,项目名称:yap,代码行数:14,代码来源:XMigration.php

示例9: getDbConnection

 /**
  * @return CDbConnection the DB connection instance
  * @throws CException if {@link connectionID} does not point to a valid application component.
  */
 protected function getDbConnection()
 {
     if ($this->_db !== null) {
         return $this->_db;
     } elseif (($id = $this->connectionID) !== null) {
         if (($this->_db = Yii::app()->getComponent($id)) instanceof CDbConnection) {
             return $this->_db;
         } else {
             throw new CException(Yii::t('yii', 'CDbLogRoute.connectionID "{id}" does not point to a valid CDbConnection application component.', array('{id}' => $id)));
         }
     } else {
         $dbFile = Yii::app()->getRuntimePath() . DIRECTORY_SEPARATOR . 'log-' . Yii::getVersion() . '.db';
         return $this->_db = new CDbConnection('sqlite:' . $dbFile);
     }
 }
开发者ID:stan5621,项目名称:eduwind,代码行数:19,代码来源:EwDbLogRoute.php

示例10: beforeAction

 public function beforeAction($action, $params)
 {
     $tablePrefix = Yii::app()->getDb()->tablePrefix;
     if ($tablePrefix != '') {
         $this->migrationTable = $tablePrefix . $this->migrationTable;
     }
     $path = Yii::getPathOfAlias($this->migrationPath);
     if ($path === false || !is_dir($path)) {
         echo 'Error: The migration directory does not exist: ' . $this->migrationPath . "\n";
         exit(1);
     }
     $this->migrationPath = $path;
     $yiiVersion = Yii::getVersion();
     echo "\nYii Migration Tool v1.0 (based on Yii v{$yiiVersion})\n\n";
     return parent::beforeAction($action, $params);
 }
开发者ID:mafiu,项目名称:listapp,代码行数:16,代码来源:MigrateCommand.php

示例11: actionIndex

 public function actionIndex()
 {
     Yii::import("application.extensions.payment.alipayNotify", true);
     $alipaySubmit = new alipayNotify();
     $html_text = $alipaySubmit->buildRequestHttp(aaa);
     $this->render('/test/index');
     exit;
     echo "<pre>";
     $list = ProductAttributes::model()->findAllByAttributes(array('id' => 2));
     User::find()->where('status=:status', [':status' => User::STATUS_ACTIVATED])->indexBy('id')->all();
     $zine_ids = array(1, 2, 3);
     $list = Yii::app()->byguitar->createCommand()->select('*')->from('bg_zine')->where('id in (' . implode(',', $zine_ids) . ')')->queryAll();
     print_r($list);
     exit;
     echo "this is a test page <br>";
     echo Yii::getVersion();
     exit;
 }
开发者ID:conghua1013,项目名称:yii,代码行数:18,代码来源:TestController.php

示例12: save

	public function save()
	{
		return array(
			'phpVersion' => PHP_VERSION,
			'yiiVersion' => Yii::getVersion(),
			'application' => array(
				'yii' => Yii::getVersion(),
				'name' => Yii::app()->name,
				'timezone' => Yii::app()->getTimeZone(),
				'debug' => YII_DEBUG,
			),
			'php' => array(
				'version' => PHP_VERSION,
				'xdebug' => extension_loaded('xdebug'),
				'apc' => extension_loaded('apc'),
				'memcache' => extension_loaded('memcache'),
			),
		);
	}
开发者ID:Vladimirtishenko,项目名称:garmata.tv,代码行数:19,代码来源:Yii2ConfigPanel.php

示例13: getVersionInfo

 /**
  * Returns server version information.
  * If the application is in production mode, empty string is returned.
  * @return string server version information. Empty if in production mode.
  */
 protected function getVersionInfo()
 {
     if (YII_DEBUG) {
         $version = '<a href="http://www.yiiframework.com/">Yii Framework</a>/' . Yii::getVersion();
         if (isset($_SERVER['SERVER_SOFTWARE'])) {
             $version = $_SERVER['SERVER_SOFTWARE'] . ' ' . $version;
         }
     } else {
         $version = '';
     }
     return $version;
 }
开发者ID:upmunspel,项目名称:abiturient,代码行数:17,代码来源:CErrorHandler.php

示例14: getInfo

 public static function getInfo($data, $config = null)
 {
     parent::getInfo($data, $config);
     $result = array();
     $result['title'] = 'Yii ver: ' . Yii::getVersion();
     $result['headinfo'] = self::getHeadInfo();
     $result['panelTitle'] = 'Configuration';
     $result['content'] = self::formatArrayAsHtml('globals', self::globalsAsArray(), true);
     $result['content'] .= self::formatArrayAsHtml('session', self::sessionAsArray(), true);
     $result['content'] .= self::formatArrayAsHtml('php', self::phpInfoAsArray(), true);
     $result['content'] .= self::formatArrayAsHtml('request', self::requestAsArray(), true);
     $result['content'] .= self::formatArrayAsHtml('Yii::app()', self::YiiAppAsArray(), true);
     $result['content'] .= self::formatArrayAsHtml('WebdebugToolbar', self::$_config, true);
     return $result;
 }
开发者ID:nassimrehali,项目名称:yiisite,代码行数:15,代码来源:XWebDebugRouter.php

示例15: beforeAction

 public function beforeAction($action, $params)
 {
     $path = Yii::getPathOfAlias($this->migrationPath);
     if ($path === false || !is_dir($path)) {
         echo 'Error: The migration directory does not exist: ' . $this->migrationPath . "\n";
         exit(1);
     }
     $this->migrationPath = $path;
     $yiiVersion = Yii::getVersion();
     echo "\nYii Migration Tool for MongoYii v1.0 (based on Yii v{$yiiVersion})\n\n";
     return CConsoleCommand::beforeAction($action, $params);
 }
开发者ID:pvassiliou,项目名称:MongoYii,代码行数:12,代码来源:EMigrateMongoCommand.php


注:本文中的Yii::getVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。