Jump to content

Common Tasks


The Little Guy

Recommended Posts

I am building a Library filled with common tasks, what common tasks do you normally do when building a website?

 

Some current tasks/features the library has:

- Plugins

- Plugin session manager (so plugin sessions names don't get crossed)

- Threading (run multiple tasks at once)

- HTTP (get info from webpage)

    - get_http() (give it a url and it will save the page title, links, and clean version of the page into some properties)

- MySQL (Some mysql functions)

    - mysql_get_one() (gets the item at 0,0 from a returned result)

    - mysql_get_row() (gets a row and returns it as an array)

    - mysql_query() (executes a mysql query)

    - mysql_field() (returns the value of a field)

- File methods

    - save() (saves a file)

    - open() (opens a file)

    - duplicate() (duplicates a file)

    - truncate() (truncates a file)

    - read() (reads content from a file)

    - delete() (deletes a file)

 

So basically to do something kinda fancy...

 

require_once '../../phpLive/phpLive.php';
$url = "http://sarcasticgamer.com/wp/wp-content/uploads/2008/02/firefly.jpg";
// Get info about the URL
$info = (object)parse_url($url);
// Get the pathinfo so we can get the filename:
$pi = (object)pathinfo($info->path);
// The main part of the library:
$_live->thumbDir = 'thumbs';
$_live->get_http($url)->save($pi->basename)->makeThumb($pi->basename, 100);

 

The above code will get the image from the url, save it, and then make a thumb nail 100px wide.

 

So what I would like to know, is what other features should I add to this library to make it better!?

 

Any thoughts/suggestions would be great!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.