Teodorih / yii-user

Automatically exported from code.google.com/p/yii-user
0 stars 0 forks source link

how to run using Command Prompt? #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.How this can be implement trough command prompt.
2.I have done it using command prompt but the error show below occurs every 
time. Please help me by giving some instructions about how to customize it.

What is the expected output? What do you see instead?

CDbException
Description

The table "{{users}}" for active record class "User" cannot be found in the 
database.
Source File

C:\xampp\htdocs\yii\framework\db\ar\CActiveRecord.php(1930)

01918:     private $_model;
01919: 
01920:     /**
01921:      * Constructor.
01922:      * @param CActiveRecord the model instance
01923:      */
01924:     public function __construct($model)
01925:     {
01926:         $this->_model=$model;
01927: 
01928:         $tableName=$model->tableName();
01929:         if(($table=$model->getDbConnection()->getSchema()-
>getTable($tableName))===null)
01930: throw new CDbException(Yii::t('yii','The table "{table}" for active 
record class "{class}" cannot be found in the database.',
01931:                 
array('{class}'=>get_class($model),'{table}'=>$tableName)));
01932:         if($table->primaryKey===null)
01933:             $table->primaryKey=$model->primaryKey();
01934:         $this->tableSchema=$table;
01935:         $this->columns=$table->columns;
01936: 
01937:         foreach($table->columns as $name=>$column)
01938:         {
01939:             if(!$column->isPrimaryKey && $column-
>defaultValue!==null)
01940:                 $this->attributeDefaults[$name]=$column-
>defaultValue;
01941:         }
01942: 

Stack Trace

#0 C:\xampp\htdocs\yii\framework\db\ar\CActiveRecord.php(328): 
CActiveRecordMetaData->__construct(Object(User))
#1 C:\xampp\htdocs\yii\register\protected\models\User.php(41): 
CActiveRecord::model('User')
#2 C:\xampp\htdocs\yii\register\protected\models\User.php(160): 
User::model()
#3 
C:\xampp\htdocs\yii\register\protected\controllers\UserController.php(39): 
User->getAdmins()
#4 C:\xampp\htdocs\yii\framework\web\CController.php(982): UserController-
>accessRules()
#5 C:\xampp\htdocs\yii\framework\web\filters\CInlineFilter.php(59): 
CController->filterAccessControl(Object(CFilterChain))
#6 C:\xampp\htdocs\yii\framework\web\filters\CFilterChain.php(126): 
CInlineFilter->filter(Object(CFilterChain))
#7 C:\xampp\htdocs\yii\framework\web\CController.php(283): CFilterChain-
>run()
#8 C:\xampp\htdocs\yii\framework\web\CController.php(257): CController-
>runActionWithFilters(Object(CInlineAction), Array)
#9 C:\xampp\htdocs\yii\framework\web\CWebApplication.php(320): CController-
>run('profile')
#10 C:\xampp\htdocs\yii\framework\web\CWebApplication.php(120): 
CWebApplication->runController('user/profile')
#11 C:\xampp\htdocs\yii\framework\base\CApplication.php(135): 
CWebApplication->processRequest()
#12 C:\xampp\htdocs\yii\register\index.php(11): CApplication->run()
#13 {main}

2010-02-25 11:48:36 Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 
OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0 
Yii Framework/1.1.0

What version of the product are you using? On what operating system?

OS- Windows XP, Product- yii-user-0.1.1(http://code.google.com/p/yii-
user/downloads/list) --- featured version 

Please provide any additional information below.

Original issue reported on code.google.com by rejeesh....@gmail.com on 25 Feb 2010 at 6:19

GoogleCodeExporter commented 8 years ago
Insert 'tablePrefix' => 'tbl_' to db configuration (protected/config/main.php)

'db'=>array(
    ...
    'tablePrefix' => 'tbl_',
),

Original comment by mish...@gmail.com on 25 Feb 2010 at 9:06

GoogleCodeExporter commented 8 years ago
Now also its not working.. Please help me..

I made changes in (protected/config/main.php) as

replaced UserIdentity.php  and 

// application components
    'components'=>array(
                'User'=>array(
                        'class' => 'User',
                        'hash' => 'md5',                                     # 
encrypting method (php hash function)
                        'sendActivationMail' => true,                        # send 
activation email
                        'loginNotActiv' => false,                            # allow 
access for non-activated users
                        'autoLogin' => true,                                 # 
automatically login from registration
                        'registrationUrl' => array('user/registration'),     # 
registration path
                        'recoveryUrl' => array('user/recovery'),             # 
recovery password path
                        'loginUrl' => array('user/login'),                   # login 
form path
                        'returnUrl' => array('user/profile'),                # page 
after login
                        'returnLogoutUrl' => array('user/login'),            # page 
after logout
                ),
        /*'db'=>array(
            'connectionString' => 'sqlite:protected/data/testdrive.db',
        ),
        // uncomment the following to use a MySQL database
        */
        'db'=>array(
            'connectionString' => 'mysql:host=localhost;dbname=pmanager',
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => '',
            'charset' => 'utf8',
            'tablePrefix' => 'tbl_',
        ),

Controller, Model and View files were created by using Command prompt for User, 
Profile and ProfileField ..
After that replaced the files with corresponding given 
files(http://code.google.com/p/yii-user/downloads/list) --(featured version)

But still getting error.... I am attaching the entire files one second.. Please 
help 
me to fix the error... I am trying to study Yii Framework... Its looks very 
nice @ my 
first site... But I need to implement some extensions for my future 
applications.

Regards,
Rejeesh 

Original comment by rejeesh....@gmail.com on 25 Feb 2010 at 10:23

Attachments:

GoogleCodeExporter commented 8 years ago
You do not replace the files!
To install just create a new project and then copy the files from the archive, 
replacing UserIdentity.php (used 
command prompt  does not require)

Original comment by mish...@gmail.com on 25 Feb 2010 at 1:29

GoogleCodeExporter commented 8 years ago
Dear mishamx,

Thank you very much... I have fixed the error... anyway its a great work...

Regards,
Rejeesh 

Original comment by rejeesh....@gmail.com on 26 Feb 2010 at 3:32