I tried to implement this(http://web.archive.org/web/20080506155528/http://software.zuavra.net/inline-diff/) with my codeigntier framework but i could not able to implement it.
Anyone if you have implemented this with codeigniter framework then please help me.
Why i could not able to implement:
I run those files seperately(Not with framework) & it worked for me. but while keeping the same files( i.e inline_example.php content) in my COdeigniter controllers then it showed me too many errors like(shown in image) . Then i though this is out of my capacity to implement with codeignter. so i thought to ask here help
i have implemented this library in codeigniter.
To resolve that error you have to replace &new variable to new in all library files of inline diff.
for example :
inline_function.php
$diff = &new Text_Diff($hlines1, $hlines2);
$diff = new Text_Diff($hlines1, $hlines2);
and also change path in unified.php and diff.php
require_once(APPPATH.'libraries/Text/Diff/Renderer.php');
Related
I'm following the CKFinder 2 to 3 upgrade guide and it's not making much sense. In CKFinder 2, the PHP code provided could be used to generate the JS snippet with appropriate config and params, like this:
require_once 'ckfinder/core/ckfinder_php5.php';
$finder = new CKFinder() ;
$finder->SelectFunction = 'ShowFileInfo' ;
$finder->DisableThumbnailSelection = true;
$finder->RememberLastFolder = true;
$finder->Id = $name;
$finder->StartupFolderExpanded = true;
$finder->Width = $width;
$finder->Height = $height;
echo $finder->CreateHtml();
This code picks up the config and incorporates it into the generated JS.
In 3 this seems to have disappeared entirely - the upgrade guide describes the changes needed in config.php, but there is no indication of how this is ever used since there is no other PHP involved, and it says
It is no longer possible to enable CKFinder on a page from the PHP level
All that is shown is how to create the JS snippet, which does not contain any config, and so will use incorrect settings. There is no indication of how the config properties set in config.php ever get to the JS code - as far as I can see there is no connection at all and no mention of any other PHP files, even though some are provided but not documented.
This makes no sense - PHP can quite happily generate HTML and JS that is run on the page, which is all the old CreateHTML function did. I don't understand why there is no mention of this mechanism since it was how we were supposed to use CKFinder previously - it's as if the migration guide is for some unrelated package!
If I update the config file and use the default JS widget code as suggested, it breaks the page completely, altering the MIME output type so it does not get rendered as HTML and appends this error:
{"error":{"number":10,"message":"Invalid command."}}
The docs cover various fine details of what PHP config settings mean, but nowhere that I've found says how it's ever loaded, triggered or associated with the JS. How is this supposed to work?
Indeed the CKFinder 3 documentation was lacking some important information. We're gradually adding new articles there. Based on topics you mentioned I just added:
Explanation how PHP code that worked for CKFinder 2 can be refactored to plain JavaScript in CKFinder 3. Should look familiar ;)
A table with Configuration Options Migration - JavaScript Settings which should help you with discovering again options like rememberLastFolder
I'm using Dreamweaver CS5. I know that code hinting works in Dreamweaver with own functions/classes, but only if the functions file is included one level from main script.
Here an example:
main_script.php
include(my_functions.php)
this work and all functions which included in my_functions.php will hint when I'm editing the main_script.php (strg + space).
Other example:
main_script.php (own functions not available)
include(global_config.php) (own functions available)
include(my_functions.php) (own functions available)
Do you know if there is some trick or fix in other versions of Dreamweaver? If code hinting would work with several included levels that would make work much easier.
I've searched this site and several others but didn't find anybody with nearly the same problem, maybe somebody here can help.
Thankyou for the Editors you suggest me. I just tried out the PHPStorm and this Support codeHinting with several included files in a Project automaticly.
I just found out that Dreamweaver CS5 also Support this, in a bit other way here is a good tutorial Video for this:
http://tv.adobe.com/de/watch/lerne-dreamweaver-cs5/code-hinting-und-phphilfestellungen/
You can config a custome code hinting under "Site" => "SiteSpecific CodeHints"
Better then nothing ;)
Tom
Not sure if it works in dreamweaver but you could try adding a phpdoc eg:
include('global_config.php');
/* #var $functions Functions */
$functions = new Functions();
This assumes your functions are wrapped in a class
I'm trying to use the Tumblr API (PHP) and I cant seem to get all the required files to load correctly.
The Tumblr API can be found here: https://github.com/tumblr/tumblr.php
First thing I found out is that it doesnt include OAuth, so after some searching I found the files on github and uploaded them to my server.
Now it's saying it needs Guzzle. OK, got that uploaded now, but I cant seem to get all the Guzzle files to load up... Example error message:
Interface 'Guzzle\Common\HasDispatcherInterface' not found in /TumblrTest/Guzzle/Common/AbstractHasDispatcher.php
There's a HasDispatcherInterface.php file in that path...
Do the files need to be in a special order? I tried putting all .php files into a folder, and then using require_once I searched for all *.php files in that folder, but that didnt work...
Sorry for a super noob question, any help would be greatly appriciated! Let me know if there's any other info i need to give to help answer this question!
-D
UPDATE: I still have no idea how the above works, but I found a way around it... I actually think it might be easier then figuring the above out!! The following PHP code does what i need it to do, which is grab the posts of the provided user:
$apikey = **[insert api key here]**;
$limit = $_POST['limit'];
$user = $_POST['user'];
$tumblr=$user . ".tumblr.com";
$apidata = json_decode(file_get_contents("http://api.tumblr.com/v2/blog/$tumblr/posts/photo?api_key=$apikey&limit=$limit"));
$mypostsdata = $apidata->response->posts;
$myposts = array();
$j = 0;
foreach($mypostsdata as $postdata) {
$post["photo_url"] = $postdata->photos[0]->original_size->url;
$post["width"] = $postdata->photos[0]->original_size->width;
$post["height"] = $postdata->photos[0]->original_size->height;
$myposts[$j] = $post;
$j++;
}
echo json_encode($myposts);
For some reason I cant get it to pull a list of people i'm following and then get their posts, but oh well...
The tumblr.php Readme might be a bit confusing.
The package depends on other packages. All can be installed via composer.
Go to the http://getcomposer.org and read this carfully, if you are used to the concept, you will start rewriting all you classes to fit the composer dependency manager ;-)
to make it short:
install composer globally and
go into a blank directory and
type in your terminal
composer require tumblr/tumblr
you should get all the classes and the other projects in a dir called vendor.
before you do anything you need to require the autoload.php file.
And check out the concept of namespaces in php.
I'm working on a web application using codeigniter and i want to use php grid
in displaying information but i dont know how to do it with codeigniter! Is there anyone has worked with php grid using codeignitier? Help please!! I'm would have opted for flexigrid
but it doesn't offer so much functionality such as exporting to various document format(excel, word, e.t.c).
Thanx in advance!
I'm not familiar with php grid, but usually you can just throw a class file in application/libraries and then load it like this:
$this->load->library('phpgrid');
// and use it like this
$this->phpgrid->phpgrid_method();
You can use the following code to load php datagrid or any 3rd party PHP libraries.
$this->load->library('phpgrid');
Another approach in CodeIgniter is to directly include third party libraries without calling load library.
require_once(APPPATH. 'libraries/phpGrid_Lite/conf.php');
$data['phpgrid'] = new C_DataGrid("SELECT * FROM Orders", "orderNumber", "Orders"); //$this->ci_phpgrid->example_method(3);
APPPATH is explained in this SO discussion.
I've written the question in symfony forum, but got no result. Of course I know that people may be busy or unavailable so I can't have my answer right away. But I really needs this fast, so I posted here too. If this is not permitted somehow, please just close the question. Thanks.
Originally posted here:
http://forum.symfony-project.org/viewtopic.php?f=22&t=31537
Hi,
I have some question regarding using zend pagination in zend lucene. Checked the old forum, and found this: forum.symfony-project.org/viewtopic.php?f=21&t=27342&p=103440&hilit=zend+pagination&sid=1cdc305c262c6b3cf79fdeef25761f34#p103440
But I need some additional feature for that. I've tried the code in the post above, and it works. But how do we implement it in view?
Checking zend documentation, i create a view file in /web/view/scripts/pagination.php
with the code for the file found here:
framework.zend.com/manual/1.10/en/zend.paginator.usage.html
With some modification for $this->url() to become link_to()
Then, the code in action looks like this:
$pager = Zend_Paginator::factory($query->execute()->getData());
$pager->setItemCountPerPage(3);
$pager->setCurrentPageNumber($request->getParameter('page', 1));
$pager->setDefaultScrollingStyle('Sliding');
Zend_View_Helper_PaginationControl::setDefaultViewPartial('_pagination.php');
$this->pager = $pager;
And in view:
<?php echo $pager ?>
The problem is, of course, is this the right thing to do?
Then, how can I get the current URL and modify its parameter in view? For zend, as I understands it, it's something like $this->url(array('page', 5)). Anyway to get this done in symfony?
Thanks before.
I've also check SO and get this:
stackoverflow.com/questions/2002648/is-there-a-symfony-helper-for-getting-the-current-action-url-and-changing-one-or
But I can't access $sf_request in the pagination.php mentioned above. I think it's because the pagination.php access Zend's front controller. And the strangest thing is, I can acess the default helper like UrlHelper (tried url_for and link_to - it works).
Ps. Sorry for the links in bold - can't post more than 1 link now.
View scripts usually have a .phtml extension, not .php, that won't matter, but just so you know.
Try changing
$this->pager = $pager;
To
$this->view->pager = $pager;