Skip to content

Commit 2be7ef7

Browse files
committed
Merge pull request #447 from sergeyklay/2.0.x_phalcon
Added 2.0.5 stubs
2 parents 142b994 + 7b1fb3d commit 2be7ef7

File tree

348 files changed

+36030
-0
lines changed

Some content is hidden

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

348 files changed

+36030
-0
lines changed

ide/2.0.5/Phalcon/Acl.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
namespace Phalcon;
4+
5+
/**
6+
* Phalcon\Acl
7+
* This component allows to manage ACL lists. An access control list (ACL) is a list
8+
* of permissions attached to an object. An ACL specifies which users or system processes
9+
* are granted access to objects, as well as what operations are allowed on given objects.
10+
* <code>
11+
* $acl = new \Phalcon\Acl\Adapter\Memory();
12+
* //Default action is deny access
13+
* $acl->setDefaultAction(\Phalcon\Acl::DENY);
14+
* //Create some roles
15+
* $roleAdmins = new \Phalcon\Acl\Role('Administrators', 'Super-User role');
16+
* $roleGuests = new \Phalcon\Acl\Role('Guests');
17+
* //Add "Guests" role to acl
18+
* $acl->addRole($roleGuests);
19+
* //Add "Designers" role to acl
20+
* $acl->addRole('Designers');
21+
* //Define the "Customers" resource
22+
* $customersResource = new \Phalcon\Acl\Resource('Customers', 'Customers management');
23+
* //Add "customers" resource with a couple of operations
24+
* $acl->addResource($customersResource, 'search');
25+
* $acl->addResource($customersResource, array('create', 'update'));
26+
* //Set access level for roles into resources
27+
* $acl->allow('Guests', 'Customers', 'search');
28+
* $acl->allow('Guests', 'Customers', 'create');
29+
* $acl->deny('Guests', 'Customers', 'update');
30+
* //Check whether role has access to the operations
31+
* $acl->isAllowed('Guests', 'Customers', 'edit'); //Returns 0
32+
* $acl->isAllowed('Guests', 'Customers', 'search'); //Returns 1
33+
* $acl->isAllowed('Guests', 'Customers', 'create'); //Returns 1
34+
* </code>
35+
*/
36+
abstract class Acl
37+
{
38+
39+
const ALLOW = 1;
40+
41+
42+
const DENY = 0;
43+
44+
45+
}

ide/2.0.5/Phalcon/Config.php

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
<?php
2+
3+
namespace Phalcon;
4+
5+
/**
6+
* Phalcon\Config
7+
* Phalcon\Config is designed to simplify the access to, and the use of, configuration data within applications.
8+
* It provides a nested object property based user interface for accessing this configuration data within
9+
* application code.
10+
* <code>
11+
* $config = new \Phalcon\Config(array(
12+
* "database" => array(
13+
* "adapter" => "Mysql",
14+
* "host" => "localhost",
15+
* "username" => "scott",
16+
* "password" => "cheetah",
17+
* "dbname" => "test_db"
18+
* ),
19+
* "phalcon" => array(
20+
* "controllersDir" => "../app/controllers/",
21+
* "modelsDir" => "../app/models/",
22+
* "viewsDir" => "../app/views/"
23+
* )
24+
* ));
25+
* </code>
26+
*/
27+
class Config implements \ArrayAccess, \Countable
28+
{
29+
30+
/**
31+
* Phalcon\Config constructor
32+
*
33+
* @param array $arrayConfig
34+
*/
35+
public function __construct($arrayConfig = null) {}
36+
37+
/**
38+
* Allows to check whether an attribute is defined using the array-syntax
39+
* <code>
40+
* var_dump(isset($config['database']));
41+
* </code>
42+
*
43+
* @param mixed $index
44+
* @return bool
45+
*/
46+
public function offsetExists($index) {}
47+
48+
/**
49+
* Gets an attribute from the configuration, if the attribute isn't defined returns null
50+
* If the value is exactly null or is not defined the default value will be used instead
51+
* <code>
52+
* echo $config->get('controllersDir', '../app/controllers/');
53+
* </code>
54+
*
55+
* @param mixed $index
56+
* @param mixed $defaultValue
57+
*/
58+
public function get($index, $defaultValue = null) {}
59+
60+
/**
61+
* Gets an attribute using the array-syntax
62+
* <code>
63+
* print_r($config['database']);
64+
* </code>
65+
*
66+
* @param mixed $index
67+
* @return string
68+
*/
69+
public function offsetGet($index) {}
70+
71+
/**
72+
* Sets an attribute using the array-syntax
73+
* <code>
74+
* $config['database'] = array('type' => 'Sqlite');
75+
* </code>
76+
*
77+
* @param mixed $index
78+
* @param mixed $value
79+
*/
80+
public function offsetSet($index, $value) {}
81+
82+
/**
83+
* Unsets an attribute using the array-syntax
84+
* <code>
85+
* unset($config['database']);
86+
* </code>
87+
*
88+
* @param mixed $index
89+
*/
90+
public function offsetUnset($index) {}
91+
92+
/**
93+
* Merges a configuration into the current one
94+
* <code>
95+
* $appConfig = new \Phalcon\Config(array('database' => array('host' => 'localhost')));
96+
* $globalConfig->merge($config2);
97+
* </code>
98+
*
99+
* @param mixed $config
100+
* @return Config
101+
*/
102+
public function merge(Config $config) {}
103+
104+
/**
105+
* Converts recursively the object to an array
106+
* <code>
107+
* print_r($config->toArray());
108+
* </code>
109+
*
110+
* @return array
111+
*/
112+
public function toArray() {}
113+
114+
/**
115+
* Returns the count of properties set in the config
116+
* <code>
117+
* print count($config);
118+
* </code>
119+
* or
120+
* <code>
121+
* print $config->count();
122+
* </code>
123+
*
124+
* @return int
125+
*/
126+
public function count() {}
127+
128+
/**
129+
* Restores the state of a Phalcon\Config object
130+
*
131+
* @param array $data
132+
* @return Config
133+
*/
134+
public static function __set_state($data) {}
135+
136+
/**
137+
* Helper method for merge configs (forwarding nested config instance)
138+
*
139+
* @param Config $config
140+
* @param Config $instance = null
141+
* @return Config config
142+
*/
143+
protected final function _merge(Config $config, $instance = null) {}
144+
145+
}

ide/2.0.5/Phalcon/Crypt.php

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
<?php
2+
3+
namespace Phalcon;
4+
5+
/**
6+
* Phalcon\Crypt
7+
* Provides encryption facilities to phalcon applications
8+
* <code>
9+
* $crypt = new \Phalcon\Crypt();
10+
* $key = 'le password';
11+
* $text = 'This is a secret text';
12+
* $encrypted = $crypt->encrypt($text, $key);
13+
* echo $crypt->decrypt($encrypted, $key);
14+
* </code>
15+
*/
16+
class Crypt implements \Phalcon\CryptInterface
17+
{
18+
19+
const PADDING_DEFAULT = 0;
20+
21+
22+
const PADDING_ANSI_X_923 = 1;
23+
24+
25+
const PADDING_PKCS7 = 2;
26+
27+
28+
const PADDING_ISO_10126 = 3;
29+
30+
31+
const PADDING_ISO_IEC_7816_4 = 4;
32+
33+
34+
const PADDING_ZERO = 5;
35+
36+
37+
const PADDING_SPACE = 6;
38+
39+
40+
protected $_key;
41+
42+
43+
protected $_padding = 0;
44+
45+
46+
protected $_mode = "cbc";
47+
48+
49+
protected $_cipher = "rijndael-256";
50+
51+
52+
/**
53+
* @brief Phalcon\CryptInterface Phalcon\Crypt::setPadding(int $scheme)
54+
* @param int $scheme Padding scheme
55+
* @return \Phalcon\CryptInterface
56+
*/
57+
public function setPadding($scheme) {}
58+
59+
/**
60+
* Sets the cipher algorithm
61+
*
62+
* @param string $cipher
63+
* @return Crypt
64+
*/
65+
public function setCipher($cipher) {}
66+
67+
/**
68+
* Returns the current cipher
69+
*
70+
* @return string
71+
*/
72+
public function getCipher() {}
73+
74+
/**
75+
* Sets the encrypt/decrypt mode
76+
*
77+
* @param string $mode
78+
* @return Crypt
79+
*/
80+
public function setMode($mode) {}
81+
82+
/**
83+
* Returns the current encryption mode
84+
*
85+
* @return string
86+
*/
87+
public function getMode() {}
88+
89+
/**
90+
* Sets the encryption key
91+
*
92+
* @param string $key
93+
* @return Crypt
94+
*/
95+
public function setKey($key) {}
96+
97+
/**
98+
* Returns the encryption key
99+
*
100+
* @return string
101+
*/
102+
public function getKey() {}
103+
104+
/**
105+
* Adds padding @a padding_type to @a text
106+
*
107+
* @see http://www.di-mgt.com.au/cryptopad.html
108+
* @param string $text
109+
* @param string $mode
110+
* @param int $blockSize
111+
* @param int $paddingType
112+
* @param return_value $Result, possibly padded
113+
* @param text $Message to be padded
114+
* @param mode $Encryption mode; padding is applied only in CBC or ECB mode
115+
* @param block_size $Cipher block size
116+
* @param padding_type $Padding scheme
117+
*/
118+
protected function _cryptPadText($text, $mode, $blockSize, $paddingType) {}
119+
120+
/**
121+
* Removes padding @a padding_type from @a text
122+
* If the function detects that the text was not padded, it will return it unmodified
123+
*
124+
* @param string $text
125+
* @param string $mode
126+
* @param int $blockSize
127+
* @param int $paddingType
128+
* @param return_value $Result, possibly unpadded
129+
* @param text $Message to be unpadded
130+
* @param mode $Encryption mode; unpadding is applied only in CBC or ECB mode
131+
* @param block_size $Cipher block size
132+
* @param padding_type $Padding scheme
133+
*/
134+
protected function _cryptUnpadText($text, $mode, $blockSize, $paddingType) {}
135+
136+
/**
137+
* Encrypts a text
138+
* <code>
139+
* $encrypted = $crypt->encrypt("Ultra-secret text", "encrypt password");
140+
* </code>
141+
*
142+
* @param string $text
143+
* @param string $key
144+
* @return string
145+
*/
146+
public function encrypt($text, $key = null) {}
147+
148+
/**
149+
* Decrypts an encrypted text
150+
* <code>
151+
* echo $crypt->decrypt($encrypted, "decrypt password");
152+
* </code>
153+
*
154+
* @param string $text
155+
* @param mixed $key
156+
* @return string
157+
*/
158+
public function decrypt($text, $key = null) {}
159+
160+
/**
161+
* Encrypts a text returning the result as a base64 string
162+
*
163+
* @param string $text
164+
* @param mixed $key
165+
* @param bool $safe
166+
* @return string
167+
*/
168+
public function encryptBase64($text, $key = null, $safe = false) {}
169+
170+
/**
171+
* Decrypt a text that is coded as a base64 string
172+
*
173+
* @param string $text
174+
* @param mixed $key
175+
* @param bool $safe
176+
* @return string
177+
*/
178+
public function decryptBase64($text, $key = null, $safe = false) {}
179+
180+
/**
181+
* Returns a list of available cyphers
182+
*
183+
* @return array
184+
*/
185+
public function getAvailableCiphers() {}
186+
187+
/**
188+
* Returns a list of available modes
189+
*
190+
* @return array
191+
*/
192+
public function getAvailableModes() {}
193+
194+
}

0 commit comments

Comments
 (0)