I have includes all the parameters using the article at http://framework.zend.com/manual/en/zend.http.user-agent.html#zend.http.user-agent.quick-start
but it shows me an exception Unable to resolve plugin "useragent"; no corresponding plugin with that name. My code is :
all configuration in application.ini
resources.useragent.storage.adapter = "Session"
resources.useragent.wurflapi.wurfl_api_version = "1.3.1"
resources.useragent.wurflapi.wurfl_lib_dir = APPLICATION_PATH "/../library/wurfl-php-1.3.1/WURFL/"
resources.useragent.wurflapi.wurfl_config_array.wurfl.main-file = APPLICATION_PATH "/../data/wurfl/wurfl.xml"
resources.useragent.wurflapi.wurfl_config_array.wurfl.patches[] = APPLICATION_PATH "/../data/wurfl/web_browsers_patch.xml"
resources.useragent.wurflapi.wurfl_config_array.persistence.provider = "file"
resources.useragent.wurflapi.wurfl_config_array.persistence.dir.dir = APPLICATION_PATH "/../data/wurfl/cache/"
loaded the files at downloaded from http://sourceforge.net/projects/wurfl/files/WURFL%20PHP/1.1/wurfl-php-1.1.tar.gz/download
version 1.3.1
Root_DIR/library/wurfl-php-1.3.1
and created data folder with application and updated with Root_DIR/data/wurfl
/chache
web_browsers_patch.xml
wurfl.xml
What is i am mising ?? Thanks in advance.
It was due to version problem. i resolved it after updating version of zend library. it supports on zend V 1.11 and above. and after this successful implementation still i am getting an exception like :
Strict Standards: Declaration of Application_Helper_MobileContext::addActionContext() should be compatible with that of Zend_Controller_Action_Helper_ContextSwitch::addActionContext() in /storage/projects/gomotive/application/helpers/MobileContext.php on line 3
But also resolved this by passing default argument value in parent method. check the link below
Declaration of Methods should be Compatible with Parent Methods in PHP
Hi the solutions is include Zend framework into your library folder.I am facing the same problems and by accidentally i include the Zend Framework v1.11 into library and all works well
Related
a code MyController:ModelDrivenControllerBase<EcoProject1EcoSpace> in the mvc or webapi netcore project shows a error "the type 'MDrivenTemplateProj.EcoProject1EcoSpace' cannot be used as type parameter 'ESType' in the generic type or method 'ModelDrivenControllerBase<ESType>'. There is no implicit reference conversion from 'MDrivenTemplateProj.EcoProject1EcoSpace' to 'Eco.Handles.DefaultEcospace" + annoying request to add ref to the 'MDriven.Handles.netStandard, version=7.0.0.0, culture=neutral, publickeytoken=null'. (always version 7.0.0.0!)
Could you please advise how to avoid such kind of errors?
I'm trying to develop the webapi netcore 3.1 app that has ref to MDrivenEcoSpaceAndModelForNetStandard project using the NetFramework 4.x. experience.
Seems that is it wrong way for the netcore project.
Thank you!
Brand new MDriven packages on nuget targeting .netStandard2.1 and .net5 available now.
They have correct build version numbers, and are more granular in packages than the old Eco package.
https://wiki.mdriven.net/index.php/MVC
https://www.nuget.org/packages?q=MDriven*
Old style still valid:
ref to the MDrivenEcoSpaceAndModelForNetStandard project in your netcore webapi
leave ControllerBase as a base class for your MVC controller
create and activate new ecospace in the constructor of your controller
_es = new MDrivenTemplateProj.EcoProject1EcoSpace();_es.Active = true;
you can call CreateFromViewModel method if you want to use VMs, ex.
var vmc = Eco.ViewModel.Runtime.ViewModelHelper.CreateFromViewModel("SampleViewModel", this._es, null, false);
Manual fixes that are still required in MDrivenEcoSpaceAndModelForNetStandard project:
EcoProject1EcoSpace.Designer.cs - this.persistenceMapperSharer1.MapperProviderTypeName auto generated value is incorrect
EcoProject1PMP.Designer.cs - this.EcoSpaceTypeName auto generated value is incorrect
be ready that your build in VS EcoProject modeller will not be able to start persistence after the fixes above. It will show you "No suitable constructor found" message
I have pre-generated views following the templates of the next link:
http://blogs.msdn.com/b/adonet/archive/2008/06/20/how-to-use-a-t4-template-for-view-generation.aspx
I need to improve to Entity Framework 5.0 but if I replace the schemas as following:
stringBuilder.Replace("http://schemas.microsoft.com/ado/2008/09/mapping/cs", "http://schemas.microsoft.com/ado/2009/11/mapping/cs");
stringBuilder.Replace("http://schemas.microsoft.com/ado/2008/09/edm", "http://schemas.microsoft.com/ado/2009/11/edm");
stringBuilder.Replace("http://schemas.microsoft.com/ado/2008/10/edmx","http://schemas.microsoft.com/ado/2009/11/edmx");
stringBuilder.Replace("http://schemas.microsoft.com/ado/2009/02/edm/ssdl", "http://schemas.microsoft.com/ado/2009/11/edm/ssdl");
I still having the following error:
Warning 3 The default target Entity Framework version requires the
edmx schema version 2.0.0.0 or lower. The specified schema is version
3.0.0.0. To avoid this warning specify the target Entity Framework version explicitly. You can do this by using the EdmGen.exe
command-line tool with the targetVersion option, or by including the
targetEntityFrameworkVersion parameter when calling the GenerateCode
method.
Any idea of how to solve this issue using templates?
What is the equivalent of adding /targetversion:4.5 to EdmGen using templates?
I found the solution to my problem...
There was a leading help in the following link:
http://blog.3d-logic.com/2012/05/28/entity-framework-code-first-and-pre-generated-views/
moozzyk says:
August 5, 2012 at 11:51 pm
I did see this when using Visual Studio 2012 and EF5. For now the workaround is to edit the >template. Change the line 70 from:
var errors = viewGenerator.GenerateViews(mappingItemCollection, writer).ToList();
to:
var errors = viewGenerator.GenerateViews(mappingItemCollection, writer, >EntityFrameworkVersions.Version3).ToList();
Sorry for the inconvenience.
I had to slighlty modify my code in a similar way, from:
IList errors = viewGenerator.GenerateViews(mappingItems, writer);
To:
IList errors = viewGenerator.GenerateViews(mappingItems, writer, EntityFrameworkVersions.Version3);
After that, no warning nor error whatsoever.
DomPDF throws the following error, using Zend Framework 1.12.0.
Error
An input file is required (i.e. input_file _GET variable).
However, it works fine using Zend 1.7.0.
Here is the way I've included it in the controller
require_once("dompdf_config.inc.php");
spl_autoload_register('DOMPDF_autoload');
And this is how I instantiate Zend Loader Autoloader in my Bootstrap file
$loader = Zend_Loader_Autoloader::getInstance();
$loader->setFallbackAutoloader(true);
I believe it may be due to autoloading DOMPDF. Any suggestions?
I need to import data from excel,And the I decided to use PHPExcel,But when I require it in my web , a few warnings occured :
Warning:
include_once(PHPExcel\Shared\ZipStreamWrapper.php) [<a href='function.include-once'>function.include-once</a>]:
failed to open stream: No such file or directory in D:\www\LearningCenter\library\Zend\Loader.php on line 146
here is my code.:
public function getUserFromExcel($path){
echo $path;
require_once 'Excel/PHPExcel.php';
echo $path;
}
and my webapp structre is :
library
Zend
Excel
others-thirdpart-library
it seems that there is something wrong with the autoloader.
I read a few articles But did not find a solution.
My final aim is to read date from an excel file:
can some one give me some sugestion on ether how to use phpexcel in zend or how to import data from excel useing zend itself.
thanks
copy the PHPExcel library into your /library directory, the structure should be as follows
/library
/PHPExcel
/PHPExcel.php
and then add this in your application.ini
autoloaderNamespaces[] = "PHPExcel_"
autoloaderNamespaces[] = "PHPExcel"
and it should work.
Add your lib to library folder. (libarary/PHPExcel)
Add new autoloaderNamespaces.phpexcel = "PHPExcel_"
You can use library method using PHPExcel_IOFactory::createReader($inputFileType);
The problem is related to autoload PHPExcel classes.
I suggest to avoid to have problems with autoload PHPExcel classes to use the zf2 module MvlabsPHPExcel that will give you an easy integration of [PHPOffice/PHPExcel][2] library into zend framework 2.
my plugins directory sits in
application
/plugins
Dbcount.php
ModuleLayout.php
i am unable to register the plugin with frontController. here is my application.ini code.
#Plugin path and namespace
pluginPaths.Plugins = APPLICATION_PATH "/plugins"
autoloaderNamespaces[] = "Plugin_"
#register plugin
resources.frontController.plugins[] = "Plugin_DbCount"
it gives me following error.
Warning: include_once(Plugin/DbCount.php) [function.include-once]: failed to open stream: No such file or directory in /Users/azhararmar/htdocs/joofris/v1/library/Zend/Loader.php on line 146
Warning: include_once() [function.include]: Failed opening 'Plugin/DbCount.php' for inclusion (include_path='/Users/azhararmar/htdocs/joofris/v1/application/../library:/Users/azhararmar/htdocs/joofris/v1/library:.:/Applications/MAMP/bin/php5.2/lib/php') in /Users/azhararmar/htdocs/joofris/v1/library/Zend/Loader.php on line 146
Fatal error: Class 'Plugin_DbCount' not found in /Users/azhararmar/htdocs/joofris/v1/library/Zend/Application/Resource/Frontcontroller.php on line 117
what is wrong?
If you are using the default appnamespace Application, then the plugin stored in application/plugins/DbCount.php should be named Application_Plugin_DbCount. Use the full classname when you register:
resources.frontController.plugins[] = "Application_Plugin_DbCount"
To use the namespace like that your Plugin classes need to be under Library or you need to map them else where. Looks like you have the frontcontroller plugin set up right but incorrect autoload definitions.
Easiest thing to do here is to name your plugins YourAppNamespace_Plugin_YourPluginName.
They are two types of plugin in ZF . You are mixing some part of each .
To make your code work do
1) put application dir in include_path
2) change directory name plugins to 'Plugin'