I want compare two text files using zend_frame work mvc pattern model.
How can i do that, it is possible perform this task?
If yes means please provide me some idea about this?
Not sure Zend will do this job.
Let's take a look to Horde_Text_Diff PEAR package.
Related
I am trying to implement some kind of console menu wich has to retrieve a lot of parameters from user in order to build an XML in the end. At every step I need to do some checks on the given parameters but ofcourse those checks are different every step. Is there an easy library that can help me? With easy I mean something that already offers a pattern, I don't want to write thousands lines of codes.
What about one of these modules:
Term::Menus
Getopt::Std
I have saved Zend to a folder on my hosting called httpdocs. From what I've read on other questions, I understand I'm now supposed to add something to the php.ini file, and I know it's supposed to look something like the line below. Is the .;c: standard or would it be different depending on my server? If so, how do I determine what I should have instead?
include_dir = .;c:\httpdocs\ZendGdata-1.11.2\library
Thanks in advance,
John
you are probably referring to the include path, which should be set so zend classes can be correctly loaded.
however i take the guess you are on an shared hosting enviornment where you cant do that.
you can. well you probably could it in htaccess but its unlikely.
you can however do this at runtime using the set_include_path functions
be sure not to loose your old include paths, specially "." which refers to the current directory.
however this is very well explained at zend framework manuals, please red the introduction
and also try to improve your accept rate.
I'm using gettext translation adapter in a Zend Framework projekt. But I'm wondering what's the best practise when naming and placing these translation files within my project?
At first I had APPLICATION_PATH/languages/sv_SE.po (and sv_SE.mo)
But then I read about the auto searching features of Zend Framework and started wondering if it would be better to have the languages in subfolders. But the structure APPLICATION_PATH/languages/sv_SE/sv_SE.po and APPLICATION_PATH/languages/en_US/en_US.po didn't feel quite natural. Using array adapters ect it have felt easier to come up with a good naming conventions... But what is the best practise when it comes to using gettext translations in Zend Framework? Is it most common to have all translations in a single file or should one use something like
APPLICATION_PATH/languages/en_US/admin.po
APPLICATION_PATH/languages/en_US/forms.po
APPLICATION_PATH/languages/en_US/othercrap.po
Feels like this apporach might make it tedious when scaning source for strings to translate since one would have to open several files etc.
I ended up using
APPLICATION_PATH/languages/en_US/admin.po
APPLICATION_PATH/languages/en_US/forms.po
APPLICATION_PATH/languages/en_US/othercrap.po
which has worked fine.
I am quite aware that the extract task accepts application as a parameter, and thus one can't expect it too look into the forms folder.
However, I referred the link (below) and tried a couple of ways:
1. defining my proxy __() method
2. including the I18n helper in App Configuration
However, both aren't working.
Can anyone tell me how to extract these from the form classes?
Thanks
http://groups.google.com/group/symfony-devs/browse_thread/thread/1d034f5f7367fe0c
You need to use the i18n helper and add the translated strings manually to your XML/XLIFF files. The translations themselves work, it's just the i18n:extract task that doesn't look inside form classes so it has to be done manually. I hope they add this feature in Symfony 2.0.
See the first few paragraphs here: http://www.symfony-project.org/forms/1_4/en/08-Internationalisation-and-Localisation
There's a way to extract it altough it's not recommended by the developers:
In lib/i18n/extract/sfI18nApplicationExtract.class.php add:
$this->extractFromPhpFiles(sfConfig::get('sf_lib_dir').'/form');
to function extract()
In your form class's configure method add:
sfLoader::loadHelpers('I18N');
This way you can use the __() function in your form class.
I'm currently testing it. Will share my findings.
I wouldn't use most of the classes from Zend Framework, that's why I'm looking for the thinnest possible ZF configuration.
Is there a better way of finding what I really need other than deleting the whole library/Zend folder, then putting back files based on the error messages that I receive?
I have not used it myself, but http://blog.fedecarg.com/2009/02/01/zend-framework-automatic-dependency-tracking/ may be what you are looking for.
Hm...
There is a lot of information about Zend Framework on SO and with a little bit of reading you would have found the answers to your question
You would also find the answers to your question by just reading the introduction to Zend Framework on the Zend Framework website.
No, that's not how you'll do it. Zend Framework, unlike most/all other PHP frameworks, is rigidly loosely coupled. You can use every component stand-alone. You can only use the loader, or only Zend_Translate. Or you can just use the MVC modules, or Zend_Db, etc.
Of course if you use Zend_Form and want to validate or filter the input, you'll need Zend_Validate and Zend_Filter. But you'll know that because you'll instantiate objects. So just copy into your empty library folder the modules you need. Or even better, copy everything in! A) you won't regret it. B) disk space is not your problem.
What I would do is set up the plugin loader cache and then purge all files apart from the ones called within the automatically generated include file.
zend.loader.pluginloader.performance
I hope it makes sense... :o)