├── .gitignore ├── LICENSE ├── README.md ├── composer.json ├── src ├── Fastdfs_client │ ├── FastDFS.php │ ├── FastDFSException.php │ └── fastdfs_client.php ├── Msgpack │ ├── MessagePack.php │ ├── MessagePackUnpacker.php │ └── msgpack.php ├── Redis │ ├── Redis.php │ ├── RedisArray.php │ ├── RedisCluster.php │ ├── RedisClusterException.php │ └── RedisException.php ├── Seaslog │ └── SeasLog.php ├── Swoole │ ├── Async.php │ ├── Atomic.php │ ├── Atomic │ │ └── Long.php │ ├── Buffer.php │ ├── Chan.php │ ├── Channel.php │ ├── Client.php │ ├── Co.php │ ├── Co │ │ ├── Http │ │ │ ├── Client.php │ │ │ └── Server.php │ │ ├── Http2 │ │ │ └── Client.php │ │ ├── MySQL.php │ │ ├── Redis.php │ │ ├── Redis │ │ │ └── Server.php │ │ ├── Server.php │ │ └── WebSocket │ │ │ └── Server.php │ ├── Connection │ │ └── Iterator.php │ ├── Coroutine.php │ ├── Coroutine │ │ ├── Channel.php │ │ ├── Client.php │ │ ├── Http │ │ │ └── Client.php │ │ ├── Http2 │ │ │ ├── Client.php │ │ │ └── Request.php │ │ ├── Iterator.php │ │ ├── MySQL.php │ │ ├── MySQL │ │ │ ├── Exception.php │ │ │ └── Statement.php │ │ ├── PostgreSQL.php │ │ ├── Redis.php │ │ ├── Socket.php │ │ └── Socket │ │ │ └── Exception.php │ ├── Event.php │ ├── Exception.php │ ├── ExitException.php │ ├── Http │ │ ├── Client.php │ │ ├── Request.php │ │ ├── Response.php │ │ └── Server.php │ ├── Http2 │ │ ├── Client.php │ │ ├── Request.php │ │ └── Response.php │ ├── Lock.php │ ├── Memory │ │ ├── Pool.php │ │ └── Pool │ │ │ └── Slice.php │ ├── Mmap.php │ ├── MsgQueue.php │ ├── MySQL.php │ ├── MySQL │ │ └── Exception.php │ ├── Process.php │ ├── Process │ │ └── Pool.php │ ├── Redis.php │ ├── Redis │ │ └── Server.php │ ├── RingQueue.php │ ├── Runtime.php │ ├── Serialize.php │ ├── Server.php │ ├── Server │ │ └── Port.php │ ├── Table.php │ ├── Table │ │ └── Row.php │ ├── Timer.php │ ├── WebSocket │ │ ├── CloseFrame.php │ │ ├── Frame.php │ │ └── Server.php │ ├── swoole.namespace.php │ ├── swoole.php │ ├── swoole_async.php │ ├── swoole_atomic.php │ ├── swoole_atomic_long.php │ ├── swoole_buffer.php │ ├── swoole_channel.php │ ├── swoole_client.php │ ├── swoole_connection_iterator.php │ ├── swoole_coroutine.php │ ├── swoole_event.php │ ├── swoole_exception.php │ ├── swoole_http2_client.php │ ├── swoole_http2_response.php │ ├── swoole_http_client.php │ ├── swoole_http_request.php │ ├── swoole_http_response.php │ ├── swoole_http_server.php │ ├── swoole_lock.php │ ├── swoole_mmap.php │ ├── swoole_msgqueue.php │ ├── swoole_mysql.php │ ├── swoole_mysql_exception.php │ ├── swoole_process.php │ ├── swoole_process_pool.php │ ├── swoole_redis.php │ ├── swoole_redis_server.php │ ├── swoole_ringqueue.php │ ├── swoole_serialize.php │ ├── swoole_server.php │ ├── swoole_server_port.php │ ├── swoole_table.php │ ├── swoole_table_row.php │ ├── swoole_timer.php │ ├── swoole_websocke_closet_frame.php │ ├── swoole_websocket_frame.php │ └── swoole_websocket_server.php ├── Xhprof │ └── xhprof.php ├── Yac │ └── Yac.php ├── Yaconf │ └── Yaconf.php ├── Yaf │ ├── Action_Abstract.php │ ├── Application.php │ ├── Bootstrap_Abstract.php │ ├── Config │ │ ├── Ini.php │ │ └── Simple.php │ ├── Config_Abstract.php │ ├── Controller_Abstract.php │ ├── Dispatcher.php │ ├── Exception.php │ ├── Exception │ │ ├── DispatchFailed.php │ │ ├── LoadFailed.php │ │ ├── LoadFailed │ │ │ ├── Action.php │ │ │ ├── Controller.php │ │ │ ├── Module.php │ │ │ └── View.php │ │ ├── RouterFailed.php │ │ ├── StartupError.php │ │ └── TypeError.php │ ├── Loader.php │ ├── Plugin_Abstract.php │ ├── Registry.php │ ├── Request │ │ ├── Http.php │ │ └── Simple.php │ ├── Request_Abstract.php │ ├── Response │ │ ├── Cli.php │ │ └── Http.php │ ├── Response_Abstract.php │ ├── Route │ │ ├── Map.php │ │ ├── Regex.php │ │ ├── Rewrite.php │ │ ├── Simple.php │ │ └── Supervar.php │ ├── Route_Interface.php │ ├── Route_Static.php │ ├── Router.php │ ├── Session.php │ ├── View │ │ └── Simple.php │ ├── View_Interface.php │ ├── Yaf_Action_Abstract.php │ ├── Yaf_Application.php │ ├── Yaf_Bootstrap_Abstract.php │ ├── Yaf_Config_Abstract.php │ ├── Yaf_Config_Ini.php │ ├── Yaf_Config_Simple.php │ ├── Yaf_Controller_Abstract.php │ ├── Yaf_Dispatcher.php │ ├── Yaf_Exception.php │ ├── Yaf_Exception_DispatchFailed.php │ ├── Yaf_Exception_LoadFailed.php │ ├── Yaf_Exception_LoadFailed_Action.php │ ├── Yaf_Exception_LoadFailed_Controller.php │ ├── Yaf_Exception_LoadFailed_Module.php │ ├── Yaf_Exception_LoadFailed_View.php │ ├── Yaf_Exception_RouterFailed.php │ ├── Yaf_Exception_StartupError.php │ ├── Yaf_Exception_TypeError.php │ ├── Yaf_Loader.php │ ├── Yaf_Plugin_Abstract.php │ ├── Yaf_Registry.php │ ├── Yaf_Request_Abstract.php │ ├── Yaf_Request_Http.php │ ├── Yaf_Request_Simple.php │ ├── Yaf_Response_Abstract.php │ ├── Yaf_Response_Cli.php │ ├── Yaf_Response_Http.php │ ├── Yaf_Route_Interface.php │ ├── Yaf_Route_Map.php │ ├── Yaf_Route_Regex.php │ ├── Yaf_Route_Rewrite.php │ ├── Yaf_Route_Simple.php │ ├── Yaf_Route_Static.php │ ├── Yaf_Route_Supervar.php │ ├── Yaf_Router.php │ ├── Yaf_Session.php │ ├── Yaf_View_Interface.php │ ├── Yaf_View_Simple.php │ ├── yaf.namespace.php │ └── yaf.php └── Yar │ ├── Yar.php │ ├── Yar_Client.php │ ├── Yar_Client_Exception.php │ ├── Yar_Client_Packager_Exception.php │ ├── Yar_Client_Protocol_Exception.php │ ├── Yar_Client_Transport_Exception.php │ ├── Yar_Concurrent_Client.php │ ├── Yar_Server.php │ ├── Yar_Server_Exception.php │ ├── Yar_Server_Output_Exception.php │ ├── Yar_Server_Packager_Exception.php │ ├── Yar_Server_Protocol_Exception.php │ └── Yar_Server_Request_Exception.php ├── static └── images │ ├── step1.png │ ├── step2.png │ └── yaf.auto.complete.png └── tests └── swoole-project ├── composer.json └── test.php /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | .idea 3 | 4 | /vendor/ 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # php-ide-helper 2 | 3 | php framework and php extension Auto Compelete for phpstorm 4 | 5 | Yaf、Yar、Yac、Yaconf、Redis、Swoole等框架或C扩展之PhpStrom代码自动补全(屏蔽IDE undefined,全命名空间,中文详细文档,比手册更详细) 6 | 这个想法fork自phpboy(https://github.com/xudianyang/yaf.auto.complete) 7 | 8 | ## 原理 9 | 10 | 项目中先包含写好的相关的框架的PHP类文件(相当于本地类,因为ya*系列都是使用C语言写的PHP扩展,通过PHP将其定义出来引用),编辑器即可在使用这些类的时候自动定位其定义的用法 11 | 12 | ## 目前支持的框架或扩展 13 | 14 | 1、Yaf(3.0.7) 15 | 16 | 2、Yac(2.0.3-dev) 17 | 18 | 3、Yaconf(1.0.8-dev) 19 | 20 | 4、Yar(2.0.4) 21 | 22 | 5、phpRedis(包括RedisCluster,支持phpredis 5.1.1) 23 | 24 | 6、swoole扩展(支持swoole 4.2.9) 25 | 26 | 7、SeasLog(1.8.5) 27 | 28 | 8、MsgPack(beta) 29 | 30 | 9、Xhprof 31 | 32 | 10、FastDFS(FastDFS 1.00) 33 | 34 | ## 使用说明 35 | 36 | #### 一.支持composer的项目通过composer安装 37 | 38 | ##### 1.在项目的composer配置文件composer.json中的require-dev段添加以下内容 39 | ``` 40 | "require-dev": { 41 | "shixinke/php-ide-helper":"dev-master" 42 | } 43 | ``` 44 | 45 | ##### 2.通过composer install安装包 46 | 47 | ``` 48 | composer install 49 | ``` 50 | 51 | #### 二.不支持composer的项目安装 52 | 53 | 1、下载源文件并解压,将src文件夹下面的内容放到任意一个位置(我习惯将它放到我的phpstorm安装路径下的plugins\php\lib下面,然后建立一个vendor文件夹,如C:\Program Files (x86)\JetBrains\PhpStorm 9.0.2\plugins\php\lib\vendor) 54 | 55 | 2、打开phpstorm,选择File->Settings,打开setting控制面板 56 | 57 | ![phpstorm设置第一步](https://github.com/shixinke/phpstorm-for-php-framework/blob/master/static/images/step1.png) 58 | 59 | 60 | 3、在setting控制面板中,选择Languages & Frameworks->PHP,点击PHP面板右侧的加号按钮,将第1步放置的类文件包含进来即可 61 | 62 | ![phpstorm设置第二步](https://github.com/shixinke/phpstorm-for-php-framework/blob/master/static/images/step2.png) 63 | 64 | 65 | ## 示例 66 | 67 | ![phpstorm自动补全效果](https://github.com/shixinke/phpstorm-for-php-framework/blob/master/static/images/yaf.auto.complete.png) 68 | 69 | ## 其他说明 70 | 71 | 此次php源码文档由[php-document-creator](http://github.com/shixinke/php-document-creator) 生成,它可以生成任何PHP扩展的源码文档 72 | 73 | ## 作者 74 | 75 | shixinke 76 | 77 | 邮箱: 78 | 79 | 博客: 80 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shixinke/php-ide-helper", 3 | "description": "a tool that provides auto-completion for php frameworks and extensions", 4 | "type": "library", 5 | "keywords": [ 6 | "php", 7 | "ide-helper", 8 | "phpstorm-helper", 9 | "swoole-ide-helper" 10 | ], 11 | "license": "Apache-2.0", 12 | "authors": [ 13 | { 14 | "name": "shixinke", 15 | "email": "ishixinke@qq.com" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=7.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Fastdfs_client/FastDFSException.php: -------------------------------------------------------------------------------- 1 | 0, 81 | 'queue_bytes'=>0 82 | ]; 83 | } 84 | 85 | } 86 | 87 | -------------------------------------------------------------------------------- /src/Swoole/Connection/Iterator.php: -------------------------------------------------------------------------------- 1 | lock一致,但lockwait可以设置超时时间 84 | * @example 85 | * @param float $timeout 超时时间 86 | * @return 87 | */ 88 | public function lockwait(float $timeout) 89 | { 90 | 91 | } 92 | 93 | /** 94 | * 95 | *非阻塞的加锁操作 96 | * @example 97 | * @return 98 | */ 99 | public function trylock() 100 | { 101 | 102 | } 103 | 104 | /** 105 | * 106 | *锁定读 107 | * @example 108 | * @return 109 | */ 110 | public function lock_read() 111 | { 112 | 113 | } 114 | 115 | /** 116 | * 117 | *非阻塞式锁定读 118 | * @example 119 | * @return 120 | */ 121 | public function trylock_read() 122 | { 123 | 124 | } 125 | 126 | /** 127 | * 128 | *释放锁操作 129 | * @example 130 | * @return 131 | */ 132 | public function unlock() 133 | { 134 | 135 | } 136 | 137 | } 138 | 139 | -------------------------------------------------------------------------------- /src/Swoole/Memory/Pool.php: -------------------------------------------------------------------------------- 1 | 0, 80 | 'queue_bytes'=>0 81 | ]; 82 | } 83 | 84 | } 85 | 86 | -------------------------------------------------------------------------------- /src/Swoole/swoole_connection_iterator.php: -------------------------------------------------------------------------------- 1 | lock一致,但lockwait可以设置超时时间 83 | * @example 84 | * @param float $timeout 超时时间 85 | * @return 86 | */ 87 | public function lockwait(float $timeout) 88 | { 89 | 90 | } 91 | 92 | /** 93 | * 94 | *非阻塞的加锁操作 95 | * @example 96 | * @return 97 | */ 98 | public function trylock() 99 | { 100 | 101 | } 102 | 103 | /** 104 | * 105 | *锁定读 106 | * @example 107 | * @return 108 | */ 109 | public function lock_read() 110 | { 111 | 112 | } 113 | 114 | /** 115 | * 116 | *非阻塞式锁定读 117 | * @example 118 | * @return 119 | */ 120 | public function trylock_read() 121 | { 122 | 123 | } 124 | 125 | /** 126 | * 127 | *释放锁操作 128 | * @example 129 | * @return 130 | */ 131 | public function unlock() 132 | { 133 | 134 | } 135 | 136 | } 137 | 138 | -------------------------------------------------------------------------------- /src/Swoole/swoole_mmap.php: -------------------------------------------------------------------------------- 1 | array('call_user_func', 'call_user_func_array')) 39 | * ); 40 | * @param int $flags 41 | * @param array $options 42 | * @return 43 | */ 44 | function xhprof_enable($flags, Array $options) 45 | { 46 | } 47 | 48 | /** 49 | * 50 | *分析结束(即打标结束) 51 | * @example 52 | * 53 | * @return 54 | */ 55 | function xhprof_disable() 56 | { 57 | } 58 | 59 | /** 60 | * 61 | *采样开始 62 | * @example 63 | * 64 | * @return 65 | */ 66 | function xhprof_sample_enable() 67 | { 68 | } 69 | 70 | /** 71 | * 72 | *采样结束 73 | * @example 74 | * 75 | * @return 76 | */ 77 | function xhprof_sample_disable() 78 | { 79 | } 80 | 81 | -------------------------------------------------------------------------------- /src/Yaconf/Yaconf.php: -------------------------------------------------------------------------------- 1 | =7.0" 11 | }, 12 | "require-dev":{ 13 | "shixinke/php-ide-helper":"dev-master" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/swoole-project/test.php: -------------------------------------------------------------------------------- 1 |