Skip to content

Commit d092a57

Browse files
committed
Merge pull request #1 from phalcon/master
Merge
2 parents 9daa8db + 91b039f commit d092a57

File tree

399 files changed

+34883
-2006
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

399 files changed

+34883
-2006
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Create the composer.json file as follows:
3131
```json
3232
{
3333
"require": {
34-
"phalcon/devtools": "1.*"
34+
"phalcon/devtools": "dev-master"
3535
}
3636
}
3737
```

ide/1.1.0/Phalcon/Acl.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* $acl->addRole($roleGuests);
2525
*
2626
* //Add "Designers" role to acl
27-
* $acl->addRole('Designers'));
27+
* $acl->addRole('Designers');
2828
*
2929
* //Define the "Customers" resource
3030
* $customersResource = new Phalcon\Acl\Resource('Customers', 'Customers management');
@@ -39,7 +39,7 @@
3939
* $acl->deny('Guests', 'Customers', 'update');
4040
*
4141
* //Check whether role has access to the operations
42-
* $acl->isAllowed('Guests', 'Customers', 'edit') //Returns 0
42+
* $acl->isAllowed('Guests', 'Customers', 'edit'); //Returns 0
4343
* $acl->isAllowed('Guests', 'Customers', 'search'); //Returns 1
4444
* $acl->isAllowed('Guests', 'Customers', 'create'); //Returns 1
4545
*

ide/1.1.0/Phalcon/Acl/Adapter/Memory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* }
5151
* }
5252
*
53-
* //Grant acess to private area to role Users
53+
* //Grant access to private area to role Users
5454
* foreach ($privateResources as $resource => $actions) {
5555
* foreach ($actions as $action) {
5656
* $acl->allow('Users', $resource, $action);

ide/1.1.0/Phalcon/Annotations/Adapter/Apc.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Phalcon\Annotations\Adapter {
44

55
/**
6-
* Phalcon\Annotations\Adapter\Files
6+
* Phalcon\Annotations\Adapter\Apc
77
*
88
* Stores the parsed annotations in APC. This adapter is the suitable for production
99
*

ide/1.1.0/Phalcon/Annotations/Annotation.php

+11-2
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ public function numberArguments(){ }
6666

6767

6868
/**
69-
* Returns an argument in an specific position
69+
* Returns an argument in a specific position
7070
*
7171
* @return mixed
7272
*/
7373
public function getArgument($position){ }
7474

7575

7676
/**
77-
* Returns an argument in an specific position
77+
* Returns an argument in a specific position
7878
*
7979
* @return mixed
8080
*/
@@ -87,6 +87,15 @@ public function hasArgument($position){ }
8787
* @param string $name
8888
* @return mixed
8989
*/
90+
public function getNamedArgument($name){ }
91+
92+
93+
/**
94+
* Returns a named argument (deprecated)
95+
*
96+
* @param string $name
97+
* @return mixed
98+
*/
9099
public function getNamedParameter($name){ }
91100

92101

ide/1.1.0/Phalcon/Annotations/Collection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* echo 'Name=', $annotation->getName(), PHP_EOL;
1414
* }
1515
*
16-
* //Check if the annotations has an specific
16+
* //Check if the annotations has a specific
1717
* var_dump($classAnnotations->has('Cacheable'));
1818
*
1919
* //Get an specific annotation in the collection

ide/1.1.0/Phalcon/CLI/Dispatcher.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ class Dispatcher extends \Phalcon\Dispatcher implements \Phalcon\Events\EventsAw
4040

4141
const EXCEPTION_ACTION_NOT_FOUND = 5;
4242

43+
protected $_handlerSuffix;
44+
4345
protected $_defaultHandler;
4446

4547
protected $_defaultAction;
4648

47-
protected $_handlerSuffix;
48-
4949
/**
5050
* Sets the default task suffix
5151
*

ide/1.1.0/Phalcon/CLI/Router.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
*
1313
*<code>
1414
* $router = new Phalcon\CLI\Router();
15-
* $router->handle(array());
15+
* $router->handle(array(
16+
* 'module' => 'main',
17+
* 'task' => 'videos',
18+
* 'action' => 'process'
19+
* ));
1620
* echo $router->getTaskName();
1721
*</code>
1822
*

ide/1.1.0/Phalcon/Cache/Frontend/Base64.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* if ($image === null) {
3030
*
3131
* // Store the image in the cache
32-
* $cache->save($cacheKey, file_put_contents('tmp-dir/some-image.jpg'));
32+
* $cache->save($cacheKey, file_get_contents('tmp-dir/some-image.jpg'));
3333
* }
3434
*
3535
* header('Content-Type: image/jpeg');

ide/1.1.0/Phalcon/Cache/Frontend/Data.php

+24-24
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,35 @@
99
*
1010
*<code>
1111
*
12-
* // Cache the files for 2 days using a Data frontend
13-
* $frontCache = new Phalcon\Cache\Frontend\Data(array(
14-
* "lifetime" => 172800
15-
* ));
12+
* // Cache the files for 2 days using a Data frontend
13+
* $frontCache = new Phalcon\Cache\Frontend\Data(array(
14+
* "lifetime" => 172800
15+
* ));
1616
*
17-
* // Create the component that will cache "Data" to a "File" backend
18-
* // Set the cache file directory - important to keep the "/" at the end of
19-
* // of the value for the folder
20-
* $cache = new Phalcon\Cache\Backend\File($frontCache, array(
21-
* "cacheDir" => "../app/cache/"
22-
* ));
17+
* // Create the component that will cache "Data" to a "File" backend
18+
* // Set the cache file directory - important to keep the "/" at the end of
19+
* // of the value for the folder
20+
* $cache = new Phalcon\Cache\Backend\File($frontCache, array(
21+
* "cacheDir" => "../app/cache/"
22+
* ));
2323
*
24-
* // Try to get cached records
25-
* $cacheKey = 'robots_order_id.cache';
26-
* $robots = $cache->get($cacheKey);
27-
* if ($robots === null) {
24+
* // Try to get cached records
25+
* $cacheKey = 'robots_order_id.cache';
26+
* $robots = $cache->get($cacheKey);
27+
* if ($robots === null) {
2828
*
29-
* // $robots is null due to cache expiration or data does not exist
30-
* // Make the database call and populate the variable
31-
* $robots = Robots::find(array("order" => "id"));
29+
* // $robots is null due to cache expiration or data does not exist
30+
* // Make the database call and populate the variable
31+
* $robots = Robots::find(array("order" => "id"));
3232
*
33-
* // Store it in the cache
34-
* $cache->save($cacheKey, $robots);
35-
* }
33+
* // Store it in the cache
34+
* $cache->save($cacheKey, $robots);
35+
* }
3636
*
37-
* // Use $robots :)
38-
* foreach ($robots as $robot) {
39-
* echo $robot->name, "\n";
40-
* }
37+
* // Use $robots :)
38+
* foreach ($robots as $robot) {
39+
* echo $robot->name, "\n";
40+
* }
4141
*</code>
4242
*/
4343

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?php
2+
3+
namespace Phalcon\Cache\Frontend {
4+
5+
/**
6+
* Phalcon\Cache\Frontend\Json
7+
*
8+
* Allows to cache data converting/deconverting them to JSON.
9+
*
10+
* This adapters uses the json_encode/json_decode PHP's functions
11+
*
12+
* As the data is encoded in JSON other systems accessing the same backend could
13+
* process them
14+
*
15+
*<code>
16+
*
17+
* // Cache the data for 2 days
18+
* $frontCache = new Phalcon\Cache\Frontend\Json(array(
19+
* "lifetime" => 172800
20+
* ));
21+
*
22+
* //Create the Cache setting memcached connection options
23+
* $cache = new Phalcon\Cache\Backend\Memcache($frontCache, array(
24+
* 'host' => 'localhost',
25+
* 'port' => 11211,
26+
* 'persistent' => false
27+
* ));
28+
*
29+
* //Cache arbitrary data
30+
* $cache->save('my-data', array(1, 2, 3, 4, 5));
31+
*
32+
* //Get data
33+
* $data = $cache->get('my-data');
34+
*</code>
35+
*/
36+
37+
class Json implements \Phalcon\Cache\FrontendInterface {
38+
39+
protected $_frontendOptions;
40+
41+
/**
42+
* \Phalcon\Cache\Frontend\Base64 constructor
43+
*
44+
* @param array $frontendOptions
45+
*/
46+
public function __construct($frontendOptions=null){ }
47+
48+
49+
/**
50+
* Returns the cache lifetime
51+
*
52+
* @return integer
53+
*/
54+
public function getLifetime(){ }
55+
56+
57+
/**
58+
* Check whether if frontend is buffering output
59+
*
60+
* @return boolean
61+
*/
62+
public function isBuffering(){ }
63+
64+
65+
/**
66+
* Starts output frontend. Actually, does nothing
67+
*/
68+
public function start(){ }
69+
70+
71+
/**
72+
* Returns output cached content
73+
*
74+
* @return string
75+
*/
76+
public function getContent(){ }
77+
78+
79+
/**
80+
* Stops output frontend
81+
*/
82+
public function stop(){ }
83+
84+
85+
/**
86+
* Serializes data before storing it
87+
*
88+
* @param mixed $data
89+
*/
90+
public function beforeStore($data){ }
91+
92+
93+
/**
94+
* Unserializes data after retrieving it
95+
*
96+
* @param mixed $data
97+
*/
98+
public function afterRetrieve($data){ }
99+
100+
}
101+
}

ide/1.1.0/Phalcon/Cache/Frontend/None.php

+22-31
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,38 @@
88
* Discards any kind of frontend data input. This frontend does not have expiration time or any other options
99
*
1010
*<code>
11-
*
12-
* //Create a None Cache
13-
* $frontCache = new Phalcon\Cache\Frontend\None();
1411
*
15-
* // Create the component that will cache "Data" to a "Memcached" backend
16-
* // Memcached connection settings
17-
* $cache = new Phalcon\Cache\Backend\Memcached($frontCache, array(
18-
* "host" => "localhost",
19-
* "port" => "11211"
20-
* ));
12+
* //Create a None Cache
13+
* $frontCache = new Phalcon\Cache\Frontend\None();
2114
*
22-
* // This Frontend always return the data as it's returned by the backend
23-
* $cacheKey = 'robots_order_id.cache';
24-
* $robots = $cache->get($cacheKey);
25-
* if ($robots === null) {
15+
* // Create the component that will cache "Data" to a "Memcached" backend
16+
* // Memcached connection settings
17+
* $cache = new Phalcon\Cache\Backend\Memcache($frontCache, array(
18+
* "host" => "localhost",
19+
* "port" => "11211"
20+
* ));
2621
*
27-
* // This cache doesn't perform any expiration checking, so the data is always expired
28-
* // Make the database call and populate the variable
29-
* $robots = Robots::find(array("order" => "id"));
22+
* // This Frontend always return the data as it's returned by the backend
23+
* $cacheKey = 'robots_order_id.cache';
24+
* $robots = $cache->get($cacheKey);
25+
* if ($robots === null) {
3026
*
31-
* $cache->save($cacheKey, $robots);
32-
* }
27+
* // This cache doesn't perform any expiration checking, so the data is always expired
28+
* // Make the database call and populate the variable
29+
* $robots = Robots::find(array("order" => "id"));
3330
*
34-
* // Use $robots :)
35-
* foreach ($robots as $robot) {
36-
* echo $robot->name, "\n";
37-
* }
38-
*</code>
31+
* $cache->save($cacheKey, $robots);
32+
* }
3933
*
34+
* // Use $robots :)
35+
* foreach ($robots as $robot) {
36+
* echo $robot->name, "\n";
37+
* }
38+
*</code>
4039
*/
4140

4241
class None implements \Phalcon\Cache\FrontendInterface {
4342

44-
/**
45-
* \Phalcon\Cache\Frontend\None constructor
46-
*
47-
* @param array $frontendOptions
48-
*/
49-
public function __construct($frontendOptions=null){ }
50-
51-
5243
/**
5344
* Returns cache lifetime, always one second expiring content
5445
*

ide/1.1.0/Phalcon/Config.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* "host" => "localhost",
1717
* "username" => "scott",
1818
* "password" => "cheetah",
19-
* "name" => "test_db"
19+
* "dbname" => "test_db"
2020
* ),
2121
* "phalcon" => array(
2222
* "controllersDir" => "../app/controllers/",

ide/1.1.0/Phalcon/Config/Adapter/Ini.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*host = localhost
1616
*username = scott
1717
*password = cheetah
18-
*name = test_db
18+
*dbname = test_db
1919
*
2020
*[phalcon]
2121
*controllersDir = "../app/controllers/"

0 commit comments

Comments
 (0)