Welcome Guest, Not a member yet? Register   Sign In
CI Reactor 2.0.2 sparks and fire_log
#1

[eluser]talkingnews[/eluser]
Having a bit of a struggle with the basics here.

Installed CI Reactor 2.0.2, tried to follow the intro video, server error.

15 minutes later I'd found that the installed files use CI_Controller, the demo video uses Controller (what am I doing wrong here?).

Downloaded and installed sparks.

Nothing worked. 15 minutes later I found the note about the 2.0.2 bug (there was a link here but helpfully I'm not allowed to post it - google "getsparks-org-beta-released-big-changes") and applied the fix.

Installed the fire log spark (link removed)

It said :

Usage
Really Simple...

Code:
// in your controller
function logs(){
    /*
    highly advised that you use authentification before running this controller to keep the world out of your logs!!!
    you can use whatever method you like does not have to be logs
    */
    $this->load->spark( 'fire_log/[version #]');
    // thats it, ill take if from there
}

Nothing doing. Read the CI quickstart again, made my own logs.php controller.

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Logs extends CI_Controller {

// in your controller
public function logs(){
    $this->load->spark('fire_log/0.7.0');
}
}

?>

Browse to /ci/index.php/logs, page instantly diverted to ci/index.php/logs/file::log-2011-06-30.php (which is a file that exists) and the page says:

Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Logs::$load
Filename: controllers/logs.php
Line Number: 11

Went back, read the Sparks info again, read the CI intro again, go thoroughly confused as to differences between videos I found, and code that actually worked.

Basic hello world example works fine, can't get a spark to work.
2 hours down the line now, CI appears to be above my head. I took a crack at it as it suggested it might be a small learning curve to get going. Am I being thick or is CI just better left alone for non-hardcore programmers? (I found the php intro easy and got going in no time with that).
#2

[eluser]Robbkore[/eluser]
The example video is for a very old version of CI, explaining why it does not work if you follow right along. You're not doing anything wrong, just using an old demo. Imagine trying to follow a tutorial for Windows XP but using Windows 7 to do it.

As for your question on Sparks, I've never used it so I cannot explain why it isn't working. From looking at Sparks, you might want get a good command of CI itself before adding in extra things like that. Gotta crawl before you can walk. I don't know your experience, but it is also a good idea to have some experience with PHP when learning a PHP framework.

CI is among the most simplistic frameworks I have ever tried in terms of actual usage. It is lightweight, straightforward and easy to use. The community is probably the single best community behind PHP frameworks (that I've experienced).
#3

[eluser]talkingnews[/eluser]
[quote author="Robbkore" date="1309477884"]The example video is for a very old version of CI, explaining why it does not work if you follow right along. You're not doing anything wrong, just using an old demo. Imagine trying to follow a tutorial for Windows XP but using Windows 7 to do it.[/quote]Well, the video I followed is the one right on the front page of Codeigniter: http://codeigniter.com/tutorials/

So basically, it's like me buying Windows 7 and getting the XP manual with it, marked "Windows 7 instructions", then someone telling me "well duh! Dude, that's for Windows XP!"

In fact, since posting, I've found a couple of posts on places like Stackoverflow saying not to watch the intro videos, and right here on this forum I've since found various people complaining about several major bugs in 2.0.2.

I think, for the moment, until CI is a semi-stable product with documentation that reflects the current version, I might give it a miss. Looks promising, but seems a way to go yet.

Thanks for the info - back to procedural php for me for now though.
#4

[eluser]osci[/eluser]
Quote:I think, for the moment, until CI is a semi-stable product with documentation that reflects the current version

Well the changes in tutorials are not such a big deal. Reading in user_guide upgrading solves many of the issues. I understand your complain about Windows 7 and XP Manual, but consider this is open source, developers have their own jobs to follow too (they are not paid for developing the framework), and sometimes fixes are more important than going through creating new video tutorials. If someone has free time he creates a tutorial and contributes. There is actually a user contribution that is up to date here

Regarding sparks
Quote:Gotta crawl before you can walk
Since you were looking to introductory vtc you should consider this statement and go a little more through the user_guide and forum before adding such a configuration.

Quote:I might give it a miss.
If your primary concern is documentation you'll miss ci and it's user guide, believe me. It has been stated in so many forums and blogs how nice and comprehensive the ci user guide is.

Quote:Thanks for the info - back to procedural php for me for now though.
This won't do you any good. Procedural php is (almost) dead, and no company will use you for your procedural coding skills. So if you plan to make a living through coding that was a wrong statement.
#5

[eluser]talkingnews[/eluser]
[quote author="osci" date="1309527813"]There is actually a user contribution that is up to date here[/quote]

Ah, now we're cooking! That got me back on track. So, I have to agree with the person below the video at learn-codeigniter who said
Quote:"codeigniter.com should take these tutorials to their page, they have old ones and for newbies their tutorials mess everything around"

I suppose that's my only "complaint" really - a newbie comes to code-igniter, downloads the current version, finds themselves unknowingly watching a video for a different version.
Right on the front page, the "get started" video says "Hello World! Introduction to CodeIgniter". I suppose that's my only gripe.. why not point newbies towards the correct introduction rather than confuse them with old syntax which won't work on the current version?

[quote author="osci" date="1309527813"]
Quote:Thanks for the info - back to procedural php for me for now though.
This won't do you any good. Procedural php is (almost) dead, and no company will use you for your procedural coding skills. So if you plan to make a living through coding that was a wrong statement.[/quote]

I'm not looking to program commercially, just solve simple problems for my own site. I'm interested in your hypothesis that "Procedural php is (almost) dead", I recently read a persuasive argument on Stackoverflow, which I can't find now, but here's one similar. (oh yeah, helpfully I can't post links - you can find it I'm sure - the title is "How do i get out of the habit of procedural programming and into object oriented programming?"

When all I want to do is read a csv file into a database via cron once a month, why OO it over procedural? I've seen two php scripts that will read id3 from an mp3 file - the procedural one is about 30 lines line, the OO one is about 500 lines over 3 files, the end result is the same.

Just saying... anyway, now I've found an intro that works, I'll give CI another go. Thanks for the pointer.




Theme © iAndrew 2016 - Forum software by © MyBB