Skip to content

Commit e435375

Browse files
committed
Added 2.0.9 stubs
1 parent 8e1fe4d commit e435375

File tree

357 files changed

+36853
-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.

357 files changed

+36853
-0
lines changed

ide/2.0.9/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.9/Phalcon/Config.php

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
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+
* @return mixed
58+
*/
59+
public function get($index, $defaultValue = null) {}
60+
61+
/**
62+
* Gets an attribute using the array-syntax
63+
* <code>
64+
* print_r($config['database']);
65+
* </code>
66+
*
67+
* @param mixed $index
68+
* @return string
69+
*/
70+
public function offsetGet($index) {}
71+
72+
/**
73+
* Sets an attribute using the array-syntax
74+
* <code>
75+
* $config['database'] = array('type' => 'Sqlite');
76+
* </code>
77+
*
78+
* @param mixed $index
79+
* @param mixed $value
80+
*/
81+
public function offsetSet($index, $value) {}
82+
83+
/**
84+
* Unsets an attribute using the array-syntax
85+
* <code>
86+
* unset($config['database']);
87+
* </code>
88+
*
89+
* @param mixed $index
90+
*/
91+
public function offsetUnset($index) {}
92+
93+
/**
94+
* Merges a configuration into the current one
95+
* <code>
96+
* $appConfig = new \Phalcon\Config(array('database' => array('host' => 'localhost')));
97+
* $globalConfig->merge($config2);
98+
* </code>
99+
*
100+
* @param mixed $config
101+
* @return Config
102+
*/
103+
public function merge(Config $config) {}
104+
105+
/**
106+
* Converts recursively the object to an array
107+
* <code>
108+
* print_r($config->toArray());
109+
* </code>
110+
*
111+
* @return array
112+
*/
113+
public function toArray() {}
114+
115+
/**
116+
* Returns the count of properties set in the config
117+
* <code>
118+
* print count($config);
119+
* </code>
120+
* or
121+
* <code>
122+
* print $config->count();
123+
* </code>
124+
*
125+
* @return int
126+
*/
127+
public function count() {}
128+
129+
/**
130+
* Restores the state of a Phalcon\Config object
131+
*
132+
* @param array $data
133+
* @return Config
134+
*/
135+
public static function __set_state($data) {}
136+
137+
/**
138+
* Helper method for merge configs (forwarding nested config instance)
139+
*
140+
* @param Config $config
141+
* @param Config $instance = null
142+
* @return Config config
143+
*/
144+
protected final function _merge(Config $config, $instance = null) {}
145+
146+
}

ide/2.0.9/Phalcon/Crypt.php

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
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+
* Changes the padding scheme used
54+
*
55+
* @param int $scheme
56+
* @return \Phalcon\CryptInterface
57+
*/
58+
public function setPadding($scheme) {}
59+
60+
/**
61+
* Sets the cipher algorithm
62+
*
63+
* @param string $cipher
64+
* @return Crypt
65+
*/
66+
public function setCipher($cipher) {}
67+
68+
/**
69+
* Returns the current cipher
70+
*
71+
* @return string
72+
*/
73+
public function getCipher() {}
74+
75+
/**
76+
* Sets the encrypt/decrypt mode
77+
*
78+
* @param string $mode
79+
* @return Crypt
80+
*/
81+
public function setMode($mode) {}
82+
83+
/**
84+
* Returns the current encryption mode
85+
*
86+
* @return string
87+
*/
88+
public function getMode() {}
89+
90+
/**
91+
* Sets the encryption key
92+
*
93+
* @param string $key
94+
* @return Crypt
95+
*/
96+
public function setKey($key) {}
97+
98+
/**
99+
* Returns the encryption key
100+
*
101+
* @return string
102+
*/
103+
public function getKey() {}
104+
105+
/**
106+
* Pads texts before encryption
107+
*
108+
* @see http://www.di-mgt.com.au/cryptopad.html
109+
* @param string $text
110+
* @param string $mode
111+
* @param int $blockSize
112+
* @param int $paddingType
113+
*/
114+
protected function _cryptPadText($text, $mode, $blockSize, $paddingType) {}
115+
116+
/**
117+
* Removes padding @a padding_type from @a text
118+
* If the function detects that the text was not padded, it will return it unmodified
119+
*
120+
* @param string $text
121+
* @param string $mode
122+
* @param int $blockSize
123+
* @param int $paddingType
124+
* @param return_value $Result, possibly unpadded
125+
* @param text $Message to be unpadded
126+
* @param mode $Encryption mode; unpadding is applied only in CBC or ECB mode
127+
* @param block_size $Cipher block size
128+
* @param padding_type $Padding scheme
129+
*/
130+
protected function _cryptUnpadText($text, $mode, $blockSize, $paddingType) {}
131+
132+
/**
133+
* Encrypts a text
134+
* <code>
135+
* $encrypted = $crypt->encrypt("Ultra-secret text", "encrypt password");
136+
* </code>
137+
*
138+
* @param string $text
139+
* @param string $key
140+
* @return string
141+
*/
142+
public function encrypt($text, $key = null) {}
143+
144+
/**
145+
* Decrypts an encrypted text
146+
* <code>
147+
* echo $crypt->decrypt($encrypted, "decrypt password");
148+
* </code>
149+
*
150+
* @param string $text
151+
* @param mixed $key
152+
* @return string
153+
*/
154+
public function decrypt($text, $key = null) {}
155+
156+
/**
157+
* Encrypts a text returning the result as a base64 string
158+
*
159+
* @param string $text
160+
* @param mixed $key
161+
* @param bool $safe
162+
* @return string
163+
*/
164+
public function encryptBase64($text, $key = null, $safe = false) {}
165+
166+
/**
167+
* Decrypt a text that is coded as a base64 string
168+
*
169+
* @param string $text
170+
* @param mixed $key
171+
* @param bool $safe
172+
* @return string
173+
*/
174+
public function decryptBase64($text, $key = null, $safe = false) {}
175+
176+
/**
177+
* Returns a list of available cyphers
178+
*
179+
* @return array
180+
*/
181+
public function getAvailableCiphers() {}
182+
183+
/**
184+
* Returns a list of available modes
185+
*
186+
* @return array
187+
*/
188+
public function getAvailableModes() {}
189+
190+
}

0 commit comments

Comments
 (0)