Welcome Guest, Not a member yet? Register   Sign In
Can codeigniter do this?
#1

[eluser]kaosweaver[/eluser]
This is a tall request, I'm hoping there are people on here who have successfully accomplished the goals I'm needing to have done. I'm converting PHP sites from "freeform" to a uniform API centric model. I have barely done more than installed CodeIgniter and got a few pages working (although I LOVE the design, can't wait to delve in deeper) - so, my questions may be from ignorance - I've only spent a few hours going over the documentation.

What I would appreciate knowing is if this framework can handle:

XML data communications from multiple sources and different XML coding standards, consolidate the results, eliminate redundant data, track the data source (from where it came) and return subsequent form submissions to the same source where the data came from.

Demonstration example - we have three systems storing the data, exported via XML or direct database access - on three servers. We sell cars, we have the inventory on different servers with some overlap. We want to do a query, pulling all Nissans in inventory - eliminating the duplicate inventory matches - and if someone picks a Nissan which was in multiple data sources, we're able to track back to that data source and mark it as being selected from that source (each data source represents an affiliate who gets credit for the selection)

While a lot of coding would be involved and has nothing to do with the framework, the key questions are - can the XML parser handle multiple XML standards and can the results of collected data sets be combined in to a single one omitting duplicates?

Next question - To continue with the example I'm using - we have forms that each affiliate uses to collect data - if a specific vehicle is selected, we track back to the affiliate and they send us the form (via XML again) and we parse it out and use the form handler to output it - as well as manage the validation. But after that is all done (and I'm hoping someone has accomplished something similar to this) - it transmits the data back to the source server on a background thread - can this framework handle (or simulate) this?

Last - has anyone expanded the template features to something more "full featured", although I'm not fond of the concept of templates (php ain't that hard) - our lead developer LOVES smarty and I'm not really excited to learn another syntax to do simple things.

Appreciate the assistance, I'm not looking for someone to build anything here, high level concepts of how it could be done are OK - normally, I'd just do it myself and see if it works, this time, I do not have the luxury of time to bang away on this and figure it out myself as I have to recommend a framework/system with a risk analysis for the selection. Personally, I'm pulling for this framework as I love the documentation and the code seems real straightforward to work with.

Thanks
#2

[eluser]beatryder[/eluser]
I can help you with the XML stuff.

If you XML is valid CI should be able to work with it. What do you mean when you say multiple standards? Are you referring to each XML sources having its own DTD defined? If that is the case, then as long as your XML docs conform to those then CI should be able to handle it.

In short, CI should be able to handle anything you can throw at it. If nothing else you can always extend it your self.
#3

[eluser]Michael Wales[/eluser]
Yes - CI can do anything you tell it to.

Just like Ruby on Rails can do anything,
CakePHP can do anything,
BlitzBasic can do anything...
#4

[eluser]gtech[/eluser]
I am no expert but I have spent a little while developing a webservice using CI.. Code igniter has a XMLRPC implementation which I have used between another webserver written in python with amazing ease. PHP has a good set XML libraries [url="http://uk2.php.net/simplexml"][click here][/url] so its not needed within the CI framework. I have used this method to parse xml files that have been posted to a url for customer details.

I can't comment about creating threads however, I know Apache uses multi threading to process requests, but I don't think PHP naturally supports multi threading [url="http://www.alternateinterior.com/2007/05/multi-threading-strategies-in-php.html"](click here for source)[/url].
#5

[eluser]tonanbarbarian[/eluser]
If you are saying that you have different DTD or XML Schemas to work on depending on the source of the xml data then simply create libraries that interact with each xml data source.
I have done something similar in an app.
It loads different libraries (hard coded at the moment) depending on the source of the xml data, but each library has similar methods so that the controller or model can interact with any of the libraries in standard ways
#6

[eluser]gtech[/eluser]
Regarding smarty, that looks remarkably similar to how CI implements views.

smarty does it like this [url="http://smarty.php.net/crashcourse.php"](source click here)[/url]
Code:
...
//index.php
...
include('Smarty.class.php');
$smarty = new Smarty;

$smarty->assign('name', 'george smith');
$smarty->assign('address', '45th & Harris');
$smarty->display('index.tpl');

...
//index.tpl
...

User Information:<p>

Name: {$name}<br>
Address: {$address}<br>

Code igniter is like this
Code:
[code]
//controller.php
...
$data = array()
$data['name'] = 'george smith';
$data['address'] = '45th & Harris';
$this->load->view('view.php',$data);

...
//view.php
...
User Information:<p>

Name: &lt;?=$name?&gt;<br>
Address: &lt;?=$address?&gt;<br>

I recommend reading the views and controllers documentation in CI. Note you can use for loops, if statements, associative arrays in a view and even load views within views, I use this method to create header and footer templates.
#7

[eluser]kaosweaver[/eluser]
Thanks everyone.

I get the ability for the XML to manage the DTDs, thanks. I've submitted CI for the framework I want to use, so - hopefully - they will go with it.
#8

[eluser]John_Betong[/eluser]
&nbsp;
Smarty includes a TPL view file. After using CI I find it tremendously difficult to only use HTML code in the TPL view file. I miss being able to use PHP code.

&nbsp;&nbsp;




Theme © iAndrew 2016 - Forum software by © MyBB