Browse Source

updated properties of extensions

tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
8be4f3778a
  1. 2
      build/build
  2. 41
      build/controllers/PhpDocController.php
  3. 2
      extensions/redis/Cache.php
  4. 17
      extensions/sphinx/ActiveRecord.php
  5. 7
      extensions/sphinx/Command.php
  6. 7
      extensions/sphinx/Connection.php
  7. 2
      extensions/sphinx/Query.php
  8. 8
      extensions/sphinx/Schema.php
  9. 4
      extensions/swiftmailer/Mailer.php
  10. 3
      extensions/swiftmailer/Message.php
  11. 14
      framework/yii/db/ActiveRecord.php

2
build/build

@ -11,6 +11,8 @@
// fcgi doesn't have STDIN defined by default // fcgi doesn't have STDIN defined by default
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r')); defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
define('YII_DEBUG', true);
require(__DIR__ . '/../framework/yii/Yii.php'); require(__DIR__ . '/../framework/yii/Yii.php');
$application = new yii\console\Application([ $application = new yii\console\Application([

41
build/controllers/PhpDocController.php

@ -7,6 +7,7 @@
namespace yii\build\controllers; namespace yii\build\controllers;
use Yii;
use yii\console\Controller; use yii\console\Controller;
use yii\helpers\Console; use yii\helpers\Console;
use yii\helpers\FileHelper; use yii\helpers\FileHelper;
@ -40,8 +41,28 @@ class PhpDocController extends Controller
*/ */
public function actionProperty($root = null) public function actionProperty($root = null)
{ {
$except = [];
if ($root === null) { if ($root === null) {
$root = YII_PATH; $root = dirname(dirname(YII_PATH));
Yii::setAlias('@yii/bootstrap', $root . '/extensions/bootstrap');
Yii::setAlias('@yii/debug', $root . '/extensions/debug');
Yii::setAlias('@yii/elasticsearch', $root . '/extensions/elasticsearch');
Yii::setAlias('@yii/gii', $root . '/extensions/gii');
Yii::setAlias('@yii/jui', $root . '/extensions/jui');
Yii::setAlias('@yii/redis', $root . '/extensions/redis');
Yii::setAlias('@yii/smarty', $root . '/extensions/smarty');
Yii::setAlias('@yii/sphinx', $root . '/extensions/sphinx');
Yii::setAlias('@yii/swiftmailer', $root . '/extensions/swiftmailer');
Yii::setAlias('@yii/twig', $root . '/extensions/twig');
$except = [
'/apps/',
'/build/',
'/docs/',
'/extensions/composer/',
'/tests/',
'/vendor/',
];
} }
$root = FileHelper::normalizePath($root); $root = FileHelper::normalizePath($root);
$options = [ $options = [
@ -55,14 +76,13 @@ class PhpDocController extends Controller
return null; return null;
}, },
'only' => ['.php'], 'only' => ['.php'],
'except' => [ 'except' => array_merge($except, [
'BaseYii.php', 'BaseYii.php',
'Yii.php', 'Yii.php',
'/debug/views/', '/views/',
'/requirements/', '/requirements/',
'/gii/views/',
'/gii/generators/', '/gii/generators/',
], ]),
]; ];
$files = FileHelper::findFiles($root, $options); $files = FileHelper::findFiles($root, $options);
$nFilesTotal = 0; $nFilesTotal = 0;
@ -216,21 +236,28 @@ class PhpDocController extends Controller
$ns = $this->match('#\nnamespace (?<name>[\w\\\\]+);\n#', $file); $ns = $this->match('#\nnamespace (?<name>[\w\\\\]+);\n#', $file);
$namespace = reset($ns); $namespace = reset($ns);
$namespace = $namespace['name']; $namespace = $namespace['name'];
$classes = $this->match('#\n(?:abstract )?class (?<name>\w+)( |\n)(extends )?.+\{(?<content>.*)\n\}(\n|$)#', $file); $classes = $this->match('#\n(?:abstract )?class (?<name>\w+)( extends .+)?( implements .+)?\n\{(?<content>.*)\n\}(\n|$)#', $file);
if (count($classes) > 1) { if (count($classes) > 1) {
$this->stderr("[ERR] There should be only one class in a file: $fileName\n", Console::FG_RED); $this->stderr("[ERR] There should be only one class in a file: $fileName\n", Console::FG_RED);
return false; return false;
} }
if (count($classes) < 1) { if (count($classes) < 1) {
$interfaces = $this->match('#\ninterface (?<name>\w+)\n\{(?<content>.+)\n\}(\n|$)#', $file); $interfaces = $this->match('#\ninterface (?<name>\w+)( extends .+)?\n\{(?<content>.+)\n\}(\n|$)#', $file);
if (count($interfaces) == 1) { if (count($interfaces) == 1) {
return false; return false;
} elseif (count($interfaces) > 1) { } elseif (count($interfaces) > 1) {
$this->stderr("[ERR] There should be only one interface in a file: $fileName\n", Console::FG_RED); $this->stderr("[ERR] There should be only one interface in a file: $fileName\n", Console::FG_RED);
} else { } else {
$traits = $this->match('#\ntrait (?<name>\w+)\n\{(?<content>.+)\n\}(\n|$)#', $file);
if (count($traits) == 1) {
return false;
} elseif (count($traits) > 1) {
$this->stderr("[ERR] There should be only one class/trait/interface in a file: $fileName\n", Console::FG_RED);
} else {
$this->stderr("[ERR] No class in file: $fileName\n", Console::FG_RED); $this->stderr("[ERR] No class in file: $fileName\n", Console::FG_RED);
} }
}
return false; return false;
} }

2
extensions/redis/Cache.php

@ -53,8 +53,6 @@ use yii\base\InvalidConfigException;
* ] * ]
* ~~~ * ~~~
* *
* @property Connection $connection The redis connection object. This property is read-only.
*
* @author Carsten Brandt <mail@cebe.cc> * @author Carsten Brandt <mail@cebe.cc>
* @since 2.0 * @since 2.0
*/ */

17
extensions/sphinx/ActiveRecord.php

@ -26,11 +26,16 @@ use Yii;
* read-only. * read-only.
* @property boolean $isNewRecord Whether the record is new and should be inserted when calling [[save()]]. * @property boolean $isNewRecord Whether the record is new and should be inserted when calling [[save()]].
* @property array $oldAttributes The old attribute values (name-value pairs). * @property array $oldAttributes The old attribute values (name-value pairs).
* @property integer $oldPrimaryKey The old primary key value. This property is read-only. * @property mixed $oldPrimaryKey The old primary key value. An array (column name => column value) is
* returned if the primary key is composite. A string is returned otherwise (null will be returned if the key
* value is null). This property is read-only.
* @property array $populatedRelations An array of relation data indexed by relation names. This property is * @property array $populatedRelations An array of relation data indexed by relation names. This property is
* read-only. * read-only.
* @property integer $primaryKey The primary key value. This property is read-only. * @property mixed $primaryKey The primary key value. An array (column name => column value) is returned if
* @property string $snippet current snippet value for this Active Record instance.. * the primary key is composite. A string is returned otherwise (null will be returned if the key value is null).
* This property is read-only.
* @property string $snippet Snippet value.
* @property string $snippetSource Snippet source string. This property is read-only.
* *
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0
@ -1237,6 +1242,9 @@ abstract class ActiveRecord extends Model
* Returns the primary key value. * Returns the primary key value.
* @param boolean $asArray whether to return the primary key value as an array. If true, * @param boolean $asArray whether to return the primary key value as an array. If true,
* the return value will be an array with column names as keys and column values as values. * the return value will be an array with column names as keys and column values as values.
* @property mixed The primary key value. An array (column name => column value) is returned if
* the primary key is composite. A string is returned otherwise (null will be returned if
* the key value is null).
* @return mixed the primary key value. An array (column name => column value) is returned * @return mixed the primary key value. An array (column name => column value) is returned
* if `$asArray` is true. A string is returned otherwise (null will be returned if * if `$asArray` is true. A string is returned otherwise (null will be returned if
* the key value is null). * the key value is null).
@ -1263,6 +1271,9 @@ abstract class ActiveRecord extends Model
* @param boolean $asArray whether to return the primary key value as an array. If true, * @param boolean $asArray whether to return the primary key value as an array. If true,
* the return value will be an array with column name as key and column value as value. * the return value will be an array with column name as key and column value as value.
* If this is false (default), a scalar value will be returned. * If this is false (default), a scalar value will be returned.
* @property mixed The old primary key value. An array (column name => column value) is
* returned if the primary key is composite. A string is returned otherwise (null will be
* returned if the key value is null).
* @return mixed the old primary key value. An array (column name => column value) is returned if * @return mixed the old primary key value. An array (column name => column value) is returned if
* `$asArray` is true. A string is returned otherwise (null will be returned if * `$asArray` is true. A string is returned otherwise (null will be returned if
* the key value is null). * the key value is null).

7
extensions/sphinx/Command.php

@ -39,14 +39,17 @@ use yii\base\NotSupportedException;
* *
* To build SELECT SQL statements, please use [[Query]] and [[QueryBuilder]] instead. * To build SELECT SQL statements, please use [[Query]] and [[QueryBuilder]] instead.
* *
* @property \yii\sphinx\Connection $db the Sphinx connection that this command is associated with.
*
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0
*/ */
class Command extends \yii\db\Command class Command extends \yii\db\Command
{ {
/** /**
* @var \yii\sphinx\Connection the Sphinx connection that this command is associated with.
*/
public $db;
/**
* Creates a batch INSERT command. * Creates a batch INSERT command.
* For example, * For example,
* *

7
extensions/sphinx/Connection.php

@ -47,11 +47,14 @@ use yii\base\NotSupportedException;
* *
* Note: while this class extends "yii\db\Connection" some of its methods are not supported. * Note: while this class extends "yii\db\Connection" some of its methods are not supported.
* *
* @method \yii\sphinx\Schema getSchema() The schema information for this Sphinx connection
* @method \yii\sphinx\QueryBuilder getQueryBuilder() the query builder for this Sphinx connection
*
* @property string $lastInsertID The row ID of the last row inserted, or the last value retrieved from the
* sequence object. This property is read-only.
* @property Schema $schema The schema information for this Sphinx connection. This property is read-only. * @property Schema $schema The schema information for this Sphinx connection. This property is read-only.
* @property \yii\sphinx\QueryBuilder $queryBuilder The query builder for this Sphinx connection. This property is * @property \yii\sphinx\QueryBuilder $queryBuilder The query builder for this Sphinx connection. This property is
* read-only. * read-only.
* @method \yii\sphinx\Schema getSchema() The schema information for this Sphinx connection
* @method \yii\sphinx\QueryBuilder getQueryBuilder() the query builder for this Sphinx connection
* *
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0

2
extensions/sphinx/Query.php

@ -41,6 +41,8 @@ use yii\db\QueryTrait;
* *
* Warning: even if you do not set any query limit, implicit LIMIT 0,20 is present by default! * Warning: even if you do not set any query limit, implicit LIMIT 0,20 is present by default!
* *
* @property Connection $connection Sphinx connection instance.
*
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0
*/ */

8
extensions/sphinx/Schema.php

@ -15,12 +15,12 @@ use yii\caching\GroupDependency;
/** /**
* Schema represents the Sphinx schema information. * Schema represents the Sphinx schema information.
* *
* @property QueryBuilder $queryBuilder The query builder for this connection. This property is read-only.
* @property string[] $indexNames All index names in the Sphinx. This property is read-only. * @property string[] $indexNames All index names in the Sphinx. This property is read-only.
* @property string[] $indexTypes ALL index types in the Sphinx (index name => index type). * @property IndexSchema[] $indexSchemas The metadata for all indexes in the Sphinx. Each array element is an
* This property is read-only.
* @property IndexSchema[] $tableSchemas The metadata for all indexes in the Sphinx. Each array element is an
* instance of [[IndexSchema]] or its child class. This property is read-only. * instance of [[IndexSchema]] or its child class. This property is read-only.
* @property array $indexTypes All index types in the Sphinx in format: index name => index type. This
* property is read-only.
* @property QueryBuilder $queryBuilder The query builder for this connection. This property is read-only.
* *
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0

4
extensions/swiftmailer/Mailer.php

@ -66,6 +66,10 @@ use yii\mail\BaseMailer;
* *
* @see http://swiftmailer.org * @see http://swiftmailer.org
* *
* @property array|\Swift_Mailer $swiftMailer Swift mailer instance or array configuration. This property is
* read-only.
* @property array|\Swift_Transport $transport This property is read-only.
*
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0
*/ */

3
extensions/swiftmailer/Message.php

@ -16,7 +16,8 @@ use yii\mail\BaseMessage;
* @see Mailer * @see Mailer
* *
* @method Mailer getMailer() returns mailer instance. * @method Mailer getMailer() returns mailer instance.
* @property \Swift_Message $swiftMessage vendor message instance. *
* @property \Swift_Message $swiftMessage Swift message instance. This property is read-only.
* *
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0

14
framework/yii/db/ActiveRecord.php

@ -27,13 +27,13 @@ use yii\helpers\Inflector;
* @property boolean $isNewRecord Whether the record is new and should be inserted when calling [[save()]]. * @property boolean $isNewRecord Whether the record is new and should be inserted when calling [[save()]].
* @property array $oldAttributes The old attribute values (name-value pairs). * @property array $oldAttributes The old attribute values (name-value pairs).
* @property mixed $oldPrimaryKey The old primary key value. An array (column name => column value) is * @property mixed $oldPrimaryKey The old primary key value. An array (column name => column value) is
* returned if the primary key is composite or `$asArray` is true. A string is returned otherwise (null will be * returned if the primary key is composite. A string is returned otherwise (null will be returned if the key
* returned if the key value is null). This property is read-only. * value is null). This property is read-only.
* @property array $populatedRelations An array of relation data indexed by relation names. This property is * @property array $populatedRelations An array of relation data indexed by relation names. This property is
* read-only. * read-only.
* @property mixed $primaryKey The primary key value. An array (column name => column value) is returned if * @property mixed $primaryKey The primary key value. An array (column name => column value) is returned if
* the primary key is composite or `$asArray` is true. A string is returned otherwise (null will be returned if * the primary key is composite. A string is returned otherwise (null will be returned if the key value is null).
* the key value is null). This property is read-only. * This property is read-only.
* *
* @author Qiang Xue <qiang.xue@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com>
* @author Carsten Brandt <mail@cebe.cc> * @author Carsten Brandt <mail@cebe.cc>
@ -1192,6 +1192,9 @@ class ActiveRecord extends Model
* @param boolean $asArray whether to return the primary key value as an array. If true, * @param boolean $asArray whether to return the primary key value as an array. If true,
* the return value will be an array with column names as keys and column values as values. * the return value will be an array with column names as keys and column values as values.
* Note that for composite primary keys, an array will always be returned regardless of this parameter value. * Note that for composite primary keys, an array will always be returned regardless of this parameter value.
* @property mixed The primary key value. An array (column name => column value) is returned if
* the primary key is composite. A string is returned otherwise (null will be returned if
* the key value is null).
* @return mixed the primary key value. An array (column name => column value) is returned if the primary key * @return mixed the primary key value. An array (column name => column value) is returned if the primary key
* is composite or `$asArray` is true. A string is returned otherwise (null will be returned if * is composite or `$asArray` is true. A string is returned otherwise (null will be returned if
* the key value is null). * the key value is null).
@ -1218,6 +1221,9 @@ class ActiveRecord extends Model
* @param boolean $asArray whether to return the primary key value as an array. If true, * @param boolean $asArray whether to return the primary key value as an array. If true,
* the return value will be an array with column name as key and column value as value. * the return value will be an array with column name as key and column value as value.
* If this is false (default), a scalar value will be returned for non-composite primary key. * If this is false (default), a scalar value will be returned for non-composite primary key.
* @property mixed The old primary key value. An array (column name => column value) is
* returned if the primary key is composite. A string is returned otherwise (null will be
* returned if the key value is null).
* @return mixed the old primary key value. An array (column name => column value) is returned if the primary key * @return mixed the old primary key value. An array (column name => column value) is returned if the primary key
* is composite or `$asArray` is true. A string is returned otherwise (null will be returned if * is composite or `$asArray` is true. A string is returned otherwise (null will be returned if
* the key value is null). * the key value is null).

Loading…
Cancel
Save