A ' '.php is loading automatically with Auto loading method.

Hi Everyone,

A ’ '.php is loading automatically with Auto loading method and I am getting a warning.

include( .php) [<a href=‘function.include’>function.include</a>]: failed to open stream: No such file or directory

How I can prevent this?

Thanks,

Abhay

show us the stack trace :)

I am getting this…

include( .php) [<a href=‘function.include’>function.include</a>]: failed to open stream: No such file or directory

C:\wamp\www\yii_main\framework\YiiBase.php(426)

414 foreach(self::$_includePaths as $path)

415 {

416 echo $classFile=$path.DIRECTORY_SEPARATOR.$className.’.php’;

417 //exit;

418 if(is_file($classFile))

419 {

420 include($classFile);

421 break;

422 }

423 }

424 }

425 else

426 include($className.’.php’);

427 }

428

429 else // class name with namespace in PHP 5.3

430 {

431 $namespace=str_replace(’\\’,’.’,ltrim($className,’\\’));

432 if(($path=self::getPathOfAlias($namespace))!==false)

433 include($path.’.php’);

434 else

435 return false;

436 }

437 return class_exists($className,false) || interface_exists($className,false);

438 }

Stack Trace

#0

  • C:\wamp\www\yii_main\framework\YiiBase.php(426): YiiBase::autoload()

#1

  • C:\wamp\www\yii_main\framework\YiiBase.php(298): YiiBase::autoload(" ")

#2

  • C:\wamp\www\yii_main\framework\validators\CValidator.php(171): YiiBase::import(" ", true)

#3

  • C:\wamp\www\yii_main\framework\base\CModel.php(285): CValidator::createValidator(" ", YumProfile, "firstname", array("message" => " "))

#4

  • C:\wamp\www\yii_main\framework\base\CModel.php(259): CModel->createValidators()

#5

  • C:\wamp\www\yii_main\framework\base\CModel.php(544): CModel->getValidators()

#6

  • C:\wamp\www\yii_main\framework\base\CModel.php(466): CModel->getSafeAttributeNames()

#7

  • C:\wamp\www\yii_main\framework\base\CComponent.php(153): CModel->setAttributes(array("email" => "", "firstname" => "", "lastname" => "", "street" => "", …))

#8

  • C:\wamp\www\yii_main\framework\db\ar\CActiveRecord.php(160): CComponent->__set("attributes", array("email" => "", "firstname" => "", "lastname" => "", "street" => "", …))

#9

– C:\wamp\www\main_project\protected\modules\user\controllers\YumUserController.php(345): CActiveRecord->__set("attributes", array("email" => "", "firstname" => "", "lastname" => "", "street" => "", …))

340 exit;*/

341

342 // exit;

343

344 if (Yum::hasModule(‘profile’) && isset($_POST[‘YumProfile’])){

345 $profile->attributes = $_POST[‘YumProfile’];

346 exit;

347 /* $profile->city = $_POST[‘YumProfile’][‘city’];

348 $profile->firstname = $_POST[‘YumProfile’][‘firstname’];

349 $profile->lastname = $_POST[‘YumProfile’][‘lastname’];

350 $profile->about = $_POST[‘YumProfile’][‘about’];

#10

  • C:\wamp\www\yii_main\framework\web\actions\CInlineAction.php(50): YumUserController->actionCreate()

#11

  • C:\wamp\www\yii_main\framework\web\CController.php(309): CInlineAction->runWithParams(array())

#12

  • C:\wamp\www\yii_main\framework\web\filters\CFilterChain.php(134): CController->runAction(CInlineAction)

#13

  • C:\wamp\www\yii_main\framework\web\filters\CFilter.php(41): CFilterChain->run()

#14

  • C:\wamp\www\yii_main\framework\web\CController.php(1146): CFilter->filter(CFilterChain)

#15

  • C:\wamp\www\yii_main\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(CFilterChain)

#16

  • C:\wamp\www\yii_main\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(CFilterChain)

#17

  • C:\wamp\www\yii_main\framework\web\CController.php(292): CFilterChain->run()

#18

  • C:\wamp\www\yii_main\framework\web\CController.php(266): CController->runActionWithFilters(CInlineAction, array("accessControl"))

#19

  • C:\wamp\www\yii_main\framework\web\CWebApplication.php(276): CController->run("create")

#20

  • C:\wamp\www\yii_main\framework\web\CWebApplication.php(135): CWebApplication->runController("user/user/create")

#21

  • C:\wamp\www\yii_main\framework\base\CApplication.php(162): CWebApplication->processRequest()

#22

– C:\wamp\www\main_project\index.php(14): CApplication->run()

09 defined(‘YII_DEBUG’) or define(‘YII_DEBUG’,true);

10 // specify how many levels of call stack should be shown in each log message

11 defined(‘YII_TRACE_LEVEL’) or define(‘YII_TRACE_LEVEL’,3);

12

13 require_once($yii);

14 Yii::createWebApplication($config)->run();

2012-05-30 10:20:43 Apache/2.2.11 (Win32) PHP/5.3.1 Yii Framework/1.1.9

TOOLBAR

It shows that an error is in the validation rule of YumProfile::firstname.

The following is just a rough guess …

You are using yii-user extension module, but have made some customization and renamed the classes …

from ‘User’ to ‘YumUser’, ‘Profile’ to ‘YumProfile’ and ‘ProfileField’ to ‘YumProfileField’.

Am I right?

If it is the case, you would be better check your ‘YumProfileField’ records. Does your profile definition for ‘firstname’ have a valid content?

Superb…Thanks for your response

You gave me a very good clue to resolve this. When I deleted the 4 fields

firstname , lastname , about and street fields from the ‘profile_field table’

Then application is working properly.

but 1 other thing should be notice.

Same application is working properly with Mysql but those 4 field creating problems with sql server. Table structure are exactly same.

If you can give be any clue then I will solve this problem without changing in my code.

Abhay

Now I got the code which producing the error. ‘CEmailValidator’ validator is set from the database for validating the email address and this is not working properly when I choose Sql server database. But I need this.

Any Clue ???

//View code of fields

if ($field->other_validator)

		{


		//&#036;field-&gt;varname;


		//&#036;field-&gt;other_validator;


		


			&#036;field_rule = array(&#036;field-&gt;varname,


					&#036;field-&gt;other_validator);





			if (&#036;field-&gt;error_message)


				&#036;field_rule['message'] = Yum::t( &#036;field-&gt;error_message);


			array_push(&#036;rules, &#036;field_rule); 


		


	


		}

Thanks

Abhay

Ah, “Yum” stands for yii-user-management … http://www.yiiframework.com/extension/yii-user-management … I didn’t know that.

I’m not sure, but you might have failed to convert the database tables required by Yum.

I think you may be better re-install it from the scratch.