Skip to content

Commit

Permalink
Merge pull request #1 from phalcon/master
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
dreamsxin committed Jul 23, 2013
2 parents 9daa8db + 91b039f commit d092a57
Show file tree
Hide file tree
Showing 399 changed files with 34,883 additions and 2,006 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Create the composer.json file as follows:
```json
{
"require": {
"phalcon/devtools": "1.*"
"phalcon/devtools": "dev-master"
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions ide/1.1.0/Phalcon/Acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* $acl->addRole($roleGuests);
*
* //Add "Designers" role to acl
* $acl->addRole('Designers'));
* $acl->addRole('Designers');
*
* //Define the "Customers" resource
* $customersResource = new Phalcon\Acl\Resource('Customers', 'Customers management');
Expand All @@ -39,7 +39,7 @@
* $acl->deny('Guests', 'Customers', 'update');
*
* //Check whether role has access to the operations
* $acl->isAllowed('Guests', 'Customers', 'edit') //Returns 0
* $acl->isAllowed('Guests', 'Customers', 'edit'); //Returns 0
* $acl->isAllowed('Guests', 'Customers', 'search'); //Returns 1
* $acl->isAllowed('Guests', 'Customers', 'create'); //Returns 1
*
Expand Down
2 changes: 1 addition & 1 deletion ide/1.1.0/Phalcon/Acl/Adapter/Memory.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* }
* }
*
* //Grant acess to private area to role Users
* //Grant access to private area to role Users
* foreach ($privateResources as $resource => $actions) {
* foreach ($actions as $action) {
* $acl->allow('Users', $resource, $action);
Expand Down
2 changes: 1 addition & 1 deletion ide/1.1.0/Phalcon/Annotations/Adapter/Apc.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Phalcon\Annotations\Adapter {

/**
* Phalcon\Annotations\Adapter\Files
* Phalcon\Annotations\Adapter\Apc
*
* Stores the parsed annotations in APC. This adapter is the suitable for production
*
Expand Down
13 changes: 11 additions & 2 deletions ide/1.1.0/Phalcon/Annotations/Annotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ public function numberArguments(){ }


/**
* Returns an argument in an specific position
* Returns an argument in a specific position
*
* @return mixed
*/
public function getArgument($position){ }


/**
* Returns an argument in an specific position
* Returns an argument in a specific position
*
* @return mixed
*/
Expand All @@ -87,6 +87,15 @@ public function hasArgument($position){ }
* @param string $name
* @return mixed
*/
public function getNamedArgument($name){ }


/**
* Returns a named argument (deprecated)
*
* @param string $name
* @return mixed
*/
public function getNamedParameter($name){ }


Expand Down
2 changes: 1 addition & 1 deletion ide/1.1.0/Phalcon/Annotations/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* echo 'Name=', $annotation->getName(), PHP_EOL;
* }
*
* //Check if the annotations has an specific
* //Check if the annotations has a specific
* var_dump($classAnnotations->has('Cacheable'));
*
* //Get an specific annotation in the collection
Expand Down
4 changes: 2 additions & 2 deletions ide/1.1.0/Phalcon/CLI/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ class Dispatcher extends \Phalcon\Dispatcher implements \Phalcon\Events\EventsAw

const EXCEPTION_ACTION_NOT_FOUND = 5;

protected $_handlerSuffix;

protected $_defaultHandler;

protected $_defaultAction;

protected $_handlerSuffix;

/**
* Sets the default task suffix
*
Expand Down
6 changes: 5 additions & 1 deletion ide/1.1.0/Phalcon/CLI/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
*
*<code>
* $router = new Phalcon\CLI\Router();
* $router->handle(array());
* $router->handle(array(
* 'module' => 'main',
* 'task' => 'videos',
* 'action' => 'process'
* ));
* echo $router->getTaskName();
*</code>
*
Expand Down
2 changes: 1 addition & 1 deletion ide/1.1.0/Phalcon/Cache/Frontend/Base64.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* if ($image === null) {
*
* // Store the image in the cache
* $cache->save($cacheKey, file_put_contents('tmp-dir/some-image.jpg'));
* $cache->save($cacheKey, file_get_contents('tmp-dir/some-image.jpg'));
* }
*
* header('Content-Type: image/jpeg');
Expand Down
48 changes: 24 additions & 24 deletions ide/1.1.0/Phalcon/Cache/Frontend/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,35 @@
*
*<code>
*
* // Cache the files for 2 days using a Data frontend
* $frontCache = new Phalcon\Cache\Frontend\Data(array(
* "lifetime" => 172800
* ));
* // Cache the files for 2 days using a Data frontend
* $frontCache = new Phalcon\Cache\Frontend\Data(array(
* "lifetime" => 172800
* ));
*
* // Create the component that will cache "Data" to a "File" backend
* // Set the cache file directory - important to keep the "/" at the end of
* // of the value for the folder
* $cache = new Phalcon\Cache\Backend\File($frontCache, array(
* "cacheDir" => "../app/cache/"
* ));
* // Create the component that will cache "Data" to a "File" backend
* // Set the cache file directory - important to keep the "/" at the end of
* // of the value for the folder
* $cache = new Phalcon\Cache\Backend\File($frontCache, array(
* "cacheDir" => "../app/cache/"
* ));
*
* // Try to get cached records
* $cacheKey = 'robots_order_id.cache';
* $robots = $cache->get($cacheKey);
* if ($robots === null) {
* // Try to get cached records
* $cacheKey = 'robots_order_id.cache';
* $robots = $cache->get($cacheKey);
* if ($robots === null) {
*
* // $robots is null due to cache expiration or data does not exist
* // Make the database call and populate the variable
* $robots = Robots::find(array("order" => "id"));
* // $robots is null due to cache expiration or data does not exist
* // Make the database call and populate the variable
* $robots = Robots::find(array("order" => "id"));
*
* // Store it in the cache
* $cache->save($cacheKey, $robots);
* }
* // Store it in the cache
* $cache->save($cacheKey, $robots);
* }
*
* // Use $robots :)
* foreach ($robots as $robot) {
* echo $robot->name, "\n";
* }
* // Use $robots :)
* foreach ($robots as $robot) {
* echo $robot->name, "\n";
* }
*</code>
*/

Expand Down
101 changes: 101 additions & 0 deletions ide/1.1.0/Phalcon/Cache/Frontend/Json.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?php

namespace Phalcon\Cache\Frontend {

/**
* Phalcon\Cache\Frontend\Json
*
* Allows to cache data converting/deconverting them to JSON.
*
* This adapters uses the json_encode/json_decode PHP's functions
*
* As the data is encoded in JSON other systems accessing the same backend could
* process them
*
*<code>
*
* // Cache the data for 2 days
* $frontCache = new Phalcon\Cache\Frontend\Json(array(
* "lifetime" => 172800
* ));
*
* //Create the Cache setting memcached connection options
* $cache = new Phalcon\Cache\Backend\Memcache($frontCache, array(
* 'host' => 'localhost',
* 'port' => 11211,
* 'persistent' => false
* ));
*
* //Cache arbitrary data
* $cache->save('my-data', array(1, 2, 3, 4, 5));
*
* //Get data
* $data = $cache->get('my-data');
*</code>
*/

class Json implements \Phalcon\Cache\FrontendInterface {

protected $_frontendOptions;

/**
* \Phalcon\Cache\Frontend\Base64 constructor
*
* @param array $frontendOptions
*/
public function __construct($frontendOptions=null){ }


/**
* Returns the cache lifetime
*
* @return integer
*/
public function getLifetime(){ }


/**
* Check whether if frontend is buffering output
*
* @return boolean
*/
public function isBuffering(){ }


/**
* Starts output frontend. Actually, does nothing
*/
public function start(){ }


/**
* Returns output cached content
*
* @return string
*/
public function getContent(){ }


/**
* Stops output frontend
*/
public function stop(){ }


/**
* Serializes data before storing it
*
* @param mixed $data
*/
public function beforeStore($data){ }


/**
* Unserializes data after retrieving it
*
* @param mixed $data
*/
public function afterRetrieve($data){ }

}
}
53 changes: 22 additions & 31 deletions ide/1.1.0/Phalcon/Cache/Frontend/None.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,38 @@
* Discards any kind of frontend data input. This frontend does not have expiration time or any other options
*
*<code>
*
* //Create a None Cache
* $frontCache = new Phalcon\Cache\Frontend\None();
*
* // Create the component that will cache "Data" to a "Memcached" backend
* // Memcached connection settings
* $cache = new Phalcon\Cache\Backend\Memcached($frontCache, array(
* "host" => "localhost",
* "port" => "11211"
* ));
* //Create a None Cache
* $frontCache = new Phalcon\Cache\Frontend\None();
*
* // This Frontend always return the data as it's returned by the backend
* $cacheKey = 'robots_order_id.cache';
* $robots = $cache->get($cacheKey);
* if ($robots === null) {
* // Create the component that will cache "Data" to a "Memcached" backend
* // Memcached connection settings
* $cache = new Phalcon\Cache\Backend\Memcache($frontCache, array(
* "host" => "localhost",
* "port" => "11211"
* ));
*
* // This cache doesn't perform any expiration checking, so the data is always expired
* // Make the database call and populate the variable
* $robots = Robots::find(array("order" => "id"));
* // This Frontend always return the data as it's returned by the backend
* $cacheKey = 'robots_order_id.cache';
* $robots = $cache->get($cacheKey);
* if ($robots === null) {
*
* $cache->save($cacheKey, $robots);
* }
* // This cache doesn't perform any expiration checking, so the data is always expired
* // Make the database call and populate the variable
* $robots = Robots::find(array("order" => "id"));
*
* // Use $robots :)
* foreach ($robots as $robot) {
* echo $robot->name, "\n";
* }
*</code>
* $cache->save($cacheKey, $robots);
* }
*
* // Use $robots :)
* foreach ($robots as $robot) {
* echo $robot->name, "\n";
* }
*</code>
*/

class None implements \Phalcon\Cache\FrontendInterface {

/**
* \Phalcon\Cache\Frontend\None constructor
*
* @param array $frontendOptions
*/
public function __construct($frontendOptions=null){ }


/**
* Returns cache lifetime, always one second expiring content
*
Expand Down
2 changes: 1 addition & 1 deletion ide/1.1.0/Phalcon/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* "host" => "localhost",
* "username" => "scott",
* "password" => "cheetah",
* "name" => "test_db"
* "dbname" => "test_db"
* ),
* "phalcon" => array(
* "controllersDir" => "../app/controllers/",
Expand Down
2 changes: 1 addition & 1 deletion ide/1.1.0/Phalcon/Config/Adapter/Ini.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*host = localhost
*username = scott
*password = cheetah
*name = test_db
*dbname = test_db
*
*[phalcon]
*controllersDir = "../app/controllers/"
Expand Down
Loading

0 comments on commit d092a57

Please sign in to comment.