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
https://forums.phpfreaks.com/topic/238363-common-tasks/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.