Shop OBEX P1 Docs P2 Docs Learn Events
Spinneret PHP — Parallax Forums

Spinneret PHP

propn00bpropn00b Posts: 5
edited 2010-12-02 03:31 in Accessories
Is there any chance that there will be some kind of simple PHP (Or another language) incorporated in the Spinneret firmware? I was thinking of putting Wordpress on the Spinneret. I was also thinking about some kind of HTML tag that the Spinneret interprets and launches into a cog.

Comments

  • CassLanCassLan Posts: 586
    edited 2010-11-26 21:05
  • GadgetmanGadgetman Posts: 2,436
    edited 2010-11-27 02:34
    you're joking about WordPress, right?

    The dynamic language that's being worked on has potential, but something as big as WordPress? (I think that the ongoing project is a bit too ambitious, but would love to be proved wrong. Actually, that happens quite often if I say something can't be done with a Propeller... ;-)

    WordPress and similar setups also requires a database for storing data. Sure, the Spinneret has room for a microSD card, but that's just the physical storage. A DB requires indexing for faster searches(we want fast searches or the script will have to wait 'forever' for the data needed to continue), we want easy 'COUNT' operations to tell us how many lines were found in the search, we want... Commits, we want rollbacks.
    (With commits, we 'write' all the changes to temporary spaces, then when everything is to our liking, we 'Commit' the changes and they're all copied into the DB in one operation. Quite important if there's more than one user at any time.)

    Do we have anything that can be used as a database engine in the OBEX?

    Of course, if you can do with a simpler setup, there's the simple FORM based project, which allows you to use a TEXTAREA box to create and update files.
    If you want to set up a 'simple WordPress' system, I'd go with that, a bit of static HTML, and using GET and Spin for handling user interaction. It won't be as elegant as WordPress, or as flexible as the Dynamic HTML of that other project promises, but you should be able to get it up and running quite a lot sooner.
    (If the text files entered in the form is run through a Spin program that adds the HTML header and parses it for 'BBCode' tags you should still be able to get a decent amount of formatting and still hide the complexity of actual hml )

    Heh... I guess most of the tools you need really are available, already...
  • kuismakuisma Posts: 134
    edited 2010-11-28 09:36
    Gadgetman wrote: »
    Do we have anything that can be used as a database engine in the OBEX?

    I have implemented a dbm database using the sd card as back storage, storing everything from variables to files. Not using a file system but the block device as is, it is quite efficient and requires only a couple of block reads accessing the data. The API is quite dbm-alike, key/value;

    db.fetch(database, key_ptr, key_len, data_ptr, data_len), e.g.

    db.store(MYDB, @key_long_value, 4, @my_data_long, 4)
    db.fetch(MYDB, string("/my/file"), strsize("/my/file"), @filebuffer, @filerbuffer_size)

    You get the idea. Not in a releasable state yet, but within a couple of weeks, I guess.
  • GadgetmanGadgetman Posts: 2,436
    edited 2010-11-28 10:07
    Every darn time I write that something can't be done, the tools doesn't exist or similar... Someone must disprove me...

    "It's impossible to build an anti-gravity system based around a Propeller".

    *Whistles innocently*

    Got any idea of what kind of read and write speeds?
    Single-user I assume?
  • kuismakuisma Posts: 134
    edited 2010-11-28 10:52
    The database is basically a hash table, and the speed is up to the backend card I/O routines. Today I use safe_spi (from fsrw), but the Spinneret got all wires for running SD mode, so if speed is an issue, I guess it is only to use another backend. I have not tested the speed yet myself, still work to be done (streaming data (fifo access), stack access etc). Today single access, but one of the ideas is using the database as medium for producer/consumers, e.g. piping a tcp stream into the db one end, and an application emptying the same stream at the other end, at another cog - so multi-access is on the todo list.
  • MacTuxLinMacTuxLin Posts: 821
    edited 2010-12-01 10:21
    kuisma,

    Cool. Oh, don't mean to hijack this threat but just want to comment that I started working with db lang like dbase3+ & foxpro many years ago & would like add some db capability to prop on uSD myself too.

    Maybe you could start a new threat with PropDB on SD or something?
  • kuismakuisma Posts: 134
    edited 2010-12-02 01:34
    MacTuxLin wrote: »
    kuisma,

    Cool. Oh, don't mean to hijack this threat but just want to comment that I started working with db lang like dbase3+ & foxpro many years ago & would like add some db capability to prop on uSD myself too.

    Maybe you could start a new threat with PropDB on SD or something?

    It is me apologizing hijacking the PHP thread. I started the PropDBM thread here:
    http://forums.parallax.com/showthread.php?t=127577
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2010-12-02 03:31
    Maybe with PHP it would be easy to interface a Spinneret program to an application like Facebook
Sign In or Register to comment.