http://pear.php.net/
pear-webmaster@lists.php.net
pear-webmaster@lists.php.net
en-us
PEPr: Latest proposals with status Proposed
The latest PEPr proposals with status Proposed
-
PEPr Proposal [709]: HTTP::HTTP_Request
http://pear.php.net/pepr/pepr-proposal-show.php?id=709
<br />
Proposed package: HTTP::HTTP_Request<br /><br />
Proposer: <a href="/user/cequiel">Gonzalo Chumillas</a> <br /><br />
<p>A library for sending HTTP requests from the server side. For example:</p><br />
<br />
<br />
<pre><code><span style="color: #000000"><br />
<span style="color: #0000BB"><?php<br />
<br />
</span><span style="color: #FF8000">// in this case we use a configuration object<br />
</span><span style="color: #0000BB">$config </span><span style="color: #007700">= new </span><span style="color: #0000BB">HttpRequestConfig</span><span style="color: #007700">();<br />
</span><span style="color: #0000BB">$config</span><span style="color: #007700">-></span><span style="color: #0000BB">setOption</span><span style="color: #007700">(</span><span style="color: #DD0000">"follow_location"</span><span style="color: #007700">, </span><span style="color: #0000BB">true</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">$config</span><span style="color: #007700">-></span><span style="color: #0000BB">setOption</span><span style="color: #007700">(</span><span style="color: #DD0000">"user_agent"</span><span style="color: #007700">, </span><span style="color: #DD0000">"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36"</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">$config</span><span style="color: #007700">-></span><span style="color: #0000BB">setContentTypeOption</span><span style="color: #007700">(</span><span style="color: #DD0000">"charset"</span><span style="color: #007700">, </span><span style="color: #DD0000">"iso-8859-1"</span><span style="color: #007700">);<br />
<br />
</span><span style="color: #FF8000">// sends a POST request to mysite.com and attaches some files<br />
</span><span style="color: #0000BB">$req </span><span style="color: #007700">= new </span><span style="color: #0000BB">HttpRequestPost</span><span style="color: #007700">(</span><span style="color: #0000BB">$config</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">$req</span><span style="color: #007700">-></span><span style="color: #0000BB">setParam</span><span style="color: #007700">(</span><span style="color: #DD0000">"action"</span><span style="color: #007700">, </span><span style="color: #DD0000">"upload-image"</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">$req</span><span style="color: #007700">-></span><span style="color: #0000BB">setFormParam</span><span style="color: #007700">(</span><span style="color: #DD0000">"image"</span><span style="color: #007700">, new </span><span style="color: #0000BB">HttpRequestFormFile</span><span style="color: #007700">(</span><span style="color: #DD0000">"/path/to/image.jpg"</span><span style="color: #007700">));<br />
echo </span><span style="color: #0000BB">$req</span><span style="color: #007700">-></span><span style="color: #0000BB">send</span><span style="color: #007700">(</span><span style="color: #DD0000">"http://www.mysite.com"</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">?></span><br />
</span></code></pre><br />
<br />
2015-01-09T15:54:08-05:00
-
PEPr Proposal [707]: Database::Database_dbQuery
http://pear.php.net/pepr/pepr-proposal-show.php?id=707
<br />
Proposed package: Database::Database_dbQuery<br /><br />
Proposer: <a href="/user/cequiel">Gonzalo Chumillas</a> <br /><br />
<p>With this library you can update multiple interrelated tables at the same time without writing separated SQL statements.</p><br />
<br />
The following examples updates (or eventually inserts) a record in the table 'content' and the tables 'image', 'video' and 'file' at the same time:<br /><br />
<br />
<pre><code><span style="color: #000000"><br />
<span style="color: #0000BB"><?php<br />
</span><span style="color: #FF8000">// connects to the database<br />
</span><span style="color: #0000BB">$db </span><span style="color: #007700">= new </span><span style="color: #0000BB">DbConnector</span><span style="color: #007700">(</span><span style="color: #DD0000">"database"</span><span style="color: #007700">, </span><span style="color: #DD0000">"username"</span><span style="color: #007700">, </span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br />
<br />
</span><span style="color: #FF8000">// updates the record "content.id = 101"<br />
</span><span style="color: #0000BB">$t </span><span style="color: #007700">= new </span><span style="color: #0000BB">DbTable</span><span style="color: #007700">(</span><span style="color: #0000BB">$db</span><span style="color: #007700">, </span><span style="color: #DD0000">"content"</span><span style="color: #007700">, </span><span style="color: #0000BB">101</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">$t</span><span style="color: #007700">-></span><span style="color: #0000BB">set</span><span style="color: #007700">(</span><span style="color: #DD0000">"description"</span><span style="color: #007700">, </span><span style="color: #DD0000">"Record description..."</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">$t</span><span style="color: #007700">-></span><span style="color: #0000BB">set</span><span style="color: #007700">(</span><span style="color: #DD0000">"image.path"</span><span style="color: #007700">, </span><span style="color: #DD0000">"/path/to/image.jpg"</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">$t</span><span style="color: #007700">-></span><span style="color: #0000BB">set</span><span style="color: #007700">(</span><span style="color: #DD0000">"video.path"</span><span style="color: #007700">, </span><span style="color: #DD0000">"/path/to/video.mp4"</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">$t</span><span style="color: #007700">-></span><span style="color: #0000BB">set</span><span style="color: #007700">(</span><span style="color: #DD0000">"file.path"</span><span style="color: #007700">, </span><span style="color: #DD0000">"/path/to/file.pdf"</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">$t</span><span style="color: #007700">-></span><span style="color: #0000BB">update</span><span style="color: #007700">();<br />
</span><span style="color: #0000BB">?></span><br />
</span></code></pre><br />
<br />
2014-11-09T07:30:52-05:00
-
PEPr Proposal [706]: Web Services::Services_Tune
http://pear.php.net/pepr/pepr-proposal-show.php?id=706
<br />
Proposed package: Web Services::Services_Tune<br /><br />
Proposer: <a href="/user/jefftune">jeff tanner</a> <br /><br />
<p>An SDK for PHP developers to negotiate with Tune's API and generate service responses.</p><br />
<br />
<p>To use, developers will need to sign up for a MobileAppTracking account and retrieve API Key which can then be used to issue HTTP requests to the Tune API.</p><br />
<br />
<p>Full documentation is here:<br /><br />
<sup><a href="https://developers.mobileapptracking.com/tune-api-sdks/" onclick="window.open(this.href, '_blank'); return false;">1</a></sup></p><br />
<br />
2014-10-23T10:37:11-05:00
-
PEPr Proposal [703]: Authentication::Latchsdk
http://pear.php.net/pepr/pepr-proposal-show.php?id=703
<br />
Proposed package: Authentication::Latchsdk<br /><br />
Proposer: <a href="/user/elevenpaths">Eleven Paths</a> <br /><br />
<p><strong>This SDK allows developers to integrate Latch on his/her PHP service. Latch is a service that lets end-users add an extra level of security to their online accounts and services. <br /><br />
With this version of the SDK, developers can pair and unpair users and check their latches status. For more information please visit <a href="https://latch.elevenpaths.com" onclick="window.open(this.href, '_blank'); return false;">https://latch.elevenpaths.com</a> or the SDK page on GitHub <a href="https://github.com/ElevenPaths/latch-sdk-php" onclick="window.open(this.href, '_blank'); return false;">https://github.com/ElevenPaths/latch-sdk-php</a><br /><br />
</strong></p><br />
<br />
2014-03-07T17:53:14-05:00
-
PEPr Proposal [702]: HTTP::HTTP_SimpleController
http://pear.php.net/pepr/pepr-proposal-show.php?id=702
<br />
Proposed package: HTTP::HTTP_SimpleController<br /><br />
Proposer: <a href="/user/cequiel">Gonzalo Chumillas</a> <br /><br />
<p>Sometimes we do not need to install a sophisticated framework. We just want a controller that handles user requests in a simple way. This is what SimpleController does.</p><br />
<br />
For example:<br /><br />
<br />
<pre><code><span style="color: #000000"><br />
<span style="color: #0000BB"><?php<br />
<br />
$c </span><span style="color: #007700">= new </span><span style="color: #0000BB">SimpleController</span><span style="color: #007700">();<br />
</span><span style="color: #0000BB">$c</span><span style="color: #007700">-></span><span style="color: #0000BB">on</span><span style="color: #007700">(</span><span style="color: #DD0000">"start"</span><span style="color: #007700">, function () use (&</span><span style="color: #0000BB">$db</span><span style="color: #007700">) {<br />
</span><span style="color: #FF8000">// this is a good place to initialize variables<br />
</span><span style="color: #0000BB">$db </span><span style="color: #007700">= new </span><span style="color: #0000BB">Database</span><span style="color: #007700">(</span><span style="color: #DD0000">"dbname"</span><span style="color: #007700">, </span><span style="color: #DD0000">"username"</span><span style="color: #007700">, </span><span style="color: #DD0000">"xxx"</span><span style="color: #007700">);<br />
});<br />
</span><span style="color: #0000BB">$c</span><span style="color: #007700">-></span><span style="color: #0000BB">on</span><span style="color: #007700">(</span><span style="color: #DD0000">"get"</span><span style="color: #007700">, function () use (&</span><span style="color: #0000BB">$username</span><span style="color: #007700">) {<br />
</span><span style="color: #FF8000">// this is a good place to initialize HTML forms<br />
</span><span style="color: #0000BB">$username </span><span style="color: #007700">= </span><span style="color: #DD0000">"<please enter your username here>"</span><span style="color: #007700">;<br />
});<br />
</span><span style="color: #0000BB">$c</span><span style="color: #007700">-></span><span style="color: #0000BB">on</span><span style="color: #007700">(</span><span style="color: #DD0000">"post"</span><span style="color: #007700">, function () use (&</span><span style="color: #0000BB">$db</span><span style="color: #007700">, </span><span style="color: #0000BB">$username</span><span style="color: #007700">, </span><span style="color: #0000BB">$password</span><span style="color: #007700">) {<br />
</span><span style="color: #FF8000">// this is a good place to perform database operations<br />
</span><span style="color: #0000BB">$db</span><span style="color: #007700">-></span><span style="color: #0000BB">addUser</span><span style="color: #007700">(</span><span style="color: #0000BB">$username</span><span style="color: #007700">, </span><span style="color: #0000BB">$password</span><span style="color: #007700">);<br />
});<br />
</span><span style="color: #0000BB">$c</span><span style="color: #007700">-></span><span style="color: #0000BB">on</span><span style="color: #007700">(</span><span style="color: #DD0000">"end"</span><span style="color: #007700">, function () use (&</span><span style="color: #0000BB">$db</span><span style="color: #007700">) {<br />
</span><span style="color: #FF8000">// this is a good place to close resources<br />
</span><span style="color: #0000BB">$db</span><span style="color: #007700">-></span><span style="color: #0000BB">close</span><span style="color: #007700">();<br />
});<br />
<br />
</span><span style="color: #FF8000">// triggers the events 'start', 'get' or 'post' and 'end'<br />
</span><span style="color: #0000BB">$c</span><span style="color: #007700">-></span><span style="color: #0000BB">exec</span><span style="color: #007700">();<br />
</span><span style="color: #0000BB">?></span><br />
</span></code></pre><br />
<br />
2014-02-14T22:29:59-05:00
-
PEPr Proposal [701]: HTTP::HTTP_Request2_Hawk
http://pear.php.net/pepr/pepr-proposal-show.php?id=701
<br />
Proposed package: HTTP::HTTP_Request2_Hawk<br /><br />
Proposer: <a href="/user/mansion">Bertrand Mansion</a> <br /><br />
<p>This class is an Observer for signing HTTP_Request2 requests with an Hawk authentication header.</p><br />
<br />
<p>Hawk is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial HTTP request cryptographic verification.</p><br />
<br />
<p>By using an Observer, it is really easy to add authentication to the requests. The MAC is added to the request headers transparently, just before the request is sent.</p><br />
<br />
<p>Questions :</p><br />
<br />
<p>- Should this be added to the main package or is it better to have it live on its own ?</p><br />
<br />
<p>Hawk is pretty new, but it is an important feature for consuming web APIs, especially in machine to machine environment which is where it shines compared to OAuth/OAuth2. We are going to use it for our own webservices in our apps, and it's being used by others as well (example : <a href="https://tent.io/docs/authentication" onclick="window.open(this.href, '_blank'); return false;">https://tent.io/docs/authentication</a>). I think it should become more popular quickly, especially because OAuth is such a mess.</p><br />
<br />
<p>- Is an Observer the right way to do it ?</p><br />
<br />
<p>It works great, but it is the first time I use HTTP_Request2 (which is a nice package BTW), so there might be other ways.</p><br />
<br />
<p>Links :</p><br />
<br />
<p>- Hawk docs : <a href="https://github.com/hueniverse/hawk/" onclick="window.open(this.href, '_blank'); return false;">https://github.com/hueniverse/hawk/</a><br /><br />
- Other valuable PHP implementation (with server as well) : <a href="https://github.com/dflydev/dflydev-hawk" onclick="window.open(this.href, '_blank'); return false;">https://github.com/dflydev/dflydev-hawk</a><br /><br />
- My Lua server implementation for Nginx : <a href="https://github.com/golgote/lua-resty-hawk" onclick="window.open(this.href, '_blank'); return false;">https://github.com/golgote/lua-resty-hawk</a></p><br />
<br />
2014-02-08T17:16:58-05:00
-
PEPr Proposal [700]: Database::DB_DbQuery
http://pear.php.net/pepr/pepr-proposal-show.php?id=700
<br />
Proposed package: Database::DB_DbQuery<br /><br />
Proposer: <a href="/user/cequiel">Gonzalo Chumillas</a> <br /><br />
<p>DbQuery lets us to act directly over a query as if it were a table in our database. For example:</p><br />
<br />
<br />
<pre><code><span style="color: #000000"><br />
<span style="color: #0000BB"><?php<br />
<br />
</span><span style="color: #FF8000">// connects to the database<br />
</span><span style="color: #0000BB">$db </span><span style="color: #007700">= new </span><span style="color: #0000BB">DbQuery</span><span style="color: #007700">(</span><span style="color: #DD0000">"library_test"</span><span style="color: #007700">, </span><span style="color: #DD0000">"root"</span><span style="color: #007700">, </span><span style="color: #DD0000">"xxx"</span><span style="color: #007700">);<br />
<br />
</span><span style="color: #FF8000">// executes an SQL query<br />
</span><span style="color: #0000BB">$row </span><span style="color: #007700">= </span><span style="color: #0000BB">$db</span><span style="color: #007700">-></span><span style="color: #0000BB">query</span><span style="color: #007700">(</span><span style="color: #DD0000">"<br />
select<br />
b.id as book_id,<br />
b.title,<br />
b.created_on,<br />
b.updated_on,<br />
a.id as author_id,<br />
a.name as author<br />
from books as b<br />
left join authors as a on a.id = b.author_id<br />
where b.id = 11"</span><span style="color: #007700">);<br />
<br />
</span><span style="color: #FF8000">// updates the record<br />
</span><span style="color: #007700">echo </span><span style="color: #DD0000">"Saving records ...\n"</span><span style="color: #007700">;<br />
</span><span style="color: #0000BB">$row</span><span style="color: #007700">-></span><span style="color: #0000BB">set</span><span style="color: #007700">(</span><span style="color: #DD0000">"title"</span><span style="color: #007700">, </span><span style="color: #DD0000">"Code Complete 2"</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">$row</span><span style="color: #007700">-></span><span style="color: #0000BB">set</span><span style="color: #007700">(</span><span style="color: #DD0000">"author"</span><span style="color: #007700">, </span><span style="color: #DD0000">"Steve McConnell"</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">$row</span><span style="color: #007700">-></span><span style="color: #0000BB">update</span><span style="color: #007700">();<br />
<br />
</span><span style="color: #FF8000">// close the database connection<br />
</span><span style="color: #0000BB">$db</span><span style="color: #007700">-></span><span style="color: #0000BB">close</span><span style="color: #007700">();<br />
</span><span style="color: #0000BB">?></span><br />
</span></code></pre><br />
<br />
<p>I'm not completely satisfied with this package and I would like to know your opinion. I think the DbQuery class has too much methods and this is indicative of a poor design. I'm working on it in any case.<br /><br />
RIGame merupakan <a href="https://champagneetcroisiere.com/" onclick="window.open(this.href, '_blank'); return false;">Portal berita game terpercaya</a> di indonesia</p><br />
<br />
2013-11-01T21:48:06-05:00
-
PEPr Proposal [699]: Audio::MP3_Id3
http://pear.php.net/pepr/pepr-proposal-show.php?id=699
<br />
Proposed package: Audio::MP3_Id3<br /><br />
Proposer: <a href="/user/gemorroj">Gemor Roj</a> <br /><br />
<p>Package for reading and writing MP3 tag Idv1 and Idv2.</p><br />
<br />
2013-09-25T16:30:19-05:00
-
PEPr Proposal [694]: Text::Text_RegExpTokenizer
http://pear.php.net/pepr/pepr-proposal-show.php?id=694
<br />
Proposed package: Text::Text_RegExpTokenizer<br /><br />
Proposer: <a href="/user/cequiel">Gonzalo Chumillas</a> <br /><br />
The Tokenizer class is a small class that allows you to split a string into smaller pieces. Unlike other classes, it is based on regular patterns. Thanks to this, this class lets you to parse a string on the fly. For example:<br /><br />
<br />
<pre><code><span style="color: #000000"><br />
<span style="color: #0000BB"><?php<br />
<br />
</span><span style="color: #FF8000">// parses a basic SQL sentence<br />
</span><span style="color: #0000BB">$t </span><span style="color: #007700">= new </span><span style="color: #0000BB">Tokenizer</span><span style="color: #007700">(</span><span style="color: #DD0000">"Select Id, Name, Age From users Where Id = 101"</span><span style="color: #007700">);<br />
if (</span><span style="color: #0000BB">$t</span><span style="color: #007700">-></span><span style="color: #0000BB">match</span><span style="color: #007700">(</span><span style="color: #DD0000">"select"</span><span style="color: #007700">)) {<br />
</span><span style="color: #FF8000">// columns<br />
</span><span style="color: #0000BB">$columns </span><span style="color: #007700">= array();<br />
while (list(</span><span style="color: #0000BB">$column</span><span style="color: #007700">) = </span><span style="color: #0000BB">$t</span><span style="color: #007700">-></span><span style="color: #0000BB">match</span><span style="color: #007700">(</span><span style="color: #DD0000">"\w+"</span><span style="color: #007700">)) {<br />
</span><span style="color: #0000BB">array_push</span><span style="color: #007700">(</span><span style="color: #0000BB">$columns</span><span style="color: #007700">, </span><span style="color: #0000BB">$column</span><span style="color: #007700">);<br />
if (!</span><span style="color: #0000BB">$t</span><span style="color: #007700">-></span><span style="color: #0000BB">match</span><span style="color: #007700">(</span><span style="color: #DD0000">","</span><span style="color: #007700">)) {<br />
break;<br />
}<br />
}<br />
</span><span style="color: #FF8000">// 'from' clause<br />
</span><span style="color: #007700">if (</span><span style="color: #0000BB">$t</span><span style="color: #007700">-></span><span style="color: #0000BB">match</span><span style="color: #007700">(</span><span style="color: #DD0000">"from\s+(\w+)"</span><span style="color: #007700">, </span><span style="color: #0000BB">$matches</span><span style="color: #007700">)) {<br />
</span><span style="color: #0000BB">$table_name </span><span style="color: #007700">= </span><span style="color: #0000BB">$matches</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">];<br />
echo </span><span style="color: #DD0000">"You want to get the columns " </span><span style="color: #007700">. </span><span style="color: #0000BB">implode</span><span style="color: #007700">(</span><span style="color: #DD0000">", "</span><span style="color: #007700">, </span><span style="color: #0000BB">$columns</span><span style="color: #007700">) . </span><span style="color: #DD0000">" from the table </span><span style="color: #0000BB">$table_name</span><span style="color: #DD0000">.\n"</span><span style="color: #007700">;<br />
}<br />
}<br />
</span><span style="color: #0000BB">?></span><br />
</span></code></pre><br />
<br />
2013-09-12T18:38:15-05:00
-
PEPr Proposal [691]: Security::phprbac
http://pear.php.net/pepr/pepr-proposal-show.php?id=691
<br />
Proposed package: Security::phprbac<br /><br />
Proposer: <a href="/user/abiusx">Abbas Naderi</a> <br /><br />
<p>PHP RBAC is a standard NIST level 2 hierarchical role based access control implementation with extended features for PHP.</p><br />
<br />
<p>From website:<br /><br />
PHP-RBAC is the de-facto authorization library for PHP. It provides developers with NIST Level 2 Standard Role Based Access Control and more, in the fastest implementation yet.</p><br />
<br />
2013-03-01T07:43:11-05:00