Git Product home page Git Product logo

mwsx's People

Contributors

loureirorg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

raphaelcorrea

mwsx's Issues

Rewriter for mwsd (routing / restful)

allow user to re-write mwsd links (like ruby or codeIgniter routing):

<?php
$routing = array(
   '(:any).php?mwsd' => '$1/mwsd',
   '(:any)/(:any).php?mws=sum&a=(:any)&b=(:any)' => '$1/ws/$2/sum/$3;$4'
);

Ajax file upload

Test file upload in browsers that support FormData class. This already implemented, but we need test.

Enhancement: User can pass a callback function to control the progress of upload.

modify mwsx.js:
http_read(url, post_data, callback): insert callback_progress

New presentation page

We need a new, stunning page to show all the mwsx possibilities. This page must explain how to install / use, what is mwsx, and sample uses like an "mwsx hello world", ajax file upload, ajax autosuggest, and integrations with real-world apps like twitter, gmaps, facebook, aws, etc.

We need explain all the "drug interactions" good and bad.

We need a video to explain all this, and how to improve and participate the project, and live samples, and a big button to download the last version (production minified, production-normal, and nightly build).

Local library feature

create an "ws_include", to behave similar to "include" of PHP (PHP and JS clients). With this function, we can add functions of an ,mwsx server and use-it like a local library

I believe that this will be an "wow factor" to new users

JS:

function ws_include(url)
{
var ws = ws(url);
for(var i in ws) {
this.ws[i].name = ws[i];
}
}

ws_include('http://an-mwsd-url.com');
alert(soma(1,2));

New language: Ruby

we need add support to more languages, like: Ruby, Perl, Java, node.js, Delphi, VB.net, ASP, JSP, Python, C, shell script, and many others, but we will prior the top languages to achieve a high audience.

In this url we see the top ten languages:
https://github.com/languages

So, the next language will be the popular Ruby. Basically we will port the php client/server to Ruby and test the interoperability: Ruby / PHP -> Ruby / PHP / JS

jQuery Plugin

We need a mwsx version in jQuery plugin format. This will be: jquery-mwsx.js and will behave similar to native jquery ajax feature: $.mwsx

Advogate to turn mwsx into a native feature

Don't use eval

if possible, don't use eval (ws_include() and ws()). Instead create a temporary file and include it. If file was already create, just include it, don't need to create again. If APC is enabled, this will be cached automatically.

PS: don't use a real tmp file, use a php wrapper.
PS 2: some systems don't allow create temporary files, if so, use eval.

PHP: auxiliar functions in private mode

Internal vars/functions like published_functions() or $ws_result should'n be acessible. We should create an mwsx class and protect this methods/attributes

class mwsx {
private function published_functions();
...
}
mwsx = new mwsx();

function ws($url) {return mwsx.ws($url);}

New cache option: file

3 cache options: none, file or memcached

If user choose "file", we'll save/load in a temporary directory (same session path) or at user-defined file.

WARNING: this can potentially open a security threat: "mwsd poisoning"

Config file

user config-file, so we don't need change the library file (mwsx.php). We'll use "parse_ini_file" function to extract data.

Ex.:

[cache]
cache_mode = memcached; # values can be off / memcached / file
cache_memcached_host = "host:port";
cache_timeout = 60; # value in seconds (or if change inode / file-timestamp)

[routing]
(:any).php?mwsd = $1/mwsd,
(:any)/(:any).php?mws=sum&a=(:any)&b=(:any) = $1/ws/$2/sum/$3;$4

MWSD in cache system (memcache or elasticache)

Use of memchaced for speedup mwsd (php server side)

in mwsx.php or user-file:

<?php
$mwsx_config = array("host_memcache" => "host:port");
?>

in mwsx.php, function "show_mwsd", insert something like this:

<?php
if (isset($mwsx_config["host_memcache"])) 
{
        $key = md5($my_url)
        $mem = new Memcache;
    $mem->addServer($mwsx_config["host_memcache"]);
        $mwsd = $mem->get($key);
        if ($mwsd === false) 
        {
             $mwsd = show_mwsd();
             $mem->set($key, $mwsd, 0, $mwsx_config["cache_expire"]);
        }
}
else {
    $mwsd = show_mwsd();
}
?>

Cache functions with apc opcode

use APC bytecode cache function to minimize resource consumption at function on-the-fly creation (ws_include or ws).

Use a wrapper, not a real file with "php://temp" or "php://memory"
look at:
http://php.net/manual/en/wrappers.php.php

Proccess:

  • create a temporary file containing the functions definition (don't use eval)
  • compile with apc_compile_file()
  • include temporary file
  • if the temporary file exists, just include it

Include functions with prefix (aka naming conflict resolution)

sometimes we have 2 include files with the same name functions. Ex.: we have a "user.php" include file with the function "new()", and want include "book.php" file which has your own "new()" function. Today this will generate a "cannot redeclare new function" error. In this proposal, we can change the name of function at include time, adding a prefix. We'll change the include_ws function from this:

    include_ws($url)

to this:

    include_ws($url [, $prefix])

Ex.:

    include_ws("my_user_mwsd_url", "user_");
    include_ws("my_book_mwsd_url", "book_");

this will produce "user_new()" and "book_new()" functions, avoiding name conflicts. Another product will be "user_::new()" and "book_::new()" (aka called Paamayim Nekudotayim)

PS: in this example if you use Paamayim Nekudotayim don't add underscore, it's ugly ;)

JS: websockets?

its interesting to use websockets for something?

one possible use:

in js, publish some javascript functions, save "url" of local javascript in server-side session. Then, in PHP (or other server), bind with "require_ws($SESSION['js_ws'])".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.