PageRenderTime 61ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/ide/0.4.0/inspector.php

https://github.com/AntonShevchuk/phalcon-devtools
PHP | 8823 lines | 2034 code | 1129 blank | 5660 comment | 1 complexity | cf86fdea2a41884e2967a508110168ae MD5 | raw file
Possible License(s): BSD-3-Clause, MIT

Large files files are truncated, but you can click here to view the full file

  1. <?php if(!extension_loaded("phalcon")){
  2. /**
  3. * Phalcon_Acl
  4. *
  5. * This component allows to manage ACL lists. An access control list (ACL) is a list
  6. * of permissions attached to an object. An ACL specifies which users or system processes
  7. * are granted access to objects, as well as what operations are allowed on given objects.
  8. *
  9. *<code>
  10. *$acl = new Phalcon_Acl('Memory');
  11. *
  12. * //Default action is deny access
  13. *$acl->setDefaultAction(Phalcon_Acl::DENY);
  14. *
  15. * //Create some roles
  16. *$roleAdmins = new Phalcon_Acl_Role('Administrators', 'Super-User role');
  17. *$roleGuests = new Phalcon_Acl_Role('Guests');
  18. *
  19. * //Add "Guests" role to acl
  20. *acl->addRole($roleGuests);
  21. *
  22. * //Add "Designers" role to acl
  23. *$acl->addRole('Designers'));
  24. *
  25. * //Define the "Customers" resource
  26. *$customersResource = new Phalcon_Acl_Resource('Customers', 'Customers management');
  27. *
  28. * //Add "customers" resource with a couple of operations
  29. *$acl->addResource($customersResource, 'search');
  30. *$acl->addResource($customersResource, array('create', 'update'));
  31. *
  32. * //Set access level for roles into resources
  33. *$acl->allow('Guests', 'Customers', 'search');
  34. *$acl->allow('Guests', 'Customers', 'create');
  35. *$acl->deny('Guests', 'Customers', 'update');
  36. *
  37. * //Check whether role has access to the operations
  38. *$acl->isAllowed('Guests', 'Customers', 'edit') //Returns 0
  39. *$acl->isAllowed('Guests', 'Customers', 'search'); //Returns 1
  40. *$acl->isAllowed('Guests', 'Customers', 'create'); //Returns 1
  41. *</code>
  42. */
  43. class Phalcon_Acl
  44. {
  45. const ALLOW = 1;
  46. const DENY = 0;
  47. /**
  48. * Phalcon_Acl Constructor
  49. *
  50. * @param string $adapterName
  51. * @param array $options
  52. */
  53. public function __construct($adapterName='Memory', $options=array ()){
  54. }
  55. /**
  56. * Pass any call to the internal adapter object
  57. *
  58. * @param string $method
  59. * @param array $arguments
  60. * @return mixed
  61. */
  62. public function __call($method, $arguments=array ()){
  63. }
  64. }
  65. /**
  66. * Phalcon_Cache
  67. *
  68. * Phalcon_Cache can be used to cache output fragments to improve performance
  69. *
  70. *<code>
  71. * //Cache the file for 2 days
  72. *$frontendOptions = array(
  73. * 'lifetime' => 172800
  74. *);
  75. *
  76. * //Set the cache directory
  77. *$backendOptions = array(
  78. * 'cacheDir' => '../app/cache/'
  79. *);
  80. *
  81. *$cache = Phalcon_Cache::factory('Output', 'File', $frontendOptions, $backendOptions);
  82. *
  83. *$content = $cache->start('my-cache');
  84. *if($content===null){
  85. * echo time();
  86. * $cache->save();
  87. *} else {
  88. * echo $content;
  89. *}
  90. *</code>
  91. */
  92. class Phalcon_Cache
  93. {
  94. /**
  95. * Factories different caches backends from its adapters
  96. *
  97. * @param string $frontendAdapter
  98. * @param string $backendAdapter
  99. * @param array $frontendOptions
  100. * @param array $backendOptions
  101. * @return Phalcon_Cache_Backend_File
  102. * @static
  103. */
  104. public static function factory($frontendAdapter, $backendAdapter, $frontendOptions=array (), $backendOptions=array ()){
  105. }
  106. }
  107. /**
  108. * Phalcon_Config
  109. *
  110. * Phalcon_Config is designed to simplify the access to, and the use of, configuration data within applications.
  111. * It provides a nested object property based user interface for accessing this configuration data within
  112. * application code.
  113. *
  114. * <code>$config = new Phalcon_Config(array(
  115. * "database" => array(
  116. * "adapter" => "Mysql",
  117. * "host" => "localhost",
  118. * "username" => "scott",
  119. * "password" => "cheetah",
  120. * "name" => "test_db"
  121. * ),
  122. * "phalcon" => array(
  123. * "controllersDir" => "../app/controllers/",
  124. * "modelsDir" => "../app/models/",
  125. * "viewsDir" => "../app/views/"
  126. * )
  127. * ));</code>
  128. *
  129. */
  130. class Phalcon_Config
  131. {
  132. /**
  133. * Phalcon_Config constructor
  134. *
  135. * @param array $arrayConfig
  136. * @return Phalcon_Config
  137. */
  138. public function __construct($arrayConfig=array ()){
  139. }
  140. }
  141. /**
  142. * Phalcon_Controller
  143. *
  144. * Every application controller should extend this class that encapsulates all the controller functionality
  145. *
  146. * The controllers provide the “flow” between models and views. Controllers are responsible
  147. * for processing the incoming requests from the web browser, interrogating the models for data,
  148. * and passing that data on to the views for presentation.
  149. *
  150. *<code>
  151. *
  152. *
  153. * class PeopleController extends Phalcon_Controller {
  154. *
  155. * //This action will be executed by default
  156. * public function indexAction(){
  157. *
  158. * }
  159. *
  160. * public function findAction(){
  161. *
  162. * }
  163. *
  164. * public function saveAction(){
  165. * //Forwards flow to the index action
  166. * return $this->_forward('people/index');
  167. * }
  168. *
  169. * //This action will be executed when a non existent action is requested
  170. * public function notFoundAction(){
  171. *
  172. * }
  173. *
  174. * }
  175. *
  176. *</code>
  177. */
  178. class Phalcon_Controller
  179. {
  180. /**
  181. * @var Phalcon_Dispatcher
  182. */
  183. public $dispatcher;
  184. /**
  185. * @var Phalcon_Request
  186. */
  187. public $request;
  188. /**
  189. * @var Phalcon_Response
  190. */
  191. public $response;
  192. /**
  193. * @var Phalcon_View
  194. */
  195. public $view;
  196. /**
  197. * @var Phalcon_Model_Manager
  198. */
  199. public $model;
  200. /**
  201. * Constructor for Phalcon_Controller
  202. *
  203. * @param Phalcon_Dispatcher $dispatcher
  204. * @param Phalcon_Request $request
  205. * @param Phalcon_Response $response
  206. * @param Phalcon_View $view
  207. * @param Phalcon_Model_Manager $model
  208. */
  209. final public function __construct($dispatcher, $request, $response, $view=NULL, $model=NULL){
  210. }
  211. /**
  212. * Forwards execution flow to another controller/action.
  213. *
  214. * @param string $uri
  215. */
  216. protected function _forward($uri){
  217. }
  218. /**
  219. * Returns a param from the dispatching params
  220. *
  221. * @param mixed $index
  222. */
  223. protected function _getParam($index){
  224. }
  225. /**
  226. * Magic method __get
  227. *
  228. * @param string $propertyName
  229. */
  230. public function __get($propertyName){
  231. }
  232. }
  233. /**
  234. * Phalcon_Db
  235. *
  236. * Phalcon_Db and its related classes provide a simple SQL database interface for Phalcon Framework.
  237. * The Phalcon_Db is the basic class you use to connect your PHP application to a RDBMS.
  238. * There is a different adapter class for each brand of RDBMS.
  239. *
  240. * This component is intended to low level database operations. If you want to interact with databases using
  241. * high level abstraction use Phalcon_Model.
  242. *
  243. * Phalcon_Db is an abstract class. You only can use it with a database adapter like Phalcon_Db_Mysql
  244. *
  245. * <code>
  246. *
  247. *$config = new stdClass();
  248. *$config->host = 'localhost';
  249. *$config->username = 'machine';
  250. *$config->password = 'sigma';
  251. *$config->name = 'swarm';
  252. *
  253. *try {
  254. *
  255. * $connection = Phalcon_Db::factory('Mysql', $config);
  256. *
  257. * $connection->setFetchMode(Phalcon_Db::DB_NUM);
  258. * $result = $connection->query("SELECT * FROM robots LIMIT 5");
  259. * while($robot = $connection->fetchArray($result)){
  260. * print_r($robot);
  261. * }
  262. *
  263. *}
  264. *catch(Phalcon_Db_Exception $e){
  265. * echo $e->getMessage(), PHP_EOL;
  266. *}
  267. *
  268. * </code>
  269. */
  270. abstract class Phalcon_Db
  271. {
  272. const DB_ASSOC = 1;
  273. const DB_BOTH = 2;
  274. const DB_NUM = 3;
  275. /**
  276. * Phalcon_Db constructor, this method should not be called directly. Use Phalcon_Db::factory instead
  277. *
  278. * @param stdClass $descriptor
  279. */
  280. protected function __construct($descriptor){
  281. }
  282. /**
  283. * Sets a logger class to log all SQL operations sent to database server
  284. *
  285. * @param Phalcon_Logger $logger
  286. */
  287. public function setLogger($logger){
  288. }
  289. /**
  290. * Returns the active logger
  291. *
  292. * @return Phalcon_Logger
  293. */
  294. public function getLogger(){
  295. }
  296. /**
  297. * Sends arbitrary text to a related logger in the instance
  298. *
  299. * @param string $sqlStatement
  300. * @param int $type
  301. */
  302. protected function log($sqlStatement, $type){
  303. }
  304. /**
  305. * Sets a database profiler to the connection
  306. *
  307. * @param Phalcon_Db_Profiler $profiler
  308. */
  309. public function setProfiler($profiler){
  310. }
  311. /**
  312. * Returns the first row in a SQL query result
  313. *
  314. * <code>
  315. * //Getting first robot
  316. * $robot = $connection->fecthOne("SELECT * FROM robots");
  317. * print_r($robot);
  318. * </code>
  319. *
  320. * @param string $sqlQuery
  321. * @return array
  322. */
  323. public function fetchOne($sqlQuery){
  324. }
  325. /**
  326. * Dumps the complete result of a query into an array
  327. *
  328. * <code>
  329. * //Getting all robots
  330. * $robots = $connection->fetchAll("SELECT * FROM robots");
  331. * foreach($robots as $robot){
  332. * print_r($robot);
  333. * }
  334. * </code>
  335. *
  336. * @param string $sqlQuery
  337. * @return array
  338. */
  339. public function fetchAll($sqlQuery){
  340. }
  341. /**
  342. * Inserts data into a table using custom RBDM SQL syntax
  343. *
  344. * <code>
  345. * //Inserting a new robot
  346. * $success = $connection->insert(
  347. * "robots",
  348. * array("Astro Boy", 1952),
  349. * array("name", "year")
  350. * );
  351. *
  352. * //Next SQL sentence is sent to the database system
  353. * INSERT INTO `robots` (`name`, `year`) VALUES ("Astro boy", 1952);
  354. * </code>
  355. *
  356. * @param string $tables
  357. * @param array $values
  358. * @param array $fields
  359. * @param boolean $automaticQuotes
  360. * @return boolean
  361. */
  362. public function insert($table, $values, $fields=NULL, $automaticQuotes=false){
  363. }
  364. /**
  365. * Updates data on a table using custom RBDM SQL syntax
  366. *
  367. * <code>
  368. * //Updating existing robot
  369. * $success = $connection->update(
  370. * "robots",
  371. * array("name")
  372. * array("New Astro Boy"),
  373. * "id = 101"
  374. * );
  375. *
  376. * //Next SQL sentence is sent to the database system
  377. * UPDATE `robots` SET `name` = "Astro boy" WHERE id = 101
  378. * </code>
  379. *
  380. * @param string $tables
  381. * @param array $fields
  382. * @param array $values
  383. * @param string $whereCondition
  384. * @param boolean $automaticQuotes
  385. * @return boolean
  386. */
  387. public function update($table, $fields, $values, $whereCondition=NULL, $automaticQuotes=false){
  388. }
  389. /**
  390. * Deletes data from a table using custom RBDM SQL syntax
  391. *
  392. * <code>
  393. * //Deleting existing robot
  394. * $success = $connection->delete(
  395. * "robots",
  396. * "id = 101"
  397. * );
  398. *
  399. * //Next SQL sentence is generated
  400. * DELETE FROM `robots` WHERE id = 101
  401. * </code>
  402. *
  403. * @param string $tables
  404. * @param string $whereCondition
  405. * @return boolean
  406. */
  407. public function delete($table, $whereCondition=''){
  408. }
  409. /**
  410. * Starts a transaction in the connection
  411. *
  412. * @return boolean
  413. */
  414. public function begin(){
  415. }
  416. /**
  417. * Rollbacks the active transaction in the connection
  418. *
  419. * @return boolean
  420. */
  421. public function rollback(){
  422. }
  423. /**
  424. * Commits the active transaction in the connection
  425. *
  426. * @return boolean
  427. */
  428. public function commit(){
  429. }
  430. /**
  431. * Manually sets a "under transaction" state for the connection
  432. *
  433. * @param boolean $underTransaction
  434. */
  435. protected function setUnderTransaction($underTransaction){
  436. }
  437. /**
  438. * Checks whether connection is under database transaction
  439. *
  440. * @return boolean
  441. */
  442. public function isUnderTransaction(){
  443. }
  444. /**
  445. * Checks whether connection have auto commit
  446. *
  447. * @return boolean
  448. */
  449. public function getHaveAutoCommit(){
  450. }
  451. /**
  452. * Returns database name in the internal connection
  453. *
  454. * @return string
  455. */
  456. public function getDatabaseName(){
  457. }
  458. /**
  459. * Returns active schema name in the internal connection
  460. *
  461. * @return string
  462. */
  463. public function getDefaultSchema(){
  464. }
  465. /**
  466. * Returns the username which has connected to the database
  467. *
  468. * @return string
  469. */
  470. public function getUsername(){
  471. }
  472. /**
  473. * Returns the username which has connected to the database
  474. *
  475. * @return string
  476. */
  477. public function getHostName(){
  478. }
  479. /**
  480. * Gets an active connection unique identifier
  481. *
  482. * @return string
  483. */
  484. public function getConnectionId($asString=false){
  485. }
  486. /**
  487. * This method is executed before every SQL statement sent to the database system
  488. *
  489. * @param string $sqlStatement
  490. */
  491. protected function _beforeQuery($sqlStatement){
  492. }
  493. /**
  494. * This method is executed after every SQL statement sent to the database system
  495. *
  496. * @param string $sqlStatement
  497. */
  498. protected function _afterQuery($sqlStatement){
  499. }
  500. /**
  501. * Instantiates Phalcon_Db adapter using given parameters
  502. *
  503. * @param string $adapterName
  504. * @param stdClass $options
  505. * @return Phalcon_Db
  506. */
  507. public static function factory($adapterName, $options){
  508. }
  509. }
  510. /**
  511. * Phalcon_Dispatcher
  512. *
  513. * Dispatching is the process of taking the request object, extracting the module name,
  514. * controller name, action name, and optional parameters contained in it, and then
  515. * instantiating a controller and calling an action of that controller.
  516. *
  517. * <code>
  518. *
  519. *$dispatcher = new Phalcon_Dispatcher();
  520. *
  521. *$request = Phalcon_Request::getInstance();
  522. *$response = Phalcon_Response::getInstance();
  523. *
  524. *$dispatcher->setBasePath('./');
  525. *$dispatcher->setControllersDir('tests/controllers/');
  526. *
  527. *$dispatcher->setControllerName('posts');
  528. *$dispatcher->setActionName('index');
  529. *$dispatcher->setParams(array());
  530. *$controller = $dispatcher->dispatch($request, $response);
  531. *
  532. *</code>
  533. */
  534. class Phalcon_Dispatcher
  535. {
  536. /**
  537. * Sets default controllers directory. Depending of your platform, always add a trailing slash or backslash
  538. *
  539. * @param string $controllersDir
  540. */
  541. public function setControllersDir($controllersDir){
  542. }
  543. /**
  544. * Gets active controllers directory
  545. *
  546. * @return string
  547. */
  548. public function getControllersDir(){
  549. }
  550. /**
  551. * Sets base path for controllers dir. Depending of your platform, always add a trailing slash or backslash
  552. *
  553. * @param string $basePath
  554. */
  555. public function setBasePath($basePath){
  556. }
  557. /**
  558. * Gets base path for controllers dir
  559. *
  560. * @return string
  561. */
  562. public function getBasePath(){
  563. }
  564. /**
  565. * Sets the controller name to be dispatched
  566. *
  567. * @param string $controllerName
  568. */
  569. public function setControllerName($controllerName){
  570. }
  571. /**
  572. * Gets last dispatched controller name
  573. *
  574. * @return string
  575. */
  576. public function getControllerName(){
  577. }
  578. /**
  579. * Sets the action name to be dispatched
  580. *
  581. * @param string $actionName
  582. */
  583. public function setActionName($actionName){
  584. }
  585. /**
  586. * Gets last dispatched action name
  587. *
  588. * @return string
  589. */
  590. public function getActionName(){
  591. }
  592. /**
  593. * Sets action params to be dispatched
  594. *
  595. * @param array $params
  596. */
  597. public function setParams($params){
  598. }
  599. /**
  600. * Gets action params
  601. *
  602. * @return array
  603. */
  604. public function getParams(){
  605. }
  606. /**
  607. * Gets a param by its name or numeric index
  608. *
  609. * @param mixed $param
  610. * @return mixed
  611. */
  612. public function getParam($index){
  613. }
  614. /**
  615. * Dispatches a controller action taking into account the routing parameters
  616. *
  617. * @param Phalcon_Request $request
  618. * @param Phalcon_Response $response
  619. * @param Phalcon_View $view
  620. * @param Phalcon_Model_Manager $model
  621. * @return Phalcon_Controller
  622. */
  623. public function dispatch($request, $response, $view=NULL, $model=NULL){
  624. }
  625. /**
  626. * Throws an internal exception
  627. *
  628. * @param Phalcon_Response $response
  629. * @param string $message
  630. */
  631. protected function _throwDispatchException($response, $message){
  632. }
  633. /**
  634. * Routes to a controller/action using a string or array uri
  635. *
  636. * @param string $uri
  637. */
  638. public function forward($uri){
  639. }
  640. /**
  641. * Returns all instantiated controllers whitin the dispatcher
  642. *
  643. * @return array
  644. */
  645. public function getControllers(){
  646. }
  647. /**
  648. * Returns last dispatched controller
  649. *
  650. * @return Phalcon_Controller
  651. */
  652. public function getLastController(){
  653. }
  654. /**
  655. * Returns value returned by last dispacthed action
  656. *
  657. * @return mixed
  658. */
  659. public function getReturnedValue(){
  660. }
  661. }
  662. /**
  663. * Phalcon_Exception
  664. *
  665. * All framework exceptions should use this exception
  666. */
  667. class Phalcon_Exception extends Exception
  668. {
  669. final private function __clone(){
  670. }
  671. public function __construct($message, $code, $previous){
  672. }
  673. final public function getMessage(){
  674. }
  675. final public function getCode(){
  676. }
  677. final public function getFile(){
  678. }
  679. final public function getLine(){
  680. }
  681. final public function getTrace(){
  682. }
  683. final public function getPrevious(){
  684. }
  685. final public function getTraceAsString(){
  686. }
  687. public function __toString(){
  688. }
  689. }
  690. /**
  691. * Phalcon_Filter
  692. *
  693. * The Phalcon_Filter component provides a set of commonly needed data filters. It provides
  694. * object oriented wrappers to the php filter extension
  695. *
  696. *<code>
  697. *$filter = new Phalcon_Filter();
  698. *$filter->sanitize("some(one)@exa\\mple.com", "email"); // returns "someone@example.com"
  699. *$filter->sanitize("hello<<", "string"); // returns "hello"
  700. *$filter->sanitize("!100a019", "int"); // returns "!100a019"
  701. *$filter->sanitize("!100a019.01a", "float"); // returns "100019.01"
  702. *</code>
  703. *
  704. */
  705. class Phalcon_Filter
  706. {
  707. /**
  708. * Sanizites a value with a specified single or set of filters
  709. *
  710. * @param mixed $value
  711. * @param mixed $filters
  712. * @param boolean $silent
  713. * @return mixed
  714. */
  715. public function sanitize($value, $filters, $silent=false){
  716. }
  717. /**
  718. * Filters a value with a specified single or set of filters
  719. *
  720. * @param mixed $value
  721. * @param array $filters
  722. * @param boolean $silent
  723. * @return mixed
  724. */
  725. public function filter($value, $filters, $silent=false){
  726. }
  727. /**
  728. * Sanitize and Filter a value with a specified single or set of filters
  729. *
  730. * @param mixed $value
  731. * @param array $filters
  732. * @return mixed
  733. */
  734. public function sanitizeAndFilter($value, $filters){
  735. }
  736. /**
  737. * Internal sanizite wrapper to filter_var
  738. *
  739. * @param mixed $value
  740. * @param mixed $filters
  741. * @param boolean $silent
  742. * @return mixed
  743. */
  744. protected function _sanitize($value, $filter, $silent=false){
  745. }
  746. /**
  747. * Internal filter function
  748. *
  749. * @param mixed $value
  750. * @param array $filters
  751. * @param boolean $silent
  752. * @return mixed
  753. */
  754. protected function _filter($value, $filter, $silent=false){
  755. }
  756. }
  757. /**
  758. * Phalcon_Flash
  759. *
  760. * Shows HTML notifications related to different circumstances. Classes can be stylized using CSS
  761. */
  762. class Phalcon_Flash
  763. {
  764. private static function _showMessage($message, $classes){
  765. }
  766. /**
  767. * Shows a HTML error message
  768. *
  769. * <code>Phalcon_Flash::error('This is an error'); </code>
  770. *
  771. * @param string $message
  772. * @param string $classes
  773. * @return string
  774. */
  775. public static function error($message, $classes='errorMessage'){
  776. }
  777. /**
  778. * Shows a HTML notice/information message
  779. *
  780. * <code>Phalcon_Flash::notice('This is an information'); </code>
  781. *
  782. * @param string $message
  783. * @param string $classes
  784. * @return string
  785. */
  786. public static function notice($message, $classes='noticeMessage'){
  787. }
  788. /**
  789. * Shows a HTML success message
  790. *
  791. * <code>Phalcon_Flash::success('The process was finished successfully'); </code>
  792. *
  793. * @param string $message
  794. * @param string $classes
  795. * @return string
  796. */
  797. public static function success($message, $classes='successMessage'){
  798. }
  799. /**
  800. * Shows a HTML warning message
  801. *
  802. * <code>Phalcon_Flash::warning('Hey, this is important'); </code>
  803. * <code>Phalcon_Flash::warning('Hey, this is important', 'alert alert-warning'); </code>
  804. *
  805. * @param string $message
  806. * @param string $classes
  807. * @return string
  808. */
  809. public static function warning($message, $classes='warningMessage'){
  810. }
  811. }
  812. /**
  813. * Phalcon_Loader
  814. *
  815. * This component helps to load your project classes automatically based on some conventions
  816. *
  817. *<code>
  818. * //Creates the autoloader
  819. *$loader = new Phalcon_Loader();
  820. *
  821. * //Register some namespaces
  822. *$loader->registerNamespaces(array(
  823. * 'Example\\Base' => 'vendor/example/base/',
  824. * 'Example\\Adapter' => 'vendor/example/adapter/'
  825. * 'Example' => 'vendor/example/'
  826. *));
  827. *
  828. * //register autoloader
  829. * $loader->register();
  830. *
  831. * //Requiring class will automatically include file vendor/example/adapter/Some.php
  832. * $adapter = Example\Adapter\Some();
  833. *</code>
  834. */
  835. class Phalcon_Loader
  836. {
  837. /**
  838. * Register namespaces and its related directories
  839. *
  840. * @param array $directories
  841. */
  842. public function registerNamespaces($namespaces){
  843. }
  844. /**
  845. * Register directories on which not found classes could be found
  846. *
  847. * @param array $directories
  848. */
  849. public function registerDirs($directories){
  850. }
  851. /**
  852. * Register the autoload method
  853. */
  854. public function register(){
  855. }
  856. /**
  857. * Makes the work of autoload registered classes
  858. *
  859. * @param string $className
  860. */
  861. public function autoLoad($className){
  862. }
  863. }
  864. /**
  865. * Phalcon_Logger
  866. *
  867. * Phalcon_Logger is a component whose purpose is to create logs using
  868. * different backends via adapters, generating options, formats and filters
  869. * also implementing transactions.
  870. *
  871. *<code>
  872. *$logger = new Phalcon_Logger("File", "app/logs/test.log");
  873. *$logger->log("This is a message");
  874. *$logger->log("This is an error", Phalcon_Logger::ERROR);
  875. *$logger->error("This is another error");
  876. *$logger->close();
  877. * </code>
  878. */
  879. class Phalcon_Logger
  880. {
  881. const SPECIAL = 9;
  882. const CUSTOM = 8;
  883. const DEBUG = 7;
  884. const INFO = 6;
  885. const NOTICE = 5;
  886. const WARNING = 4;
  887. const ERROR = 3;
  888. const ALERT = 2;
  889. const CRITICAL = 1;
  890. const EMERGENCE = 0;
  891. /**
  892. * Phalcon_Logger constructor
  893. *
  894. * @param string $adapter
  895. * @param string $name
  896. * @param array $options
  897. */
  898. public function __construct($adapter='File', $name=NULL, $options=array ()){
  899. }
  900. /**
  901. * Sends/Writes a message to the log
  902. *
  903. * @param string $message
  904. * @param ing $type
  905. */
  906. public function log($message, $type=7){
  907. }
  908. /**
  909. * Sends/Writes a debug message to the log
  910. *
  911. * @param string $message
  912. * @param ing $type
  913. */
  914. public function debug($message){
  915. }
  916. /**
  917. * Sends/Writes an error message to the log
  918. *
  919. * @param string $message
  920. * @param ing $type
  921. */
  922. public function error($message){
  923. }
  924. /**
  925. * Sends/Writes an info message to the log
  926. *
  927. * @param string $message
  928. * @param ing $type
  929. */
  930. public function info($message){
  931. }
  932. /**
  933. * Sends/Writes a notice message to the log
  934. *
  935. * @param string $message
  936. * @param ing $type
  937. */
  938. public function notice($message){
  939. }
  940. /**
  941. * Sends/Writes a warning message to the log
  942. *
  943. * @param string $message
  944. * @param ing $type
  945. */
  946. public function warning($message){
  947. }
  948. /**
  949. * Sends/Writes an alert message to the log
  950. *
  951. * @param string $message
  952. * @param ing $type
  953. */
  954. public function alert($message){
  955. }
  956. /**
  957. * Pass any call to the internal adapter object
  958. *
  959. * @param string $method
  960. * @param array $arguments
  961. * @return mixed
  962. */
  963. public function __call($method, $arguments=array ()){
  964. }
  965. }
  966. /**
  967. * Phalcon_Paginator
  968. *
  969. * Phalcon_Paginator is designed to simplify building of pagination on views
  970. *
  971. * <code>
  972. *
  973. *
  974. * use Tag as Phalcon_Tag;
  975. *
  976. * $numberPage = (int) $_GET['page'];
  977. *
  978. * $paginator = Phalcon_Paginator::factory('Model', array(
  979. * 'data' => $robots,
  980. * 'limit' => 10,
  981. * 'page' => $numberPage
  982. * ));
  983. * $page = $paginator->getPaginate();
  984. * ?>
  985. *
  986. * <table>
  987. * <tr>
  988. * <th>Id</th>
  989. * <th>Name</th>
  990. * <th>Type</th>
  991. * </tr>
  992. * foreach($page->items as $item){ ?>
  993. * <tr>
  994. * <td> echo $item->id ?></td>
  995. * <td> echo $item->name ?></td>
  996. * <td> echo $item->type ?></td>
  997. * </tr>
  998. * } ?>
  999. * </table>
  1000. *
  1001. * <table>
  1002. * <tr>
  1003. * <td><?= Tag::linkTo("robots/search", "First") ?></td>
  1004. * <td><?= Tag::linkTo("robots/search?page=".$page->before, "Previous") ?></td>
  1005. * <td><?= Tag::linkTo("robots/search?page=".$page->next, "Next") ?></td>
  1006. * <td><?= Tag::linkTo("robots/search?page=".$page->last, "Last") ?></td>
  1007. * <td> echo $page->current, "/", $page->total_pages ?></td>
  1008. * </tr>
  1009. * </table>
  1010. * </code>
  1011. *
  1012. */
  1013. abstract class Phalcon_Paginator
  1014. {
  1015. /**
  1016. * Factories a paginator adapter
  1017. *
  1018. * @param string $adapterName
  1019. * @param array $options
  1020. * @return Object
  1021. */
  1022. public static function factory($adapterName, $options=array ()){
  1023. }
  1024. }
  1025. /**
  1026. * Phalcon_Request
  1027. *
  1028. * <p>Encapsulates request information for easy and secure access from application controllers.</p>
  1029. *
  1030. * <p>The request object is a simple value object that is passed between the dispatcher and controller classes.
  1031. * It packages the HTTP request environment.</p>
  1032. *
  1033. * <code>
  1034. *$request = Phalcon_Request::getInstance();
  1035. *if ($request->isPost() == true){
  1036. * if ($request->isAjax() == true){
  1037. * echo 'Request was made using POST and AJAX';
  1038. * }
  1039. *}
  1040. * </code>
  1041. *
  1042. */
  1043. class Phalcon_Request
  1044. {
  1045. /**
  1046. * Gets the singleton instance of Phalcon_Request
  1047. *
  1048. * @return Phalcon_Request
  1049. */
  1050. public static function getInstance(){
  1051. }
  1052. /**
  1053. * Overwrites Phalcon_Filter object used to sanitize input data
  1054. *
  1055. * @param Phalcon_Filter $filter
  1056. */
  1057. public function setFilter($filter){
  1058. }
  1059. /**
  1060. * Returns the active filter object used to sanitize input data
  1061. *
  1062. * @return Phalcon_Filter
  1063. */
  1064. protected function getFilter(){
  1065. }
  1066. /**
  1067. * Gets variable from $_POST superglobal applying filters if needed
  1068. *
  1069. * @param string $name
  1070. * @param string|array $filters
  1071. * @return mixed
  1072. */
  1073. public function getPost($name, $filters=NULL){
  1074. }
  1075. /**
  1076. * Gets variable from $_GET superglobal applying filters if needed
  1077. *
  1078. * @param string $name
  1079. * @param string|array $filters
  1080. * @return mixed
  1081. */
  1082. public function getQuery($name, $filters=NULL){
  1083. }
  1084. /**
  1085. * Gets variable from $_SERVER superglobal
  1086. *
  1087. * @param string $name
  1088. * @return mixed
  1089. */
  1090. public function getServer($name){
  1091. }
  1092. /**
  1093. * Checks whether $_POST superglobal has certain index
  1094. *
  1095. * @param string $name
  1096. * @return boolean
  1097. */
  1098. public function hasPost($name){
  1099. }
  1100. /**
  1101. * Checks whether $_SERVER superglobal has certain index
  1102. *
  1103. * @param string $name
  1104. * @return boolean
  1105. */
  1106. public function hasQuery($name){
  1107. }
  1108. /**
  1109. * Checks whether $_SERVER superglobal has certain index
  1110. *
  1111. * @param string $name
  1112. * @return mixed
  1113. */
  1114. public function hasServer($name){
  1115. }
  1116. /**
  1117. * Gets HTTP header from request data
  1118. *
  1119. * @param string $header
  1120. * @return string
  1121. */
  1122. public function getHeader($header){
  1123. }
  1124. /**
  1125. * Gets HTTP schema (http/https)
  1126. *
  1127. * @return string
  1128. */
  1129. public function getScheme(){
  1130. }
  1131. /**
  1132. * Checks whether request has been made using ajax
  1133. *
  1134. * @return boolean
  1135. */
  1136. public function isAjax(){
  1137. }
  1138. /**
  1139. * Checks whether request has been made using SOAP
  1140. *
  1141. * @return boolean
  1142. */
  1143. public function isSoapRequested(){
  1144. }
  1145. /**
  1146. * Checks whether request has been made using any secure layer
  1147. *
  1148. * @return boolean
  1149. */
  1150. public function isSecureRequest(){
  1151. }
  1152. /**
  1153. * Gets HTTP raws request body
  1154. *
  1155. * @return string
  1156. */
  1157. public function getRawBody(){
  1158. }
  1159. /**
  1160. * Gets active server address IP
  1161. *
  1162. * @return string
  1163. */
  1164. public function getServerAddress(){
  1165. }
  1166. /**
  1167. * Gets active server name
  1168. *
  1169. * @return string
  1170. */
  1171. public function getServerName(){
  1172. }
  1173. /**
  1174. * Gets information about schema, host and port used by the request
  1175. *
  1176. * @return string
  1177. */
  1178. public function getHttpHost(){
  1179. }
  1180. /**
  1181. * Gets most possibly client IPv4 Address
  1182. *
  1183. * @return string
  1184. */
  1185. public function getClientAddress(){
  1186. }
  1187. /**
  1188. * Gets HTTP method which request has been made
  1189. *
  1190. * @return string
  1191. */
  1192. public function getMethod(){
  1193. }
  1194. /**
  1195. * Gets HTTP user agent used to made the request
  1196. *
  1197. * @return string
  1198. */
  1199. public function getUserAgent(){
  1200. }
  1201. /**
  1202. * Checks whether HTTP method is POST
  1203. *
  1204. * @return boolean
  1205. */
  1206. public function isPost(){
  1207. }
  1208. /**
  1209. * Checks whether HTTP method is GET
  1210. *
  1211. * @return boolean
  1212. */
  1213. public function isGet(){
  1214. }
  1215. /**
  1216. * Checks whether HTTP method is PUT
  1217. *
  1218. * @return boolean
  1219. */
  1220. public function isPut(){
  1221. }
  1222. /**
  1223. * Checks whether HTTP method is HEAD
  1224. *
  1225. * @return boolean
  1226. */
  1227. public function isHead(){
  1228. }
  1229. /**
  1230. * Checks whether HTTP method is DELETE
  1231. *
  1232. * @return boolean
  1233. */
  1234. public function isDelete(){
  1235. }
  1236. /**
  1237. * Checks whether HTTP method is OPTIONS
  1238. *
  1239. * @return boolean
  1240. */
  1241. public function isOptions(){
  1242. }
  1243. /**
  1244. * Checks whether request include attached files
  1245. *
  1246. * @return boolean
  1247. */
  1248. public function hasFiles(){
  1249. }
  1250. /**
  1251. * Gets attached files as Phalcon_Request_File instances
  1252. *
  1253. * @return array
  1254. */
  1255. public function getUploadedFiles(){
  1256. }
  1257. /**
  1258. * Gets web page that refers active request. ie: http://www.google.com
  1259. *
  1260. * @return string
  1261. */
  1262. public function getHTTPReferer(){
  1263. }
  1264. protected function _getQualityHeader($serverIndex, $name){
  1265. }
  1266. protected function _getBestQuality($qualityParts, $name){
  1267. }
  1268. /**
  1269. * Gets array with mime/types and their quality accepted by the browser/client from $_SERVER['HTTP_ACCEPT']
  1270. *
  1271. * @return array
  1272. */
  1273. public function getAcceptableContent(){
  1274. }
  1275. /**
  1276. * Gets best mime/type accepted by the browser/client from $_SERVER['HTTP_ACCEPT']
  1277. *
  1278. * @return array
  1279. */
  1280. public function getBestAccept(){
  1281. }
  1282. /**
  1283. * Gets charsets array and their quality accepted by the browser/client from $_SERVER['HTTP_ACCEPT_CHARSET']
  1284. *
  1285. * @return array
  1286. */
  1287. public function getClientCharsets(){
  1288. }
  1289. /**
  1290. * Gets best charset accepted by the browser/client from $_SERVER['HTTP_ACCEPT_CHARSET']
  1291. *
  1292. * @return string
  1293. */
  1294. public function getBestCharset(){
  1295. }
  1296. /**
  1297. * Gets languages array and their quality accepted by the browser/client from $_SERVER['HTTP_ACCEPT_LANGUAGE']
  1298. *
  1299. * @return array
  1300. */
  1301. public function getLanguages(){
  1302. }
  1303. /**
  1304. * Gets best language accepted by the browser/client from $_SERVER['HTTP_ACCEPT_LANGUAGE']
  1305. *
  1306. * @return string
  1307. */
  1308. public function getBestLanguage(){
  1309. }
  1310. }
  1311. /**
  1312. * Phalcon_Response
  1313. *
  1314. * Encapsulates the HTTP response message.
  1315. *
  1316. *<code>
  1317. *$response = Phalcon_Response::getInstance();
  1318. *$response->setStatusCode(200, "OK");
  1319. *$response->setContent("<html><body>Hello</body></html>");
  1320. *$response->send();
  1321. *</code>
  1322. */
  1323. class Phalcon_Response
  1324. {
  1325. /**
  1326. * Returns singleton Phalcon_Response instance
  1327. *
  1328. * @return Phalcon_Response
  1329. */
  1330. public static function getInstance(){
  1331. }
  1332. /**
  1333. * Sets the HTTP response code
  1334. *
  1335. * @param int $code
  1336. * @param strign $message
  1337. */
  1338. public function setStatusCode($code, $message){
  1339. }
  1340. /**
  1341. * Overwrites a header in the response
  1342. *
  1343. *<code>
  1344. *$response->setHeader("Content-Type", "text/plain");
  1345. *</code>
  1346. *
  1347. * @param string $name
  1348. * @param string $value
  1349. */
  1350. public function setHeader($name, $value){
  1351. }
  1352. /**
  1353. * Send a raw header to the response
  1354. *
  1355. *<code>
  1356. *$response->setRawHeader("HTTP/1.1 404 Not Found");
  1357. *</code>
  1358. */
  1359. public function setRawHeader($header){
  1360. }
  1361. /**
  1362. * Sets HTTP response body
  1363. *
  1364. *<code>
  1365. *$response->setContent("<h1>Hello!</h1>");
  1366. *</code>
  1367. *
  1368. * @param string $content
  1369. */
  1370. public function setContent($content){
  1371. }
  1372. /**
  1373. * Appends a string to the HTTP response body
  1374. *
  1375. * @param string $content
  1376. */
  1377. public function appendContent($content){
  1378. }
  1379. /**
  1380. * Gets HTTP response body
  1381. *
  1382. * @return string
  1383. */
  1384. public function getContent(){
  1385. }
  1386. /**
  1387. * Sends HTTP response to the client
  1388. *
  1389. */
  1390. public function send(){
  1391. }
  1392. }
  1393. /**
  1394. * Phalcon_Session
  1395. *
  1396. * Session client-server persistent state data management.
  1397. */
  1398. abstract class Phalcon_Session
  1399. {
  1400. /**
  1401. * Starts session, optionally using an adapter
  1402. *
  1403. * @param array $options
  1404. */
  1405. public static function start($options=array ()){
  1406. }
  1407. /**
  1408. * Sets session options
  1409. *
  1410. * @param array $options
  1411. */
  1412. public static function setOptions($options){
  1413. }
  1414. /**
  1415. * Gets a session variable from an application context
  1416. *
  1417. * @param string $index
  1418. */
  1419. public static function get($index){
  1420. }
  1421. /**
  1422. * Sets a session variable in an application context
  1423. *
  1424. * @param string $index
  1425. * @param string $value
  1426. */
  1427. public static function set($index, $value){
  1428. }
  1429. /**
  1430. * Check whether a session variable is set in an application context
  1431. *
  1432. * @param string $index
  1433. */
  1434. public static function has($index){
  1435. }
  1436. /**
  1437. * Removes a session variable from an application context
  1438. *
  1439. * @param string $index
  1440. */
  1441. public static function remove($index){
  1442. }
  1443. /**
  1444. * Returns active session id
  1445. *
  1446. * @return string
  1447. */
  1448. public static function getId(){
  1449. }
  1450. }
  1451. /**
  1452. * Phalcon_Tag
  1453. *
  1454. * Phalcon_Tag is designed to simplify building of HTML tags.
  1455. * It provides a set of helpers to generate HTML in a dynamic way.
  1456. * This component is an abstract class that you can extend to add more helpers.
  1457. */
  1458. abstract class Phalcon_Tag
  1459. {
  1460. /**
  1461. * Sets the request dispatcher. A valid dispatcher is required to generate absolute paths
  1462. *
  1463. * @param Phalcon_Dispatcher $dispatcher
  1464. */
  1465. public static function setDispatcher($dispatcher){
  1466. }
  1467. /**
  1468. * Internally gets the request dispatcher
  1469. *
  1470. * @return Phalcon_Dispatcher
  1471. */
  1472. protected static function _getDispatcher(){
  1473. }
  1474. /**
  1475. * Assigns default values to generated tags by helpers
  1476. *
  1477. * <code>
  1478. * //Assigning "peter" to "name" component
  1479. * Phalcon_Tag::setDefault("name", "peter");
  1480. *
  1481. * //Later in the view
  1482. * echo Phalcon_Tag::textField("name"); //Will have the value "peter" by default
  1483. * </code>
  1484. *
  1485. * @param string $id
  1486. * @param string $value
  1487. */
  1488. public static function setDefault($id, $value){
  1489. }
  1490. /**
  1491. * Alias of Phalcon_Tag::setDefault
  1492. *
  1493. * @param string $id
  1494. * @param string $value
  1495. */
  1496. public static function displayTo($id, $value){
  1497. }
  1498. /**
  1499. * Every helper calls this function to check whether a component has a predefined
  1500. * value using Phalcon_Tag::displayTo or value from $_POST
  1501. *
  1502. * @param string $name
  1503. * @return mixed
  1504. */
  1505. public static function getValue($name){
  1506. }
  1507. /**
  1508. * Resets the request and internal values to avoid those fields will have any default value
  1509. */
  1510. public static function resetInput(){
  1511. }
  1512. /**
  1513. * Builds a HTML A tag using framework conventions
  1514. *
  1515. * <code>echo Phalcon_Tag::linkTo('signup/register', 'Register Here!')</code>
  1516. *
  1517. * @param array $parameters
  1518. * @return string
  1519. */
  1520. public static function linkTo($parameters, $text=NULL){
  1521. }
  1522. /**
  1523. * Builds generic INPUT tags
  1524. *
  1525. * @param string $type
  1526. * @param array $parameters
  1527. * @return string
  1528. */
  1529. protected static function _inputField($type, $parameters){
  1530. }
  1531. /**
  1532. * Builds a HTML input[type="text"] tag
  1533. *
  1534. * <code>echo Phalcon_Tag::textField(array("name", "size" => 30))</code>
  1535. *
  1536. * @param array $parameters
  1537. * @return string
  1538. */
  1539. public static function textField($parameters){
  1540. }
  1541. /**
  1542. * Builds a HTML input[type="password"] tag
  1543. *
  1544. * <code>echo Phalcon_Tag::passwordField(array("name", "size" => 30))</code>
  1545. *
  1546. * @param array $parameters
  1547. * @return string
  1548. */
  1549. public static function passwordField($parameters){
  1550. }
  1551. /**
  1552. * Builds a HTML input[type="hidden"] tag
  1553. *
  1554. * <code>echo Phalcon_Tag::hiddenField(array("name", "value" => "mike"))</code>
  1555. *
  1556. * @param array $parameters
  1557. * @return string
  1558. */
  1559. public static function hiddenField($parameters){
  1560. }
  1561. /**
  1562. * Builds a HTML input[type="file"] tag
  1563. *
  1564. * <code>echo Phalcon_Tag::fileField("file")</code>
  1565. *
  1566. * @param array $parameters
  1567. * @return string
  1568. */
  1569. public static function fileField($parameters){
  1570. }
  1571. /**
  1572. * Builds a HTML input[type="check"] tag
  1573. *
  1574. * <code>echo Phalcon_Tag::checkField(array("name", "size" => 30))</code>
  1575. *
  1576. * @param array $parameters
  1577. * @return string
  1578. */
  1579. public static function checkField($parameters){
  1580. }
  1581. /**
  1582. * Builds a HTML input[type="submit"] tag
  1583. *
  1584. * <code>echo Phalcon_Tag::submitButton("Save")</code>
  1585. *
  1586. * @param array $params
  1587. * @return string
  1588. */
  1589. public static function submitButton($parameters){
  1590. }
  1591. /**
  1592. * Builds a HTML SELECT tag using a PHP array for options
  1593. *
  1594. * <code>echo Phalcon_Tag::selectStatic("status", array("A" => "Active", "I" => "Inactive"))</code>
  1595. *
  1596. * @param array $parameters
  1597. * @return string
  1598. */
  1599. public static function selectStatic($parameters, $data=NULL){
  1600. }
  1601. /**
  1602. * Builds a HTML SELECT tag using a Phalcon_Model resultset as options
  1603. *
  1604. * <code>echo Phalcon_Tag::selectStatic(array(
  1605. * "robotId",
  1606. * Robots::find("type = 'mechanical'"),
  1607. * "using" => array("id", "name")
  1608. * ))</code>
  1609. *
  1610. * @param array $params
  1611. * @return string
  1612. */
  1613. public static function select($parameters, $data=NULL){
  1614. }
  1615. /**
  1616. * Builds a HTML TEXTAREA tag
  1617. *
  1618. * <code>echo Phalcon_Tag::textArea(array("comments", "cols" => 10, "rows" => 4))</code>
  1619. *
  1620. * @param array $parameters
  1621. * @return string
  1622. */
  1623. public static function textArea($parameters){
  1624. }
  1625. /**
  1626. * Builds a HTML FORM tag
  1627. *
  1628. * <code>
  1629. * echo Phalcon_Tag::form("posts/save");
  1630. * echo Phalcon_Tag::form(array("posts/save", "method" => "post"));
  1631. * </code>
  1632. *
  1633. * @param array $parameters
  1634. * @return string
  1635. */
  1636. public static function form($parameters=NULL){
  1637. }
  1638. /**
  1639. * Builds a HTML close FORM tag
  1640. *
  1641. * @return string
  1642. */
  1643. public static function endForm(){
  1644. }
  1645. /**
  1646. * Set the title of view content
  1647. *
  1648. * @param string $title
  1649. */
  1650. public static function setTitle($title){
  1651. }
  1652. /**
  1653. * Add to title of view content
  1654. *
  1655. * @param string $title
  1656. */
  1657. public static function appendTitle($title){
  1658. }
  1659. /**
  1660. * Add before the title of view content
  1661. *
  1662. * @param string $title
  1663. */
  1664. public static function prependTitle($title){
  1665. }
  1666. /**
  1667. * Get the title of view content
  1668. *
  1669. * @return string
  1670. */
  1671. public static function getTitle(){
  1672. }
  1673. /**
  1674. * Builds a LINK[rel="stylesheet"] tag
  1675. *
  1676. * <code>
  1677. * echo Phalcon_Tag::stylesheetLink("http://fonts.googleapis.com/css?family=Rosario", false);
  1678. * echo Phalcon_Tag::stylesheetLink("css/style.css");
  1679. * </code>
  1680. *
  1681. * @param array $parameters
  1682. * @param boolean $local
  1683. * @return string
  1684. */
  1685. public static function stylesheetLink($parameters=NULL, $local=true){
  1686. }
  1687. /**
  1688. * Builds a SCRIPT[type="javascript"] tag
  1689. *
  1690. * <code>
  1691. * echo Phalcon_Tag::javascriptInclude("http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false);
  1692. * echo Phalcon_Tag::javascriptInclude("javascript/jquery.js");
  1693. * </code>
  1694. *
  1695. * @param array $parameters
  1696. * @param boolean $local
  1697. * @return string
  1698. */
  1699. public static function javascriptInclude($parameters=NULL, $local=true){
  1700. }
  1701. /**
  1702. * Builds HTML IMG tags
  1703. *
  1704. * @param array $parameters
  1705. * @return string
  1706. */
  1707. public static function image($parameters=NULL){
  1708. }
  1709. }
  1710. class Phalcon_Text
  1711. {
  1712. /**
  1713. * Converts strings to camelize style
  1714. *
  1715. * <code>Phalcon_Utils::camelize('coco_bongo'); //CocoBongo</code>
  1716. *
  1717. * @param string $str
  1718. * @return string
  1719. */
  1720. public static function camelize($str){
  1721. }
  1722. /**
  1723. * Uncamelize strings which are camelized
  1724. *
  1725. * <code>Phalcon_Utils::camelize('CocoBongo'); //coco_bongo</code>
  1726. *
  1727. * @param string $str
  1728. * @return string
  1729. */
  1730. public static function uncamelize($str){
  1731. }
  1732. /**
  1733. * Changes only first letter to lowercase
  1734. *
  1735. * @param string $str
  1736. * @return string
  1737. * @static
  1738. **/
  1739. public static function lcfirst($str){
  1740. }
  1741. }
  1742. /**
  1743. * Phalcon_Transaction
  1744. *
  1745. * Transactions are protective blocks where SQL statements are only permanent if they can
  1746. * all succeed as one atomic action. Phalcon_Transaction is intended to be used with Phalcon_Model_Base.
  1747. * Phalcon Transactions should be created using Phalcon_Transaction_Manager.
  1748. *
  1749. *<code>
  1750. *try {
  1751. *
  1752. * $transaction = Phalcon_Transaction_Manager::get();
  1753. *
  1754. * $robot = new Robots();
  1755. * $robot->setTransaction($transaction);
  1756. * $robot->name = 'WALL·E';
  1757. * $robot->created_at = date('Y-m-d');
  1758. * if($robot->save()==false){
  1759. * $transaction->rollback("Can't save robot");
  1760. * }
  1761. *
  1762. * $robotPart = new RobotParts();
  1763. * $robotPart->setTransaction($transaction);
  1764. * $robotPart->type = 'head';
  1765. * if($robotPart->save()==false){
  1766. * $transaction->rollback("Can't save robot part");
  1767. * }
  1768. *
  1769. * $transaction->commit();
  1770. *
  1771. *}
  1772. *catch(Phalcon_Transaction_Failed $e){
  1773. * echo 'Failed, reason: ', $e->getMessage();
  1774. *}
  1775. *
  1776. *</code>
  1777. */
  1778. class Phalcon_Transaction
  1779. {
  1780. /**
  1781. * Phalcon_Transaction constructor
  1782. *
  1783. * @param boolean $autoBegin
  1784. */
  1785. public function __construct($autoBegin=false){
  1786. }
  1787. /**
  1788. * Sets transaction manager related to the transaction
  1789. *
  1790. * @param Phalcon_Transaction_Manager $manager
  1791. */
  1792. public function setTransactionManager($manager){
  1793. }
  1794. /**
  1795. * Starts the transaction
  1796. */
  1797. public function begin(){
  1798. }
  1799. /**
  1800. * Commits the transaction
  1801. *
  1802. * @return boolean
  1803. */
  1804. public function commit(){
  1805. }
  1806. /**
  1807. * Rollbacks the transaction
  1808. *
  1809. * @param string $rollbackMessage
  1810. * @param Phalcon_Model_Base $rollbackRecord
  1811. * @return boolean
  1812. */
  1813. public function rollback($rollbackMessage=NULL, $rollbackRecord=NULL){
  1814. }
  1815. /**
  1816. * Returns connection related to transaction
  1817. *
  1818. * @return Phalcon_Db
  1819. */
  1820. public function getConnection(){
  1821. }
  1822. /**
  1823. * Sets if is a reused transaction or new once
  1824. *
  1825. * @param boolean $isNew
  1826. */
  1827. public function setIsNewTransaction($isNew){
  1828. }
  1829. /**
  1830. * Sets flag to rollback on abort the HTTP connection
  1831. *
  1832. * @param boolean $rollbackOnAbort
  1833. */
  1834. public function setRollbackOnAbort($rollbackOnAbort){
  1835. }
  1836. /**
  1837. * Checks whether transaction is managed by a transaction manager
  1838. *
  1839. * @return boolean
  1840. */
  1841. public function isManaged(){
  1842. }
  1843. /**
  1844. * Changes dependency internal pointer
  1845. *
  1846. * @param int $pointer
  1847. */
  1848. public function setDependencyPointer($pointer){
  1849. }
  1850. /**
  1851. * Attaches Phalcon_Model_Base object to the active transaction
  1852. *
  1853. * @param int $pointer
  1854. * @param Phalcon_Model_Base $object
  1855. */
  1856. public function attachDependency($pointer, $object){
  1857. }
  1858. /**
  1859. * Make a bulk save on all attached objects
  1860. *
  1861. * @return boolean
  1862. */
  1863. public function save(){
  1864. }
  1865. /**
  1866. * Returns validations messages from last save try
  1867. *
  1868. * @return array
  1869. */
  1870. public function getMessages(){
  1871. }
  1872. /**
  1873. * Checks whether internal connection is under an active transaction
  1874. *
  1875. * @return boolean
  1876. */
  1877. public function isValid(){
  1878. }
  1879. /**
  1880. * Sets object which generates rollback action
  1881. *
  1882. * @param Phalcon_Model_Base $record
  1883. */
  1884. public function setRollbackedRecord($record){
  1885. }
  1886. }
  1887. /**
  1888. * Phalcon_Translate
  1889. *
  1890. * Translate component allows the creation of multi-language applications using
  1891. * different adapters for translation lists.
  1892. */
  1893. class Phalcon_Translate implements ArrayAccess
  1894. {
  1895. /**
  1896. * Phalcon_Translate constructor
  1897. *
  1898. * @param string $adapter
  1899. * @param array $options
  1900. */
  1901. public function __construct($adapter, $options){
  1902. }
  1903. /**
  1904. * Returns the translation string of the given key
  1905. *
  1906. * @param string $translateKey
  1907. * @return string
  1908. */
  1909. public function _($translateKey){
  1910. }
  1911. /**
  1912. * Sets a translation value
  1913. *
  1914. * @param string $offset
  1915. * @param string $value
  1916. */
  1917. public function offsetSet($offset, $value){
  1918. }
  1919. /**
  1920. * Check whether a translation key exists
  1921. *
  1922. * @param string $translateKey
  1923. * @return boolean
  1924. */
  1925. public function offsetExists($translateKey){
  1926. }
  1927. /**
  1928. * Elimina un indice del diccionario
  1929. *
  1930. * @param string $offset
  1931. */
  1932. public function offsetUnset($offset){
  1933. }
  1934. /**
  1935. * Returns the translation related to the given key
  1936. *
  1937. * @param string $traslateKey
  1938. * @return string
  1939. */
  1940. public function offsetGet($traslateKey){
  1941. }
  1942. }
  1943. /**
  1944. * Phalcon_Utils
  1945. *
  1946. * Implements functionality used widely by the framework
  1947. */
  1948. class Phalcon_Utils
  1949. {
  1950. /**
  1951. * This function is now deprecated, use Phalcon_Text::camelize instead
  1952. *
  1953. * @param string $str
  1954. * @return string
  1955. */
  1956. public static function camelize($str){
  1957. }
  1958. /**
  1959. * This function is now deprecated, use Phalcon_Text::uncamelize instead
  1960. *
  1961. * @param string $str
  1962. * @return string
  1963. */
  1964. public static function uncamelize($str){
  1965. }
  1966. /**
  1967. * This function is now deprecated, use Phalcon_Text::lcfirst instead
  1968. *
  1969. * @param string $str
  1970. * @return string
  1971. */
  1972. public static function lcfirst($str){
  1973. }
  1974. /**
  1975. * Gets public URL to phalcon instance
  1976. *
  1977. * @param string $uri
  1978. * @return string
  1979. */
  1980. public static function getUrl($uri=''){
  1981. }
  1982. /**
  1983. * Gets path to local file
  1984. *
  1985. * @param string $extraPath
  1986. * @return string
  1987. */
  1988. public static function getLocalPath($extraPath=''){
  1989. }
  1990. }
  1991. /**
  1992. * Phalcon_View
  1993. *
  1994. * Phalcon_View is a class for working with the "view" portion of the model-view-controller pattern.
  1995. * That is, it exists to help keep the view script separate from the model and controller scripts.
  1996. * It provides a system of helpers, output filters, and variable escaping.
  1997. *
  1998. * <code>
  1999. * //Setting views directory
  2000. * $view = new Phalcon_View();
  2001. * $view->setViewsDir('app/views/');
  2002. *
  2003. * $view->start();
  2004. * //Shows recent posts view (app/views/posts/recent.phtml)
  2005. * $view->render('posts', 'recent');
  2006. * $view->finish();
  2007. *
  2008. * //Printing views output
  2009. * echo $view->getContent();
  2010. * </code>
  2011. */
  2012. class Phalcon_View
  2013. {
  2014. const LEVEL_MAIN_LAYOUT = 5;
  2015. const LEVEL_AFTER_TEMPLATE = 4;
  2016. const LEVEL_LAYOUT = 3;
  2017. const LEVEL_BEFORE_TEMPLATE = 2;
  2018. const LEVEL_ACTION_VIEW = 1;
  2019. const LEVEL_NO_RENDER = 0;
  2020. /**
  2021. * Sets views directory. Depending of your platform, always add a trailing slash or backslash
  2022. *
  2023. * @param string $viewsDir
  2024. */
  2025. public function setViewsDir($viewsDir){
  2026. }
  2027. /**
  2028. * Gets views directory
  2029. *
  2030. * @return string
  2031. */
  2032. public function getViewsDir(){
  2033. }
  2034. /**
  2035. * Sets base path. Depending of your platform, always add a trailing slash or backslash
  2036. */
  2037. public function setBasePath($basePath){
  2038. }
  2039. /**
  2040. * Sets the render level for the view
  2041. *
  2042. * @param string $level
  2043. */
  2044. public function setRenderLevel($level){
  2045. }
  2046. /**
  2047. * Sets default view name. Must be a file without extension in the views directory
  2048. *
  2049. * @param string $name
  2050. */
  2051. public function setMainView($viewPath){
  2052. }
  2053. /**
  2054. * Appends template before controller layout
  2055. *
  2056. * @param string|array $templateBefore
  2057. */
  2058. public function setTemplateBefore($templateBefore){
  2059. }
  2060. /**
  2061. * Resets any template before layouts
  2062. *
  2063. */
  2064. public function cleanTemplateBefore(){
  2065. }
  2066. /**
  2067. * Appends template after controller layout
  2068. *
  2069. * @param string|array $templateAfter
  2070. */
  2071. public function setTemplateAfter($templateAfter){
  2072. }
  2073. /**
  2074. * Resets any template before layouts
  2075. *
  2076. */
  2077. public function cleanTemplateAfter(){
  2078. }
  2079. /**
  2080. * Adds parameters to views (alias of setVar)
  2081. *
  2082. * @param string $key
  2083. * @param mixed $value
  2084. */
  2085. public function setParamToView($key, $value){
  2086. }
  2087. /**
  2088. * Adds parameters to views
  2089. *
  2090. * @param string $key
  2091. * @param mixed $value
  2092. */
  2093. public function setVar($key, $value){
  2094. }
  2095. /**
  2096. * Returns parameters to views
  2097. *
  2098. * @return array
  2099. */
  2100. public function getParamsToView(){
  2101. }
  2102. /**
  2103. * Gets the name of the controller rendered
  2104. *
  2105. * @return string
  2106. */
  2107. public function getControllerName(){
  2108. }
  2109. /**
  2110. * Gets the name of the action rendered
  2111. *
  2112. * @return string
  2113. */
  2114. public function getActionName(){
  2115. }
  2116. /**
  2117. * Gets extra parameters of the action rendered
  2118. */
  2119. public function getParams(){
  2120. }
  2121. /**
  2122. * Starts rendering process
  2123. */
  2124. public function start(){
  2125. }
  2126. /**
  2127. * Loads registered template engines, if none is registered use Phalcon_View_Engine_Php
  2128. *
  2129. * @return array
  2130. */
  2131. protected function _loadTemplateEngines(){
  2132. }
  2133. /**
  2134. * Checks whether view exists on registered extensions and render it
  2135. */
  2136. protected function _engineRender($engines, $viewPath, $silence){
  2137. }
  2138. /**
  2139. * Register templating engines
  2140. *
  2141. * @param array $engines
  2142. */
  2143. public function registerEngines($engines){
  2144. }
  2145. /**
  2146. * Executes render process from request data
  2147. *
  2148. * @param string $controllerName
  2149. * @param string $actionName
  2150. * @param array $params
  2151. */
  2152. public function render($controllerName, $actionName, $params=array ()){
  2153. }
  2154. /**
  2155. * Renders a partial view
  2156. *
  2157. * @param string $partialPath
  2158. */
  2159. public function partial($partialPath){
  2160. }
  2161. /**
  2162. * Finishes the render process
  2163. */
  2164. public function finish(){
  2165. }
  2166. /**
  2167. * Set externally the view content
  2168. *
  2169. * @param string $content
  2170. */
  2171. public function setContent($content){
  2172. }
  2173. /**
  2174. * Returns cached ouput on another view stage
  2175. *
  2176. * @return string
  2177. */
  2178. public function getContent(){
  2179. }
  2180. }
  2181. /**
  2182. * Phalcon_Acl_Exception
  2183. *
  2184. * Class for exceptions thrown by Phalcon_Acl
  2185. */
  2186. class Phalcon_Acl_Exception extends Php_Exception
  2187. {
  2188. final private function __clone(){
  2189. }
  2190. public function __construct($message, $code, $previous){
  2191. }
  2192. final public function getMessage(){
  2193. }
  2194. final public function getCode(){
  2195. }
  2196. final public function getFile(){
  2197. }
  2198. final public function getLine(){
  2199. }
  2200. final public function getTrace(){
  2201. }
  2202. final public function getPrevious(){
  2203. }
  2204. final public function getTraceAsString(){
  2205. }
  2206. public function __toString(){
  2207. }
  2208. }
  2209. /**
  2210. *
  2211. * Phalcon_Acl_Resource
  2212. *
  2213. * This class defines resource entity and its description
  2214. *
  2215. */
  2216. class Phalcon_Acl_Resource
  2217. {
  2218. /**
  2219. * Phalcon_Acl_Resource description
  2220. *
  2221. * @param string $name
  2222. * @param string $description
  2223. */
  2224. public function __construct($name, $description=NULL){
  2225. }
  2226. /**
  2227. * Returns the resource name
  2228. *
  2229. * @return string
  2230. */
  2231. public function getName(){
  2232. }
  2233. /**
  2234. * Returns resource description
  2235. *
  2236. * @return string
  2237. */
  2238. public function getDescription(){
  2239. }
  2240. }
  2241. /**
  2242. *
  2243. * Phalcon_Acl_Role
  2244. *
  2245. * This class defines role entity and its description
  2246. *
  2247. */
  2248. class Phalcon_Acl_Role
  2249. {
  2250. /**
  2251. * Phalcon_Acl_Role description
  2252. *
  2253. * @param string $name
  2254. * @param string $description
  2255. */
  2256. public function __construct($name, $description=''){
  2257. }
  2258. /**
  2259. * Returns the role name
  2260. *
  2261. * @return string
  2262. */
  2263. public function getName(){
  2264. }
  2265. /**
  2266. * Returns role description
  2267. *
  2268. * @return string
  2269. */
  2270. public function getDescription(){
  2271. }
  2272. }
  2273. /**
  2274. * Phalcon_Acl_Adapter_Memory
  2275. *
  2276. * Manages ACL lists in memory
  2277. */
  2278. class Phalcon_Acl_Adapter_Memory
  2279. {
  2280. /**
  2281. * Permisos de la Lista de Acceso
  2282. *
  2283. * @var array
  2284. */
  2285. public $_access;
  2286. /**
  2287. * Sets the default access level (Phalcon_Acl::ALLOW or Phalcon_Acl::DENY)
  2288. */
  2289. public function setDefaultAction($defaultAccess){
  2290. }
  2291. /**
  2292. * Returns the default ACL access level
  2293. */
  2294. public function getDefaultAction(){
  2295. }
  2296. /**
  2297. * Adds a role to the ACL list. Second parameter lets to inherit access data from other existing role
  2298. *
  2299. * Example:
  2300. * <code>$acl->addRole(new Phalcon_Acl_Role('administrator'), 'consultor');</code>
  2301. * <code>$acl->addRole('administrator', 'consultor');</code>
  2302. *
  2303. * @param string $roleObject
  2304. * @param array $accessInherits
  2305. * @return boolean
  2306. */
  2307. public function addRole($roleObject, $accessInherits=NULL){
  2308. }
  2309. /**
  2310. * Do a role inherit from another existing role
  2311. *
  2312. * @param string $roleName
  2313. * @param string $roleToInherit
  2314. */
  2315. public function addInherit($roleName, $roleToInherit){
  2316. }
  2317. /**
  2318. * Check whether role exist in the roles list
  2319. *
  2320. * @pa…

Large files files are truncated, but you can click here to view the full file