├── README.md ├── sixstar ├── Laravel │ ├── 1facade │ │ ├── Client.php │ │ ├── Function1.php │ │ ├── Function2.php │ │ └── Facade.php │ ├── 2ioc │ │ └── IoC.php │ └── 6adapter │ │ └── adapter.php └── redis │ ├── composer.json │ └── redis.php ├── daimashengji ├── README.md ├── 2.php ├── 3.php ├── 1.php └── 4.php ├── phphexinjishuyuzuijiashijian ├── a.txt ├── php_list │ ├── list.h │ ├── CREDITS │ ├── EXPERIMENTAL │ ├── config.w32 │ ├── php_list.php │ └── tests │ │ └── 001.phpt ├── README.md ├── .DS_Store ├── dbtest.idx ├── post_output.php ├── 7.php ├── 6.php ├── 8.php ├── template │ └── member.m ├── cache │ └── aa08769cdcb26674c6706093503ff0a3.php ├── 5.php ├── 10.php ├── 10worker.php ├── 3_1socketserver.php └── 4.php ├── 枕边算法 ├── 1.4.php ├── 3.2.php ├── 3.1.php ├── 1.6.php └── 1.7.php ├── phpunit ├── data.csv ├── phpunit.xml ├── 5_1tests │ ├── phpunit.xml │ └── StackTest4.php ├── SomeClass9_1.php ├── 8_1test │ ├── phpunit.xml │ └── Generic_Tests_DatabaseTestCase8_3.php ├── composer.json ├── DatabaseTest7_3.php ├── DependencyFailureTest.php ├── SampleTest7_1.php ├── ExpectedErrorTest.php ├── Database4_3.php ├── DatabaseTest7_2.php ├── OutputTest.php ├── Example9_5.php ├── ExceptionTest.php ├── ErrorSuppressionTest.php ├── MyGuestbookTest8_1.php ├── TraitClassTest9_3.php ├── MultipleDependenciesTest.php ├── AbstractClassTest9_3.php ├── StackTest4.php ├── DataTest.php ├── ExampleTest9_5.php ├── MyApp_Tests_DatabaseTestCase8_2.php ├── CsvFileIterator.php └── DependencyAndDataProviderComboTest.php ├── shenrulijiephp ├── 2 │ ├── .htaccess │ ├── footer.html │ ├── search.inc.php │ └── index.php ├── 3 │ └── sessions.php ├── 5 │ └── square.php ├── 6 │ ├── Shape.php │ ├── trait.php │ ├── hinting2.php │ ├── abstract.php │ ├── tDebug.php │ ├── Company.php │ ├── hinting.php │ └── Triangle.php ├── 7 │ ├── Shape.php │ ├── sigleton.php │ ├── ShapFactory.php │ ├── composite.php │ ├── factory.php │ ├── Config.php │ ├── tDebug.php │ └── Triangle.php ├── 8 │ ├── data.txt │ ├── write_to_file.php │ ├── write_to_file2.php │ ├── write_to_file3.php │ └── factory.php ├── 9 │ ├── images │ │ ├── .DS_Store │ │ ├── book.png │ │ ├── logo-bg.png │ │ └── header-bg.png │ ├── css │ │ ├── fonts │ │ │ ├── amble-regular-webfont.eot │ │ │ ├── amble-regular-webfont.ttf │ │ │ ├── amble-regular-webfont.woff │ │ │ └── fonts.css │ │ └── ie6-7.css │ ├── views │ │ ├── logout.html │ │ ├── index.html │ │ ├── page.html │ │ ├── error.html │ │ ├── add_page.html │ │ └── login.html │ ├── js │ │ └── custom-jquery.js │ ├── logout.php │ ├── includes │ │ └── utilities.inc.php │ └── index.php ├── 10 │ ├── curl.php │ ├── ip_geo.php │ ├── get_quote.php │ └── service.php ├── 11 │ ├── set_mcrypt.php │ └── read_mcrypt.php ├── 12 │ ├── number2.php │ └── temperature.php ├── 13 │ └── books4.xml ├── 14 │ ├── .DS_Store │ ├── composer.json │ └── RectangleTest.php ├── .DS_Store ├── 1-2.php └── 1.php ├── laravelkuangjiaguanjianjishujiexi ├── 3 │ ├── 3.4.php │ ├── file1.php │ ├── file2.php │ └── 3.5.php ├── 6 │ └── 6.1.1.php ├── laravel │ ├── public │ │ ├── favicon.ico │ │ ├── robots.txt │ │ ├── .htaccess │ │ └── web.config │ ├── storage │ │ ├── logs │ │ │ └── .gitignore │ │ ├── app │ │ │ ├── public │ │ │ │ └── .gitignore │ │ │ └── .gitignore │ │ └── framework │ │ │ ├── cache │ │ │ └── .gitignore │ │ │ ├── views │ │ │ └── .gitignore │ │ │ ├── sessions │ │ │ └── .gitignore │ │ │ └── testing │ │ │ └── .gitignore │ ├── bootstrap │ │ ├── cache │ │ │ └── .gitignore │ │ └── autoload.php │ ├── .gitattributes │ ├── tests │ │ ├── TestCase.php │ │ ├── Unit │ │ │ └── ExampleTest.php │ │ ├── CreatesApplication.php │ │ └── Feature │ │ │ └── ExampleTest.php │ ├── resources │ │ ├── assets │ │ │ ├── sass │ │ │ │ ├── app.scss │ │ │ │ └── _variables.scss │ │ │ └── js │ │ │ │ ├── app.js │ │ │ │ └── components │ │ │ │ └── Example.vue │ │ ├── views │ │ │ └── backyard │ │ │ │ ├── include │ │ │ │ └── sidebar.blade.php │ │ │ │ ├── notes │ │ │ │ └── show.blade.php │ │ │ │ └── index │ │ │ │ └── index.blade.php │ │ └── lang │ │ │ └── en │ │ │ ├── pagination.php │ │ │ ├── auth.php │ │ │ └── passwords.php │ ├── database │ │ ├── seeds │ │ │ └── DatabaseSeeder.php │ │ └── factories │ │ │ └── ModelFactory.php │ ├── app │ │ ├── Http │ │ │ ├── Middleware │ │ │ │ ├── EncryptCookies.php │ │ │ │ ├── VerifyCsrfToken.php │ │ │ │ ├── TrimStrings.php │ │ │ │ └── RedirectIfAuthenticated.php │ │ │ └── Controllers │ │ │ │ ├── Controller.php │ │ │ │ └── Auth │ │ │ │ ├── ForgotPasswordController.php │ │ │ │ ├── LoginController.php │ │ │ │ ├── ResetPasswordController.php │ │ │ │ └── WebAuthController.php │ │ ├── Providers │ │ │ ├── BroadcastServiceProvider.php │ │ │ ├── AppServiceProvider.php │ │ │ ├── AuthServiceProvider.php │ │ │ └── EventServiceProvider.php │ │ ├── User.php │ │ ├── Models │ │ │ └── Users.php │ │ └── Console │ │ │ └── Kernel.php │ ├── routes │ │ ├── channels.php │ │ ├── api.php │ │ ├── console.php │ │ └── web.php │ ├── webpack.mix.js │ ├── .env.example │ ├── server.php │ ├── config │ │ ├── view.php │ │ └── services.php │ ├── phpunit.xml │ └── package.json └── lara │ ├── public │ └── resource │ │ └── views │ │ └── welcome.blade.php │ ├── composer.json │ ├── app │ ├── Models │ │ └── Student.php │ └── Http │ │ └── routes.php │ └── config │ └── database.php ├── modernphp ├── stream.txt ├── .DS_Store ├── urls.csv ├── .travis.yml ├── tests │ └── bootstrap.php ├── composer.json ├── src │ ├── Baz │ │ └── Qux.php │ └── Whovian.php ├── phpunit.xml ├── ex6.php ├── ex3.php ├── ex5.php └── ex2.php ├── .gitignore ├── .DS_Store ├── phpbianchengshizhan ├── qbf.txt ├── .DS_Store ├── image.jpg ├── thumb.png ├── animals.phar ├── scott.sqlite ├── 3.php ├── 4-1.php ├── stub.php ├── composer.json ├── domestic.php ├── 14.php └── wild.php ├── phpprogramming ├── .DS_Store ├── fpdf181 │ ├── tutorial │ │ ├── logo.png │ │ ├── 20k_c1.txt │ │ ├── calligra.z │ │ ├── calligra.ttf │ │ ├── makefont.php │ │ ├── tuto1.php │ │ ├── tuto7.php │ │ ├── countries.txt │ │ ├── index.htm │ │ └── tuto2.php │ ├── license.txt │ ├── font │ │ ├── courier.php │ │ ├── courierb.php │ │ ├── courieri.php │ │ └── courierbi.php │ ├── doc │ │ ├── pageno.htm │ │ ├── getpagewidth.htm │ │ ├── getpageheight.htm │ │ ├── getx.htm │ │ ├── gety.htm │ │ ├── setfontsize.htm │ │ ├── getstringwidth.htm │ │ ├── close.htm │ │ ├── ln.htm │ │ ├── setx.htm │ │ ├── error.htm │ │ ├── settopmargin.htm │ │ ├── setrightmargin.htm │ │ ├── addlink.htm │ │ ├── setlinewidth.htm │ │ ├── setxy.htm │ │ ├── setleftmargin.htm │ │ ├── line.htm │ │ ├── sety.htm │ │ ├── setcompression.htm │ │ ├── settitle.htm │ │ ├── setsubject.htm │ │ ├── setauthor.htm │ │ ├── setlink.htm │ │ ├── setkeywords.htm │ │ ├── setcreator.htm │ │ ├── setmargins.htm │ │ └── setautopagebreak.htm │ └── install.txt └── 10.php ├── swoole ├── reload.sh ├── 3-sql.txt ├── reload_page.php ├── httpserver.php ├── websocketserver.php ├── 1-Client.php ├── 5-Client-EOF.php └── 5-Server-HTTP.php ├── LearningPHPDesignPatterns ├── 1factory │ ├── Product.php │ ├── 参数工厂 │ │ ├── Product.php │ │ ├── Creator.php │ │ ├── TextProduct.php │ │ ├── GraphicProduct.php │ │ ├── CountryFactory.php │ │ └── Client.php │ ├── Creator.php │ ├── TextFactory.php │ ├── GraphicFactory.php │ ├── TextProduct.php │ ├── GraphicProduct.php │ └── Client.php ├── 10proxy │ └── proxy.php ├── 6prototype │ └── prototype.php ├── 18templatemethod │ └── template-method.php ├── 19singleton │ └── singleton.php ├── 9chainofresponsibility │ └── chain.php ├── 16bridge │ └── bridge.php ├── 7command │ └── command.php ├── 8strategy │ └── strategy.php └── 20state │ └── state.php ├── phpinfo.php ├── shenruphpmianxiangduixiangmoshiyushijian ├── .DS_Store ├── composer.json ├── 12.php └── 9.php ├── phpcookbook ├── 20170311.php ├── 20170306.php └── 20170305.php ├── mytools ├── 数字转英文字母组合(Excel列).php ├── 文字所有组合.php ├── 数组对象转换.php └── 字符中间加星号中英文.php ├── 面试题 ├── 数组交集.php └── zhugezhaofang.php └── learningphp7highperformance └── 2 └── 2.1.php /README.md: -------------------------------------------------------------------------------- 1 | # zhangyue的php练习代码库 2 | -------------------------------------------------------------------------------- /sixstar/Laravel/1facade/Client.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /daimashengji/README.md: -------------------------------------------------------------------------------- 1 | # 代码审计企业级web代码安全架构 2 | -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/a.txt: -------------------------------------------------------------------------------- 1 | it's empty now -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/php_list/list.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /枕边算法/1.4.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/php_list/CREDITS: -------------------------------------------------------------------------------- 1 | php_list -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/php_list/EXPERIMENTAL: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /phpunit/data.csv: -------------------------------------------------------------------------------- 1 | 0,0,0 2 | 0,1,1 3 | 1,0,1 4 | 1,1,3 -------------------------------------------------------------------------------- /shenrulijiephp/8/data.txt: -------------------------------------------------------------------------------- 1 | This is a line of data.\n -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modernphp/stream.txt: -------------------------------------------------------------------------------- 1 | aaa 2 | bbb 3 | ccc 4 | ddd 5 | aaagrimebbb -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/README.md: -------------------------------------------------------------------------------- 1 | # php核心技术与最佳实践练习代码 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gitignore 3 | */vendor 4 | *vendor 5 | *backups -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyue0503/php/HEAD/.DS_Store -------------------------------------------------------------------------------- /phpbianchengshizhan/qbf.txt: -------------------------------------------------------------------------------- 1 | quick brown fox 2 | jumps over 3 | the lazy dog -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /modernphp/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyue0503/php/HEAD/modernphp/.DS_Store -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /modernphp/urls.csv: -------------------------------------------------------------------------------- 1 | http://www.baidu.com 2 | www.jianshenchao.com 3 | http://www.jianshenchao1.com -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /phpprogramming/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyue0503/php/HEAD/phpprogramming/.DS_Store -------------------------------------------------------------------------------- /shenrulijiephp/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyue0503/php/HEAD/shenrulijiephp/.DS_Store -------------------------------------------------------------------------------- /shenrulijiephp/14/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyue0503/php/HEAD/shenrulijiephp/14/.DS_Store -------------------------------------------------------------------------------- /phpbianchengshizhan/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyue0503/php/HEAD/phpbianchengshizhan/.DS_Store -------------------------------------------------------------------------------- /phpbianchengshizhan/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyue0503/php/HEAD/phpbianchengshizhan/image.jpg -------------------------------------------------------------------------------- /phpbianchengshizhan/thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyue0503/php/HEAD/phpbianchengshizhan/thumb.png -------------------------------------------------------------------------------- /swoole/reload.sh: -------------------------------------------------------------------------------- 1 | echo "Reloading..." 2 | cmd=$(pidof reload_master) 3 | 4 | kill -USR1 "$cmd" 5 | echo "Reloaded" -------------------------------------------------------------------------------- /phpbianchengshizhan/animals.phar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyue0503/php/HEAD/phpbianchengshizhan/animals.phar -------------------------------------------------------------------------------- /phpbianchengshizhan/scott.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyue0503/php/HEAD/phpbianchengshizhan/scott.sqlite -------------------------------------------------------------------------------- /shenrulijiephp/9/images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyue0503/php/HEAD/shenrulijiephp/9/images/.DS_Store -------------------------------------------------------------------------------- /shenrulijiephp/9/images/book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyue0503/php/HEAD/shenrulijiephp/9/images/book.png -------------------------------------------------------------------------------- /shenrulijiephp/9/images/logo-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangyue0503/php/HEAD/shenrulijiephp/9/images/logo-bg.png -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/1factory/Product.php: -------------------------------------------------------------------------------- 1 | 在视图中显示学生信息 2 | 学生 id:{{$data['id']}};
3 | 学生 name:{{$data['name']}};
4 | 学生 age:{{$data['age']}};
-------------------------------------------------------------------------------- /phpprogramming/fpdf181/tutorial/makefont.php: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /swoole/reload_page.php: -------------------------------------------------------------------------------- 1 | factoryMethod(); 8 | } 9 | } -------------------------------------------------------------------------------- /shenrulijiephp/9/views/logout.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

You are now logged out.

5 |

Thank you for visiting!

6 |
7 |
8 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/tutorial/tuto1.php: -------------------------------------------------------------------------------- 1 | AddPage(); 6 | $pdf->SetFont('Arial','B',16); 7 | $pdf->Cell(40,10,'Hello World!'); 8 | $pdf->Output(); 9 | ?> 10 | -------------------------------------------------------------------------------- /modernphp/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "league/flysystem": "^1.0", 4 | "guzzlehttp/guzzle": "^6.2", 5 | "league/csv": "^8.1" 6 | }, 7 | "require-dev": { 8 | "phpunit/phpunit": "^5.6" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | dumpObject(); 14 | 15 | unset($r); -------------------------------------------------------------------------------- /shenrulijiephp/14/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "zhangyue/14", 3 | "authors": [ 4 | { 5 | "name": "zhangyue0503", 6 | "email": "zhangyue0503@hotmail.com" 7 | } 8 | ], 9 | "require": { 10 | "phpunit/phpunit": "^5.7" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/lara/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require":{ 3 | "illuminate/routing":"*", 4 | "illuminate/events":"*", 5 | "illuminate/database":"*", 6 | "illuminate/view":"*" 7 | }, 8 | "autoload":{ 9 | "psr-4":{ 10 | "App\\":"app/" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /phpunit/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | StackTest.php 6 | StackTest4.php 7 | 8 | 9 | -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/1factory/参数工厂/Creator.php: -------------------------------------------------------------------------------- 1 | factoryMethod($productNow); 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/resources/assets/sass/app.scss: -------------------------------------------------------------------------------- 1 | 2 | // Fonts 3 | @import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600); 4 | 5 | // Variables 6 | @import "variables"; 7 | 8 | // Bootstrap 9 | @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; 10 | -------------------------------------------------------------------------------- /phpcookbook/20170311.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | StackTest.php 6 | StackTest4.php 7 | 8 | 9 | -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/1factory/参数工厂/TextProduct.php: -------------------------------------------------------------------------------- 1 | mfgProduct = "This is text."; 11 | return $this->mfgProduct; 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /sixstar/redis/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "zhangyue/redis", 3 | "require-dev": { 4 | "predis/predis": "^1.1" 5 | }, 6 | "authors": [ 7 | { 8 | "name": "zhangyue0503", 9 | "email": "zhangyue0503@hotmail.com" 10 | } 11 | ], 12 | "require": {} 13 | } 14 | -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/1factory/TextFactory.php: -------------------------------------------------------------------------------- 1 | getProperties()); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/lara/app/Models/Student.php: -------------------------------------------------------------------------------- 1 | mfgProduct = "This is a graphic.<3"; 11 | return $this->mfgProduct; 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/6.php: -------------------------------------------------------------------------------- 1 | getProperties()); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /phpprogramming/10.php: -------------------------------------------------------------------------------- 1 | addPage(); 12 | 13 | $pdf->setFont("Arial",'B',16); 14 | $pdf->cell(40,10,"Hello Out There!"); 15 | 16 | $pdf->output(); -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/lara/app/Http/routes.php: -------------------------------------------------------------------------------- 1 | get('/',function(){ 9 | return '

路由成功

'; 10 | }); 11 | 12 | $app['router']->get('welcome','App\Http\Controllers\WelcomeController@index'); 13 | -------------------------------------------------------------------------------- /phpbianchengshizhan/3.php: -------------------------------------------------------------------------------- 1 | AddFont('Calligrapher','','calligra.php'); 7 | $pdf->AddPage(); 8 | $pdf->SetFont('Calligrapher','',35); 9 | $pdf->Cell(0,10,'Enjoy new fonts with FPDF!'); 10 | $pdf->Output(); 11 | ?> 12 | -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/1factory/TextProduct.php: -------------------------------------------------------------------------------- 1 | mfgProduct = "This is text."; 13 | return $this->mfgProduct; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/3/3.4.php: -------------------------------------------------------------------------------- 1 | newInstanceArgs(); 17 | $inst->call(); -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/8.php: -------------------------------------------------------------------------------- 1 | addServer('127.0.0.1',11211); 11 | $mc->set('key','value',0,10); 12 | $val = $mc->get('key'); 13 | $mc->delete('key'); 14 | $mc->flush(); 15 | //$mc->close(); -------------------------------------------------------------------------------- /phpunit/8_1test/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /shenrulijiephp/2/.htaccess: -------------------------------------------------------------------------------- 1 | # Script 2.7 - .htaccess 2 | 3 | 4 | # Turn on the engine: 5 | RewriteEngine on 6 | 7 | # Set the base to this directory: 8 | RewriteBase /shenrulijiephp/2/ 9 | 10 | # Redirect certain paths to index.php: 11 | RewriteRule ^(about|contact|this|that|search)/?$ index.php?p=$1 12 | 13 | -------------------------------------------------------------------------------- /daimashengji/2.php: -------------------------------------------------------------------------------- 1 | mfgProduct = "This is a graphic.<3"; 13 | return $this->mfgProduct; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /phpbianchengshizhan/4-1.php: -------------------------------------------------------------------------------- 1 | get_type()); 12 | $b = new \wild\animal(); 13 | printf("%s\n",$b->get_type()); 14 | 15 | -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/1factory/参数工厂/CountryFactory.php: -------------------------------------------------------------------------------- 1 | country = $product; 12 | return ($this->country->getProperties()); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /daimashengji/3.php: -------------------------------------------------------------------------------- 1 | $_value){ 13 | echo $_ken.'
'; 14 | $$_key = addslashes($_value); 15 | } 16 | } 17 | echo $a; -------------------------------------------------------------------------------- /phpprogramming/fpdf181/license.txt: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software to use, copy, modify, distribute, sublicense, and/or sell 3 | copies of the software, and to permit persons to whom the software is furnished 4 | to do so. 5 | 6 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/template/member.m: -------------------------------------------------------------------------------- 1 | 2 | {!like.js} 3 | {$data},{$person} 4 | 5 | 8 | 11 | {if $data=='abc'} 12 | 我是abc 13 | {elseif $data=='def'} 14 | 我是def 15 | {else} 16 | 我就是我,{$data} 17 | {/if} 18 | {#注释不会出现} 19 | 1234660--------------------- 20 | 21 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /phpbianchengshizhan/stub.php: -------------------------------------------------------------------------------- 1 | get_type()); 12 | $b = new \wild\animal(); 13 | printf("%s\n",$b->get_type()); 14 | __HALT_COMPILER(); -------------------------------------------------------------------------------- /mytools/数字转英文字母组合(Excel列).php: -------------------------------------------------------------------------------- 1 | 0) { 12 | $str .= IntToChr(floor($index / 26)-1); 13 | } 14 | return $str . chr($index % 26 + $start); 15 | } 16 | echo IntToChr(120121); -------------------------------------------------------------------------------- /phpunit/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "administrator/phpunit", 3 | "authors": [ 4 | { 5 | "name": "zhangyue", 6 | "email": "zhangyue@dyrs.com.cn" 7 | } 8 | ], 9 | "require": {}, 10 | "require-dev": { 11 | "phpunit/phpunit": "^6.5", 12 | "phpunit/dbunit": "^3.0", 13 | "mikey179/vfsStream": "~1" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/3/file1.php: -------------------------------------------------------------------------------- 1 | "; 13 | } 14 | 15 | class Controller{ 16 | public static function index(){ 17 | echo '命名空间'.__NAMESPACE__."
"; 18 | } 19 | } -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/php_list/config.w32: -------------------------------------------------------------------------------- 1 | // $Id$ 2 | // vim:ft=javascript 3 | 4 | // If your extension references something external, use ARG_WITH 5 | // ARG_WITH("php_list", "for php_list support", "no"); 6 | 7 | // Otherwise, use ARG_ENABLE 8 | // ARG_ENABLE("php_list", "enable php_list support", "no"); 9 | 10 | if (PHP_PHP_LIST != "no") { 11 | EXTENSION("php_list", "php_list.c"); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /modernphp/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | tests 6 | 7 | 8 | 9 | 10 | scr 11 | 12 | 13 | -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/cache/aa08769cdcb26674c6706093503ff0a3.php: -------------------------------------------------------------------------------- 1 | 2 | {!like.js} 3 | {$data},{$person} 4 | 5 | 8 | 11 | 12 | 我是abc 13 | 14 | 我是def 15 | 16 | 我就是我,{$data} 17 | 18 | {#注释不会出现} 19 | 1234660--------------------- 20 | 21 | -------------------------------------------------------------------------------- /sixstar/Laravel/1facade/Facade.php: -------------------------------------------------------------------------------- 1 | obj1 = new Function1(); 11 | $thos->obj2 = new Function2(); 12 | } 13 | 14 | public functio method1(){ 15 | $this->obj1->method1(); 16 | } 17 | } 18 | 19 | $facde = new Facade(); 20 | $facde->method1(); -------------------------------------------------------------------------------- /枕边算法/3.1.php: -------------------------------------------------------------------------------- 1 | $m){ 13 | //当m小于n时,交换 14 | $t = $m; 15 | $m = $n; 16 | $n = $t; 17 | } 18 | 19 | while($n > 0) 20 | { 21 | $r = $m%$n; 22 | $m = $n; 23 | $n = $r; 24 | } 25 | return $m; 26 | } 27 | 28 | echo gcd(129,582); 29 | 30 | -------------------------------------------------------------------------------- /shenrulijiephp/7/sigleton.php: -------------------------------------------------------------------------------- 1 | set('live','true'); 12 | echo '

$CONFIG["live"]:'.$CONFIG->get('live')."

"; 13 | 14 | $TEST = $CONFIG::getInstance(); 15 | echo '

$TEST["live"]:'.$TEST->get('live')."

"; 16 | 17 | unset($CONFIG,$TEST); -------------------------------------------------------------------------------- /phpbianchengshizhan/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "zhangyue/phpbianchengshizhan", 3 | "authors": [ 4 | { 5 | "name": "zhangyue0503", 6 | "email": "zhangyue0503@hotmail.com" 7 | } 8 | ], 9 | "require": { 10 | "simplepie/simplepie": "^1.4", 11 | "tecnickcom/tcpdf": "^6.2", 12 | "phpmailer/phpmailer": "^5.2", 13 | "phpunit/phpunit": "^5.7" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/lara/config/database.php: -------------------------------------------------------------------------------- 1 | 'mysql', 13 | 'host' => 'localhost', 14 | 'database' => 'lara', 15 | 'username' => 'root', 16 | 'password' => '', 17 | 'charset' => 'utf8', 18 | 'collation' => 'utf8_general_ci', 19 | 'prefix' => '' 20 | ]; -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | fetch()) { 5 | echo "
6 |

{$page->getDateAdded()}{$page->getTitle()}

7 |

{$page->getIntro()}

8 |

getId()}\">read more here...

9 |
10 | "; 11 | } 12 | ?> 13 |
-------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

getDateAdded(); ?>getTitle(); ?>

5 | getContent(); ?> 6 | canEditPage($page)) { 7 | echo '

EDIT

'; 8 | } ?> 9 |
10 |
-------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/5.php: -------------------------------------------------------------------------------- 1 | true,'debug'=>true)); 11 | $tpl->assign('data','hello world'); 12 | $tpl->assign('person','cafeCAT'); 13 | $tpl->assign('pai',3.14); 14 | $arr = [1,2,3,4,'hahattt',6]; 15 | $tpl->assignArray('b',$arr); 16 | $tpl->show('member'); 17 | -------------------------------------------------------------------------------- /shenrulijiephp/2/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /shenrulijiephp/6/hinting2.php: -------------------------------------------------------------------------------- 1 | addEmployee($e1); 19 | $hr->addEmployee($e2); 20 | 21 | unset($hr,$e1,$e2); -------------------------------------------------------------------------------- /phpunit/DependencyFailureTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(false); 13 | } 14 | 15 | /** 16 | * @depends testOne 17 | */ 18 | public function testTwo() 19 | { 20 | 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /shenrulijiephp/14/RectangleTest.php: -------------------------------------------------------------------------------- 1 | assertEquals(72,$r->getArea()); 17 | } 18 | 19 | } 20 | 21 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/resources/views/backyard/include/sidebar.blade.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | assertTrue(true,'这应该是已经能正常工作的。'); 17 | $this->markTestIncomplete('此测试目前尚未实现。'); 18 | } 19 | } -------------------------------------------------------------------------------- /shenrulijiephp/9/views/error.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

An Error Occurred!

5 |

The content is not viewable because an error occurred. We apologize for any inconvenience. The system administrator has been notified and will correct the problem as soon as possible.

6 |

Details (not for public consumption): getMessage(); ?>

7 |
8 |
9 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/tests/Unit/ExampleTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/10.php: -------------------------------------------------------------------------------- 1 | addServer('127.0.0.1',4730); 11 | $info = array( 12 | "to"=>"to@gamil.com", 13 | "subject"=>"Test send email", 14 | "message"=>"Hello!This is a simple email message", 15 | "handers"=>"From:from@yahoo.com.cn" 16 | ); 17 | echo $client->do("sendmail",serialize($info)); 18 | 19 | -------------------------------------------------------------------------------- /swoole/httpserver.php: -------------------------------------------------------------------------------- 1 | on("start",function($server){ 11 | echo "Swoole http server is started at http://127.0.0.1:9501\n"; 12 | }); 13 | 14 | $http->on("request",function($request,$response){ 15 | $response->header("Content-Type", "text/plain"); 16 | $response->end("Hello World\n"); 17 | }); 18 | 19 | $http->start(); -------------------------------------------------------------------------------- /phpprogramming/fpdf181/font/courier.php: -------------------------------------------------------------------------------- 1 | array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96)); 10 | ?> 11 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/font/courierb.php: -------------------------------------------------------------------------------- 1 | array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96)); 10 | ?> 11 | -------------------------------------------------------------------------------- /swoole/websocketserver.php: -------------------------------------------------------------------------------- 1 | on("open",function($server,$req){ 5 | echo "connect open: {$req->fd}\n"; 6 | }); 7 | 8 | $server->on("message",function($server,$frame){ 9 | echo "received message: {$frame->data}\n"; 10 | $server->push($frame->fd,json_encode(["hello", "world"])); 11 | }); 12 | 13 | $server->on("close",function($server,$fd){ 14 | echo "connection close: {$fd}\n"; 15 | }); 16 | 17 | $server->start(); 18 | 19 | -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/10worker.php: -------------------------------------------------------------------------------- 1 | addServer("127.0.0.1",4730); 10 | $worker->addFunction("sendmail","doSendMail"); 11 | 12 | while($worker->work()); 13 | 14 | function doSendMail($job){ 15 | $email = unserialize($job->workload()); 16 | print_r($email); 17 | return mail($email['to'],$email['subject'],$email['message'],$email['headers']); 18 | } -------------------------------------------------------------------------------- /phpprogramming/fpdf181/font/courieri.php: -------------------------------------------------------------------------------- 1 | array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96)); 10 | ?> 11 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/font/courierbi.php: -------------------------------------------------------------------------------- 1 | array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96)); 10 | ?> 11 | -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/1factory/Client.php: -------------------------------------------------------------------------------- 1 | someGraphicObject = new GraphicFactory(); 12 | echo $this->someGraphicObject->startFactory() . "
"; 13 | $this->someTextObject = new TextFactory(); 14 | echo $this->someTextObject->startFactory() . "
"; 15 | } 16 | } 17 | 18 | $worker = new Client(); -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/1factory/参数工厂/Client.php: -------------------------------------------------------------------------------- 1 | someCountryObject = new CountryFactory(); 12 | echo $this->someCountryObject->doFactory(new GraphicProduct()) . "
"; 13 | echo $this->someCountryObject->doFactory(new TextProduct()) . "
"; 14 | } 15 | } 16 | 17 | $worker = new Client(); -------------------------------------------------------------------------------- /daimashengji/1.php: -------------------------------------------------------------------------------- 1 | query($sql); 13 | print_r('当前SQL语句:'.$sql.'
结果:'); 14 | print_r($result->fetch_row()); 15 | 16 | 17 | $a=addslashes($_GET['p']); 18 | $b=urldecode($a); 19 | echo '$a='.$a; 20 | echo '
'; 21 | echo '$b='.$b; 22 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/tutorial/countries.txt: -------------------------------------------------------------------------------- 1 | Austria;Vienna;83859;8075 2 | Belgium;Brussels;30518;10192 3 | Denmark;Copenhagen;43094;5295 4 | Finland;Helsinki;304529;5147 5 | France;Paris;543965;58728 6 | Germany;Berlin;357022;82057 7 | Greece;Athens;131625;10511 8 | Ireland;Dublin;70723;3694 9 | Italy;Roma;301316;57563 10 | Luxembourg;Luxembourg;2586;424 11 | Netherlands;Amsterdam;41526;15654 12 | Portugal;Lisbon;91906;9957 13 | Spain;Madrid;504790;39348 14 | Sweden;Stockholm;410934;8839 15 | United Kingdom;London;243820;58862 16 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | realSubject = new RealSubject(); 17 | } 18 | 19 | function request(){ 20 | echo '这是代理!'; 21 | $this->realSubject->request(); 22 | } 23 | } 24 | 25 | $p = new Proxy(); 26 | $p->request(); -------------------------------------------------------------------------------- /phpunit/Database4_3.php: -------------------------------------------------------------------------------- 1 | markTestSkipped('MySQLi 扩展不可用'); 18 | } 19 | } 20 | public function testConnection(){ 21 | 22 | } 23 | } -------------------------------------------------------------------------------- /shenrulijiephp/6/abstract.php: -------------------------------------------------------------------------------- 1 | With sides of $side1,$side2 and $side3 …"; 18 | 19 | $t = new Triangle($side1,$side2,$side3); 20 | 21 | echo "

The area of the triangle is ".$t->getArea()."

"; 22 | 23 | echo "

The perimeter of the triangle is ".$t->getPerimeter()."

"; 24 | 25 | unset($t); 26 | 27 | -------------------------------------------------------------------------------- /shenrulijiephp/8/write_to_file.php: -------------------------------------------------------------------------------- 1 | write('This is a line of data'); 13 | $fp->close(); 14 | unset($fp); 15 | 16 | echo '

The data has been written.

'; 17 | } catch (Exception $e) { 18 | echo '

The process could not be completed because the script:'.$e->getMessage().'

'; 19 | } 20 | 21 | echo '

This is the end of the script.

'; 22 | -------------------------------------------------------------------------------- /shenrulijiephp/9/css/fonts/fonts.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on July 16, 2012 */ 2 | 3 | 4 | 5 | @font-face { 6 | font-family: 'AmbleRegular'; 7 | src: url('amble-regular-webfont.eot'); 8 | src: url('amble-regular-webfont.eot?#iefix') format('embedded-opentype'), 9 | url('amble-regular-webfont.woff') format('woff'), 10 | url('amble-regular-webfont.ttf') format('truetype'), 11 | url('amble-regular-webfont.svg#AmbleRegular') format('svg'); 12 | font-weight: normal; 13 | font-style: normal; 14 | 15 | } -------------------------------------------------------------------------------- /sixstar/redis/redis.php: -------------------------------------------------------------------------------- 1 | 'redis']; 8 | 9 | // $client = new Predis\Client($params, $options); 10 | 11 | // var_dump($client->getConnection()); 12 | 13 | // $client->set('aaa', 11); 14 | 15 | // echo $client->get('aaa'); 16 | 17 | $obj_cluster = new RedisCluster(NULL, ['192.168.56.102:6392', '192.168.56.102:6393']); 18 | var_dump($obj_cluster); 19 | 20 | $obj_cluster->set('name1', '1111'); 21 | -------------------------------------------------------------------------------- /phpunit/OutputTest.php: -------------------------------------------------------------------------------- 1 | expectOutputString('foo'); 17 | echo 'foo'; 18 | } 19 | public function testExpectBarActualBaz(){ 20 | $this->expectOutputString('bar'); 21 | echo 'baz'; 22 | } 23 | } -------------------------------------------------------------------------------- /面试题/数组交集.php: -------------------------------------------------------------------------------- 1 | "; 13 | } 14 | 15 | class Controller{ 16 | static function index(){ 17 | echo '命名空间'.__NAMESPACE__."
"; 18 | } 19 | } 20 | 21 | index(); 22 | 23 | Controller::index(); 24 | 25 | Auth\index(); 26 | Auth\Controller::index(); 27 | 28 | \App\Http\Controllers\index(); 29 | \App\Http\Controllers\Auth\Controller::index(); -------------------------------------------------------------------------------- /phpunit/Example9_5.php: -------------------------------------------------------------------------------- 1 | id = $id; 17 | } 18 | 19 | public function setDirectory($directory) 20 | { 21 | $this->directory = $directory . DIRECTORY_SEPARATOR . $this->id; 22 | 23 | if (!file_exists($this->directory)) { 24 | mkdir($this->directory, 0700, true); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /phpunit/ExceptionTest.php: -------------------------------------------------------------------------------- 1 | expectException(InvalidArgumentException::class); 17 | } 18 | 19 | /** 20 | * @expectException InvalidArgumentException 21 | */ 22 | public function testException2(){ 23 | 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /shenrulijiephp/7/composite.php: -------------------------------------------------------------------------------- 1 | add($john); 16 | $alpha->add($rashid); 17 | 18 | $alpha->assignTask('Do somthing great.'); 19 | $cynthia->assignTask('Do something grand.'); 20 | 21 | $alpha->completeTask('Do something great.'); 22 | 23 | $alpha->remove($john); 24 | 25 | unset($alpha,$john,$cynthia,$rashid); -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 20 | 21 | $response->assertStatus(200); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 16 | }); 17 | -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/php_list/php_list.php: -------------------------------------------------------------------------------- 1 | "; 3 | 4 | if(!extension_loaded('php_list')) { 5 | dl('php_list.' . PHP_SHLIB_SUFFIX); 6 | } 7 | $module = 'php_list'; 8 | $functions = get_extension_funcs($module); 9 | echo "Functions available in the 面试题 extension:$br\n"; 10 | foreach($functions as $func) { 11 | echo $func."$br\n"; 12 | } 13 | echo "$br\n"; 14 | $function = 'confirm_' . $module . '_compiled'; 15 | if (extension_loaded($module)) { 16 | $str = $function($module); 17 | } else { 18 | $str = "Module $module is not compiled into PHP"; 19 | } 20 | echo "$str\n"; 21 | ?> 22 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/pageno.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PageNo 6 | 7 | 8 | 9 |

PageNo

10 | int PageNo() 11 |

Description

12 | Returns the current page number. 13 |

See also

14 | AliasNbPages 15 |
16 |
Index
17 | 18 | 19 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/install.txt: -------------------------------------------------------------------------------- 1 | The FPDF library is made up of the following elements: 2 | 3 | - the main file, fpdf.php, which contains the class 4 | - the font definition files located in the font directory 5 | 6 | The font definition files are necessary as soon as you want to output some text in a document. 7 | If they are not accessible, the SetFont() method will produce the following error: 8 | 9 | FPDF error: Could not include font definition file 10 | 11 | 12 | Remarks: 13 | 14 | - Only the files corresponding to the fonts actually used are necessary 15 | - The tutorials provided in this package are ready to be executed 16 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 17 | return $request->user(); 18 | }); 19 | -------------------------------------------------------------------------------- /shenrulijiephp/8/write_to_file2.php: -------------------------------------------------------------------------------- 1 | write('This is a line of data'); 13 | $fp->close(); 14 | unset($fp); 15 | 16 | echo '

The data has been written.

'; 17 | } catch (FileException $e) { 18 | echo '

The process could not be completed because the script:'.$e->getMessage().'
'.$e->getDetails().'

'; 19 | } 20 | 21 | echo '

This is the end of the script.

'; 22 | 23 | print_r(PDO::getAvailableDrivers()); 24 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/webpack.mix.js: -------------------------------------------------------------------------------- 1 | const { mix } = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel application. By default, we are compiling the Sass 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js('resources/assets/js/app.js', 'public/js') 15 | .sass('resources/assets/sass/app.scss', 'public/css'); 16 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/resources/views/backyard/notes/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('/backyard/backyard') 2 | @section('content') 3 |
4 |
5 |
6 |

7 | 8 |

9 |

{{$title}}

10 |

11 | {{$content}} 12 |

13 |
14 | @include('backyard.include.sidebar') 15 |
16 |
17 | @endsection -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/getpagewidth.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | GetPageWidth 6 | 7 | 8 | 9 |

GetPageWidth

10 | float GetPageWidth() 11 |

Description

12 | Returns the current page width. 13 |

See also

14 | GetPageHeight 15 |
16 |
Index
17 | 18 | 19 | -------------------------------------------------------------------------------- /shenrulijiephp/10/curl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | GetPageHeight 6 | 7 | 8 | 9 |

GetPageHeight

10 | float GetPageHeight() 11 |

Description

12 | Returns the current page height. 13 |

See also

14 | GetPageWidth 15 |
16 |
Index
17 | 18 | 19 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/php_list/tests/001.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Check for php_list presence 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 20 | --EXPECT-- 21 | php_list extension is available 22 | -------------------------------------------------------------------------------- /shenrulijiephp/9/js/custom-jquery.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | //clear input fields 3 | $("#commentform input,.wpcf7-form input, #commentform textarea, .wpcf7-form textarea").focus(function() { 4 | if( this.value == this.defaultValue ) { 5 | this.value = ""; 6 | } 7 | }).blur(function() { 8 | if( !this.value.length ) { 9 | this.value = this.defaultValue; 10 | } 11 | }); 12 | 13 | // Easy way to get rid of image attributes, such as height and width for responsive images. Just make sure you set the img width in css 14 | $('.container img,.blogPost img') 15 | .removeAttr("width").removeAttr("height") 16 | .css({width: "", height: ""}); 17 | }); -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/app/User.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes If Not A Folder... 9 | RewriteCond %{REQUEST_FILENAME} !-d 10 | RewriteRule ^(.*)/$ /$1 [L,R=301] 11 | 12 | # Handle Front Controller... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_FILENAME} !-f 15 | RewriteRule ^ index.php [L] 16 | 17 | # Handle Authorization Header 18 | RewriteCond %{HTTP:Authorization} . 19 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 20 | 21 | -------------------------------------------------------------------------------- /phpbianchengshizhan/domestic.php: -------------------------------------------------------------------------------- 1 | type = "dog"; 12 | } 13 | function get_type(){ 14 | return $this->type; 15 | } 16 | } 17 | class animal2{ 18 | public $species; 19 | public $name; 20 | function __construct($kind,$name) 21 | { 22 | $this->species = $kind; 23 | $this->name = $name; 24 | } 25 | function __toString() 26 | { 27 | // TODO: Implement __toString() method. 28 | return $this->species.".".$this->name; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /phpcookbook/20170306.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to 面试题 a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /shenrulijiephp/7/factory.php: -------------------------------------------------------------------------------- 1 | Creating a {$_GET['shape']}..."; 18 | echo "

The area is ".$obj->getArea()."

"; 19 | echo "

The perimeter is ".$obj->getPerimeter()."

"; 20 | }else{ 21 | echo "

Please provide a shape type and size.

"; 22 | } 23 | unset($obj); 24 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/getx.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | GetX 6 | 7 | 8 | 9 |

GetX

10 | float GetX() 11 |

Description

12 | Returns the abscissa of the current position. 13 |

See also

14 | SetX, 15 | GetY, 16 | SetY 17 |
18 |
Index
19 | 20 | 21 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/gety.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | GetY 6 | 7 | 8 | 9 |

GetY

10 | float GetY() 11 |

Description

12 | Returns the ordinate of the current position. 13 |

See also

14 | SetY, 15 | GetX, 16 | SetX 17 |
18 |
Index
19 | 20 | 21 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/app/Models/Users.php: -------------------------------------------------------------------------------- 1 | all(); 19 | return $userList; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /shenruphpmianxiangduixiangmoshiyushijian/12.php: -------------------------------------------------------------------------------- 1 | values[$key])){ 20 | return $this->values[$key]; 21 | } 22 | return null; 23 | } 24 | function set($key,$value){ 25 | $this->values[$key] = $value; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/resources/assets/js/app.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * First we will load all of this project's JavaScript dependencies which 4 | * includes Vue and other libraries. It is a great starting point when 5 | * building robust, powerful web applications using Vue and Laravel. 6 | */ 7 | 8 | require('./bootstrap'); 9 | 10 | /** 11 | * Next, we will create a fresh Vue application instance and attach it to 12 | * the page. Then, you may begin adding components to this application 13 | * or customize the JavaScript scaffolding to fit your unique needs. 14 | */ 15 | 16 | Vue.component('example', require('./components/Example.vue')); 17 | 18 | const app = new Vue({ 19 | el: '#app' 20 | }); 21 | -------------------------------------------------------------------------------- /shenrulijiephp/11/set_mcrypt.php: -------------------------------------------------------------------------------- 1 | The data has been stored.Its value is '.base64_encode($data).'.

'; -------------------------------------------------------------------------------- /shenrulijiephp/8/write_to_file3.php: -------------------------------------------------------------------------------- 1 | fwrite('This is a line of data.\n'); 13 | unset($fp); 14 | 15 | echo '

The data has been written.

'; 16 | } catch (FileException $e) { 17 | echo '

The process could not be completed because the script:'.$e->getMessage().'
'.$e->getDetails().'

'; 18 | } 19 | 20 | echo '

This is the end of the script.

'; 21 | 22 | $dir = new DirectoryIterator('../'); 23 | foreach ($dir as $item){ 24 | echo $item,PHP_EOL; 25 | } 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /shenrulijiephp/11/read_mcrypt.php: -------------------------------------------------------------------------------- 1 | The session has been read.Its value is "'.trim($data).'".

'; 21 | }else{ 22 | echo '

There\'s nothing to see here.

'; 23 | } -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/resources/assets/js/components/Example.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /shenrulijiephp/7/Config.php: -------------------------------------------------------------------------------- 1 | _settings[$index] = $value; 27 | } 28 | function get($index){ 29 | return $this->_settings[$index]; 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/6prototype/prototype.php: -------------------------------------------------------------------------------- 1 | picture = 'cloneMan.png'; 13 | $this->name = 'Original'; 14 | echo 111; // 克隆不会调用构造函数 15 | } 16 | public function display(){ 17 | echo 'picture: ' . $this->picture . "\n"; 18 | echo 'name: ' . $this->name . "\n"; 19 | } 20 | function __clone(){} 21 | } 22 | 23 | $worker = new Person(); 24 | $worker->display(); 25 | 26 | $slacker = clone $worker; 27 | $slacker->name = 'Cloned'; 28 | $slacker->display(); 29 | 30 | $worker->display(); 31 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/resources/views/backyard/index/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('/backyard/backyard') 2 | @section('content') 3 |
4 |
5 |
6 |

7 | 8 |

9 |
10 |

思维笔记

11 |

思维笔记,记录你灵魂的变化。

12 |
13 |
14 | @include('backyard.include.sidebar') 15 |
16 |
17 | @endsection -------------------------------------------------------------------------------- /shenrulijiephp/6/tDebug.php: -------------------------------------------------------------------------------- 1 | Information about the $class object"; 16 | 17 | echo '

Attributes

"; 22 | 23 | echo '

Methods

"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /shenrulijiephp/7/tDebug.php: -------------------------------------------------------------------------------- 1 | Information about the $class object"; 16 | 17 | echo '

Attributes

"; 22 | 23 | echo '

Methods

"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /面试题/zhugezhaofang.php: -------------------------------------------------------------------------------- 1 | assertFalse(@$writer->write('/is-not-writeable/file', 'stuff')); 19 | } 20 | } 21 | class FileWriter 22 | { 23 | public function write($file, $content) { 24 | $file = fopen($file, 'w'); 25 | if($file == false) { 26 | return false; 27 | } 28 | // ... 29 | } 30 | } -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /phpbianchengshizhan/14.php: -------------------------------------------------------------------------------- 1 | 11 | dog 12 | snoopy 13 | 14 | THE_XML; 15 | $xml_object = simplexml_load_string($xml); 16 | foreach($xml_object as $element=>$value){ 17 | print $element.":".$value."\n"; 18 | } 19 | 20 | $xml = simplexml_load_file("http://feeds.wired.com/wired/index?format=xml"); 21 | foreach($xml->channel->item as $item){ 22 | print $item->title; 23 | print "\n"; 24 | } 25 | 26 | $animals = new SimpleXMLElement(''); 27 | $animals->{0} = 'Hello World'; 28 | 29 | $animals->asXML('animals.xml'); 30 | var_dump(simplexml_load_file('animals.xml')); 31 | 32 | -------------------------------------------------------------------------------- /phpunit/MyGuestbookTest8_1.php: -------------------------------------------------------------------------------- 1 | createDefaultDBConnection($pdo, ':memory:'); 22 | } 23 | 24 | protected function getDataSet() 25 | { 26 | return $this->createFlatXMLDataSet(dirname(__FILE__).'/_files/guestbook-seed.xml'); 27 | } 28 | 29 | 30 | } -------------------------------------------------------------------------------- /modernphp/ex6.php: -------------------------------------------------------------------------------- 1 | option($csvRow[0]); 23 | print_r($httpResponse->getStatusCode()); 24 | if($httpResponse->getStatusCode()>=400){ 25 | throw new \Exception(); 26 | } 27 | }catch (\Exception $e){ 28 | echo $csvRow[0].PHP_EOL; 29 | echo $e->getMessage().PHP_EOL; 30 | } 31 | } -------------------------------------------------------------------------------- /shenrulijiephp/6/Company.php: -------------------------------------------------------------------------------- 1 | _name = $name; 14 | } 15 | function getName(){ 16 | return $this->_name; 17 | } 18 | } 19 | 20 | class Department{ 21 | private $_name; 22 | private $_employees; 23 | function __construct($name) 24 | { 25 | $this->_name = $name; 26 | $this->_employees = array(); 27 | } 28 | function addEmployee(Employee $e){ 29 | $this->_employees[] = $e; 30 | echo "

{$e->getName()} has been added to the {$this->_name} department.

"; 31 | } 32 | } -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/18templatemethod/template-method.php: -------------------------------------------------------------------------------- 1 | PrimitiveOperation1(); 9 | $this->PrimitiveOperation2(); 10 | echo "模板方法结束", PHP_EOL; 11 | } 12 | 13 | abstract public function PrimitiveOperation1(); 14 | abstract public function PrimitiveOperation2(); 15 | } 16 | 17 | class ConcreteClass extends AbstractClass 18 | { 19 | public function PrimitiveOperation1() 20 | { 21 | echo "我是方法1", PHP_EOL; 22 | } 23 | 24 | public function PrimitiveOperation2() 25 | { 26 | echo "我是方法2", PHP_EOL; 27 | } 28 | } 29 | 30 | 31 | $c = new ConcreteClass(); 32 | $c->TemplateMethod(); -------------------------------------------------------------------------------- /phpcookbook/20170305.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.

5 |
6 |
7 |

Add a New Page of Content

8 | isSubmitted() && $form->validate()) { 9 | echo '

The page has been added!

'; 10 | }?> 11 | 12 |
13 |
-------------------------------------------------------------------------------- /shenrulijiephp/9/views/login.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.

5 |
6 |
7 |

Login

8 | isSubmitted() && $form->validate()) { 9 | echo '

The values submitted do not match those on file!

'; 10 | }?> 11 | 12 |
13 |
14 | -------------------------------------------------------------------------------- /swoole/1-Client.php: -------------------------------------------------------------------------------- 1 | client = new swoole_client(SWOOLE_SOCK_TCP); 16 | } 17 | 18 | public function connect() 19 | { 20 | if (!$this->client->connect("127.0.0.1", 9501, 1)) { 21 | echo "Error: {$fp->errMsg}[{$fp->errCode}]\n"; 22 | } 23 | $message = $this->client->recv(); 24 | echo "Get Message From Server:{$message}\n"; 25 | 26 | fwrite(STDOUT, "请输入消息:"); 27 | $msg = trim(fgets(STDIN)); 28 | $this->client->send($msg); 29 | } 30 | } 31 | 32 | $client = new Client(); 33 | $client->connect(); -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'App\Listeners\EventListener', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any events for your application. 23 | * 24 | * @return void 25 | */ 26 | public function boot() 27 | { 28 | parent::boot(); 29 | 30 | // 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/setfontsize.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetFontSize 6 | 7 | 8 | 9 |

SetFontSize

10 | SetFontSize(float size) 11 |

Description

12 | Defines the size of the current font. 13 |

Parameters

14 |
15 |
size
16 |
17 | The size (in points). 18 |
19 |
20 |

See also

21 | SetFont 22 |
23 |
Index
24 | 25 | 26 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/getstringwidth.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | GetStringWidth 6 | 7 | 8 | 9 |

GetStringWidth

10 | float GetStringWidth(string s) 11 |

Description

12 | Returns the length of a string in user unit. A font must be selected. 13 |

Parameters

14 |
15 |
s
16 |
17 | The string whose length is to be computed. 18 |
19 |
20 |
21 |
Index
22 | 23 | 24 | -------------------------------------------------------------------------------- /sixstar/Laravel/2ioc/IoC.php: -------------------------------------------------------------------------------- 1 | connect(); -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/close.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Close 6 | 7 | 8 | 9 |

Close

10 | Close() 11 |

Description

12 | Terminates the PDF document. It is not necessary to call this method explicitly because Output() 13 | does it automatically. 14 |
15 | If the document contains no page, AddPage() is called to prevent from getting an invalid document. 16 |

See also

17 | Output 18 |
19 |
Index
20 | 21 | 22 | -------------------------------------------------------------------------------- /modernphp/ex3.php: -------------------------------------------------------------------------------- 1 | 'WebController' 21 | //]); 22 | Route::controllers([ 23 | 'webauth' => 'Auth\WebAuthController', 24 | // 'webpassword' => 'Auth\WebPasswordController' 25 | ]); 26 | 27 | -------------------------------------------------------------------------------- /shenrulijiephp/10/ip_geo.php: -------------------------------------------------------------------------------- 1 | IP Address: $ip
16 | Country: $read[2]
17 | City,State: $read[5],$read[3]
18 | Latitude:$read[7]
19 | Longitude:$read[8]

"; 20 | } 21 | 22 | echo '

Our spies tell us the following information about you

'; 23 | show_ip_info($_SERVER['REMOTE_ADDR']); 24 | 25 | $url = 'www.entropy.ch'; 26 | echo '

Our spies tell us the following information about the URL '.$url.'

'; 27 | show_ip_info(gethostbyname($url)); 28 | 29 | show_ip_info(gethostbyname('www.baidu.com')); 30 | -------------------------------------------------------------------------------- /shenrulijiephp/8/factory.php: -------------------------------------------------------------------------------- 1 | Creating a {$_GET['shape']}..."; 23 | echo "

The area is ".$obj->getArea()."

"; 24 | echo "

The perimeter is ".$obj->getPerimeter()."

"; 25 | }else{ 26 | echo "

Please provide a shape type and size.

"; 27 | } 28 | unset($obj); 29 | -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/3_1socketserver.php: -------------------------------------------------------------------------------- 1 | Search Results'; 18 | 19 | if(isset($_GET['terms'])&&$_GET['terms']!='Search...'){ 20 | for($i=1;$i<=10;$i++){ 21 | echo <<Search Result #$i 23 |

This is some description. This is some description. This is some description. This is some description.

\n 24 | EOT; 25 | } 26 | }else{ 27 | echo '

Please use the search form to search this site.

'; 28 | } 29 | -------------------------------------------------------------------------------- /shenrulijiephp/5/square.php: -------------------------------------------------------------------------------- 1 | width = $side; 13 | $this->height = $side; 14 | } 15 | } 16 | $width = 21; 17 | $height = 98; 18 | echo "

With a width of $width and a height of $height...

"; 19 | 20 | $r = new Rectangle($width,$height); 21 | 22 | echo "

The perimeter of the rectangle is ".$r->getPerimeter()."

"; 23 | 24 | $side = 60; 25 | 26 | echo "

With each side being $side...

"; 27 | 28 | $s = new Square($side); 29 | 30 | echo "

The area of the square is ".$s->getArea()."

"; 31 | 32 | echo "

The perimeter of the square is ".$s->getPerimeter()."

"; 33 | 34 | unset($r,$s); 35 | 36 | -------------------------------------------------------------------------------- /shenrulijiephp/9/logout.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modernphp/src/Whovian.php: -------------------------------------------------------------------------------- 1 | favoriteDoctor = (string)$favoriteDoctor; 16 | } 17 | public function say(){ 18 | return 'The best doctor is '.$this->favoriteDoctor; 19 | } 20 | public function respondTo($input){ 21 | $input = strtolower($input); 22 | $myDoctor = strtolower($this->favoriteDoctor); 23 | 24 | if(strpos($input,$myDoctor)===false){ 25 | throw new Exception(sprintf( 26 | 'No way! %s is the best doctor ever!', 27 | $this->favoriteDoctor 28 | )); 29 | } 30 | return 'I agree!'; 31 | } 32 | } -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/19singleton/singleton.php: -------------------------------------------------------------------------------- 1 | singletonData = '单例数据'; 11 | } 12 | 13 | public static function GetInstance(): Singleton 14 | { 15 | if (self::$uniqueInstance == null) { 16 | self::$uniqueInstance = new Singleton(); 17 | } 18 | return self::$uniqueInstance; 19 | } 20 | 21 | public function SingletonOperation() 22 | { 23 | echo $this->singletonData, PHP_EOL; 24 | } 25 | 26 | } 27 | 28 | $singleA = Singleton::GetInstance(); 29 | $singleB = Singleton::GetInstance(); 30 | 31 | if ($singleA === $singleB) { 32 | echo '相同的', PHP_EOL; 33 | } 34 | 35 | $singleA->SingletonOperation(); 36 | $singleB->SingletonOperation(); 37 | -------------------------------------------------------------------------------- /phpunit/TraitClassTest9_3.php: -------------------------------------------------------------------------------- 1 | abstractMethod(); 19 | } 20 | 21 | public abstract function abstractMethod(); 22 | } 23 | 24 | class TraitClassTest9_3 extends TestCase 25 | { 26 | public function testConcreteMethod() 27 | { 28 | $mock = $this->getMockForTrait(AbstractTrait::class); 29 | 30 | $mock->expects($this->any()) 31 | ->method('abstractMethod') 32 | ->will($this->returnValue(true)); 33 | 34 | $this->assertTrue($mock->concreteMethod()); 35 | } 36 | } -------------------------------------------------------------------------------- /phpunit/MultipleDependenciesTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | return 'first'; 18 | } 19 | 20 | public function testProducerSecond(){ 21 | $this->assertTrue(true); 22 | return 'second'; 23 | } 24 | 25 | /** 26 | * @depends testProducerFirst 27 | * @depends testProducerSecond 28 | */ 29 | public function testConsumer(){ 30 | $this->assertEquals( 31 | ['first', 'second'], 32 | func_get_args() 33 | ); 34 | } 35 | } -------------------------------------------------------------------------------- /swoole/5-Client-EOF.php: -------------------------------------------------------------------------------- 1 | client = new swoole_client(SWOOLE_SOCK_TCP); 16 | } 17 | 18 | public function connect() 19 | { 20 | if (!$this->client->connect("127.0.0.1", 9501, 1)) { 21 | echo "Error: {$fp->errMsg}[{$fp->errCode}]\n"; 22 | } 23 | 24 | $msg_normal = "This is a Msg"; 25 | $msg_eof = "This is a Msg\r\n"; 26 | $msg_length = pack("N", strlen($msg_normal)) . $msg_normal; 27 | 28 | $i = 0; 29 | while ($i < 100) { 30 | $this->client->send($msg_length); 31 | $i++; 32 | } 33 | 34 | } 35 | } 36 | 37 | $client = new Client(); 38 | $client->connect(); -------------------------------------------------------------------------------- /phpunit/AbstractClassTest9_3.php: -------------------------------------------------------------------------------- 1 | abstractMethod(); 19 | } 20 | 21 | public abstract function abstractMethod(); 22 | } 23 | 24 | class AbstractClassTest9_3 extends TestCase 25 | { 26 | public function testConcreteMethod() 27 | { 28 | $stub = $this->getMockForAbstractClass(AbstractClass::class); 29 | 30 | $stub->expects($this->any()) 31 | ->method('abstractMethod') 32 | ->will($this->returnValue(true)); 33 | 34 | $this->assertTrue($stub->concreteMethod()); 35 | } 36 | } -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/6/6.1.1.php: -------------------------------------------------------------------------------- 1 | trafficTool = new Leg(); 38 | } 39 | public function visitTibet(){ 40 | $this->trafficTool->go(); 41 | } 42 | } 43 | 44 | $tra = new Traveller(); 45 | $tra->visitTibet(); -------------------------------------------------------------------------------- /phpunit/StackTest4.php: -------------------------------------------------------------------------------- 1 | stack = []; 15 | } 16 | 17 | public function testEmpty() 18 | { 19 | $this->assertTrue(empty($this->stack)); 20 | } 21 | 22 | public function testPush() 23 | { 24 | array_push($this->stack, 'foo'); 25 | $this->assertEquals('foo', $this->stack[count($this->stack) - 1]); 26 | $this->assertFalse(empty($this->stack)); 27 | } 28 | 29 | public function testPop() 30 | { 31 | array_push($this->stack, 'foo'); 32 | $this->assertEquals('foo', array_pop($this->stack)); 33 | $this->assertTrue(empty($this->stack)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /phpunit/DataTest.php: -------------------------------------------------------------------------------- 1 | assertEquals($expected, $a + $b); 24 | } 25 | 26 | public function additionProvider() 27 | { 28 | return [ 29 | 'adding zeros' => [0, 0, 0], 30 | 'zero plus one' => [0, 1, 1], 31 | 'one plus zero' => [1, 0, 1], 32 | 'one plus one' => [1, 1, 3] 33 | ]; 34 | // return new CsvFileIterator('data.csv'); 35 | } 36 | 37 | 38 | } -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker\Generator $faker) { 16 | static $password; 17 | 18 | return [ 19 | 'name' => $faker->name, 20 | 'email' => $faker->unique()->safeEmail, 21 | 'password' => $password ?: $password = bcrypt('secret'), 22 | 'remember_token' => str_random(10), 23 | ]; 24 | }); 25 | -------------------------------------------------------------------------------- /phpunit/5_1tests/StackTest4.php: -------------------------------------------------------------------------------- 1 | stack = []; 15 | } 16 | 17 | public function testEmpty() 18 | { 19 | $this->assertTrue(empty($this->stack)); 20 | } 21 | 22 | public function testPush() 23 | { 24 | array_push($this->stack, 'foo'); 25 | $this->assertEquals('foo', $this->stack[count($this->stack) - 1]); 26 | $this->assertFalse(empty($this->stack)); 27 | } 28 | 29 | public function testPop() 30 | { 31 | array_push($this->stack, 'foo'); 32 | $this->assertEquals('foo', array_pop($this->stack)); 33 | $this->assertTrue(empty($this->stack)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /daimashengji/4.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | query($sql); 29 | // 30 | //print_r($result->fetch_row()); 31 | 32 | //可变变量 33 | $a = 'seay'; 34 | $$a = 123; 35 | echo $seay; 36 | //双引号中的变量是会被解析的,存在安全隐患 37 | $b = "${@phpinfo()}"; 38 | 39 | 40 | ?> 41 | 42 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /枕边算法/1.6.php: -------------------------------------------------------------------------------- 1 | $i;$j--){ 35 | // if($str[$i] != $str[$j]){ 36 | // $isHui = false; 37 | // } 38 | // break; 39 | // } 40 | // if($i==$j){ 41 | // break; 42 | // } 43 | // } 44 | // var_dump($isHui); 45 | //} 46 | -------------------------------------------------------------------------------- /mytools/文字所有组合.php: -------------------------------------------------------------------------------- 1 | 0) { 29 | $s = ""; 30 | $nowArr = []; 31 | foreach ($bitArr as $key => $bit) { 32 | if ($bit_set & $bit) { 33 | $s = $s . $arr[$key] . ','; 34 | $nowArr[] = $arr[$key]; 35 | } 36 | } 37 | // echo(trim($s, ',') . PHP_EOL); 38 | echo implode($nowArr, ',') . PHP_EOL; 39 | --$bit_set; 40 | } -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/ln.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ln 6 | 7 | 8 | 9 |

Ln

10 | Ln([float h]) 11 |

Description

12 | Performs a line break. The current abscissa goes back to the left margin and the ordinate 13 | increases by the amount passed in parameter. 14 |

Parameters

15 |
16 |
h
17 |
18 | The height of the break. 19 |
20 | By default, the value equals the height of the last printed cell. 21 |
22 |
23 |

See also

24 | Cell 25 |
26 |
Index
27 | 28 | 29 | -------------------------------------------------------------------------------- /phpunit/ExampleTest9_5.php: -------------------------------------------------------------------------------- 1 | assertFalse(vfsStreamWrapper::getRoot()->hasChild('id')); 28 | 29 | $example->setDirectory(vfsStream::url('exampleDir')); 30 | $this->assertTrue(vfsStreamWrapper::getRoot()->hasChild('id')); 31 | } 32 | } -------------------------------------------------------------------------------- /phpprogramming/fpdf181/tutorial/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Tutorials 6 | 7 | 8 | 9 |

Tutorials

10 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /shenrulijiephp/9/includes/utilities.inc.php: -------------------------------------------------------------------------------- 1 | \n\n"; 34 | exit (1); 35 | } 36 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/setx.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetX 6 | 7 | 8 | 9 |

SetX

10 | SetX(float x) 11 |

Description

12 | Defines the abscissa of the current position. If the passed value is negative, it is relative 13 | to the right of the page. 14 |

Parameters

15 |
16 |
x
17 |
18 | The value of the abscissa. 19 |
20 |
21 |

See also

22 | GetX, 23 | GetY, 24 | SetY, 25 | SetXY 26 |
27 |
Index
28 | 29 | 30 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/error.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 |

Error

10 | Error(string msg) 11 |

Description

12 | This method is automatically called in case of a fatal error; it simply throws an exception 13 | with the provided message.
14 | An inherited class may override it to customize the error handling but the method should 15 | never return, otherwise the resulting document would probably be invalid. 16 |

Parameters

17 |
18 |
msg
19 |
20 | The error message. 21 |
22 |
23 |
24 |
Index
25 | 26 | 27 | -------------------------------------------------------------------------------- /sixstar/Laravel/6adapter/adapter.php: -------------------------------------------------------------------------------- 1 | "; 10 | } 11 | } 12 | class Adaptee 13 | { 14 | public function specificRequest() 15 | { 16 | echo "特殊请求!
"; 17 | } 18 | } 19 | 20 | class Adapter extends Target 21 | { 22 | /** 23 | * 创建一个私有的adaptee对象 24 | * @var Adaptee 25 | */ 26 | private $adaptee; 27 | 28 | public function __construct() 29 | { 30 | $this->adaptee = new Adaptee; 31 | } 32 | 33 | /** 34 | * 这样就可以把表面上调用request()方法变成实际 35 | * 调用specificRequest() 36 | */ 37 | public function request() 38 | { 39 | $this->adaptee->specificRequest(); 40 | } 41 | } 42 | 43 | /** 44 | * 45 | */ 46 | class Client 47 | { 48 | public static function index() 49 | { 50 | $target = new Adapter(); 51 | $target->request(); 52 | } 53 | } 54 | Client::index(); 55 | -------------------------------------------------------------------------------- /phpunit/MyApp_Tests_DatabaseTestCase8_2.php: -------------------------------------------------------------------------------- 1 | conn === null){ 23 | if(self::$pdo == null){ 24 | self::$pdo = new PDO('sqlite:memory'); 25 | } 26 | $this->conn = $this->createDefaultDBConnection(self::$pdo,':memory:'); 27 | } 28 | return $this->conn; 29 | } 30 | 31 | 32 | protected function getDataSet() 33 | { 34 | // TODO: Implement getDataSet() method. 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /phpprogramming/fpdf181/tutorial/tuto2.php: -------------------------------------------------------------------------------- 1 | Image('logo.png',10,6,30); 11 | // Arial bold 15 12 | $this->SetFont('Arial','B',15); 13 | // Move to the right 14 | $this->Cell(80); 15 | // Title 16 | $this->Cell(30,10,'Title',1,0,'C'); 17 | // Line break 18 | $this->Ln(20); 19 | } 20 | 21 | // Page footer 22 | function Footer() 23 | { 24 | // Position at 1.5 cm from bottom 25 | $this->SetY(-15); 26 | // Arial italic 8 27 | $this->SetFont('Arial','I',8); 28 | // Page number 29 | $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C'); 30 | } 31 | } 32 | 33 | // Instanciation of inherited class 34 | $pdf = new PDF(); 35 | $pdf->AliasNbPages(); 36 | $pdf->AddPage(); 37 | $pdf->SetFont('Times','',12); 38 | for($i=1;$i<=40;$i++) 39 | $pdf->Cell(0,10,'Printing line number '.$i,0,1); 40 | $pdf->Output(); 41 | ?> 42 | -------------------------------------------------------------------------------- /shenrulijiephp/6/hinting.php: -------------------------------------------------------------------------------- 1 | _name = $name; 15 | } 16 | function getName(){ 17 | return $this->_name; 18 | } 19 | } 20 | 21 | class Department{ 22 | private $_name; 23 | private $_employees; 24 | function __construct($name) 25 | { 26 | $this->_name = $name; 27 | $this->_employees = array(); 28 | } 29 | function addEmployee(Employee $e){ 30 | $this->_employees[] = $e; 31 | echo "

{$e->getName()} has been added to the {$this->_name} department.

"; 32 | } 33 | } 34 | 35 | 36 | 37 | $hr = new Department("Human Resources"); 38 | 39 | $e1 = new Employee('Jane Doe'); 40 | $e2 = new Employee('John Doe'); 41 | 42 | $hr->addEmployee($e1); 43 | $hr->addEmployee($e2); 44 | 45 | unset($hr,$e1,$e2); -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/settopmargin.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetTopMargin 6 | 7 | 8 | 9 |

SetTopMargin

10 | SetTopMargin(float margin) 11 |

Description

12 | Defines the top margin. The method can be called before creating the first page. 13 |

Parameters

14 |
15 |
margin
16 |
17 | The margin. 18 |
19 |
20 |

See also

21 | SetLeftMargin, 22 | SetRightMargin, 23 | SetAutoPageBreak, 24 | SetMargins 25 |
26 |
Index
27 | 28 | 29 | -------------------------------------------------------------------------------- /shenrulijiephp/6/Triangle.php: -------------------------------------------------------------------------------- 1 | _sides[] = $s0; 16 | $this->_sides[] = $s1; 17 | $this->_sides[] = $s2; 18 | 19 | $this->_perimeter = array_sum($this->_sides); 20 | } 21 | public function getArea() 22 | { 23 | // TODO: Implement getArea() method. 24 | return (SQRT( 25 | ($this->_perimeter/2)* 26 | (($this->_perimeter/2)-$this->_sides[0])* 27 | (($this->_perimeter/2)-$this->_sides[1])* 28 | (($this->_perimeter/2)-$this->_sides[2]) 29 | )); 30 | } 31 | public function getPerimeter() 32 | { 33 | // TODO: Implement getPerimeter() method. 34 | return $this->_perimeter; 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /shenrulijiephp/7/Triangle.php: -------------------------------------------------------------------------------- 1 | _sides[] = $s0; 16 | $this->_sides[] = $s1; 17 | $this->_sides[] = $s2; 18 | 19 | $this->_perimeter = array_sum($this->_sides); 20 | } 21 | public function getArea() 22 | { 23 | // TODO: Implement getArea() method. 24 | return (SQRT( 25 | ($this->_perimeter/2)* 26 | (($this->_perimeter/2)-$this->_sides[0])* 27 | (($this->_perimeter/2)-$this->_sides[1])* 28 | (($this->_perimeter/2)-$this->_sides[2]) 29 | )); 30 | } 31 | public function getPerimeter() 32 | { 33 | // TODO: Implement getPerimeter() method. 34 | return $this->_perimeter; 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /mytools/数组对象转换.php: -------------------------------------------------------------------------------- 1 | $v) { 21 | if (gettype($v) == 'array' || getType($v) == 'object') { 22 | $arr[$k] = (object)array_to_object($v); 23 | } 24 | } 25 | return (object)$arr; 26 | } 27 | 28 | /** 29 | * 对象 转 数组 30 | * 31 | * @param object $obj 对象 32 | * @return array 33 | */ 34 | function object_to_array($obj) 35 | { 36 | $obj = (array)$obj; 37 | foreach ($obj as $k => $v) { 38 | if (gettype($v) == 'resource') { 39 | return; 40 | } 41 | if (gettype($v) == 'object' || gettype($v) == 'array') { 42 | $obj[$k] = (array)object_to_array($v); 43 | } 44 | } 45 | return $obj; 46 | } -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/setrightmargin.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetRightMargin 6 | 7 | 8 | 9 |

SetRightMargin

10 | SetRightMargin(float margin) 11 |

Description

12 | Defines the right margin. The method can be called before creating the first page. 13 |

Parameters

14 |
15 |
margin
16 |
17 | The margin. 18 |
19 |
20 |

See also

21 | SetLeftMargin, 22 | SetTopMargin, 23 | SetAutoPageBreak, 24 | SetMargins 25 |
26 |
Index
27 | 28 | 29 | -------------------------------------------------------------------------------- /phpunit/CsvFileIterator.php: -------------------------------------------------------------------------------- 1 | file = fopen($file, 'r'); 16 | } 17 | 18 | public function __destruct() { 19 | fclose($this->file); 20 | } 21 | 22 | public function rewind() { 23 | rewind($this->file); 24 | $this->current = fgetcsv($this->file); 25 | $this->key = 0; 26 | } 27 | 28 | public function valid() { 29 | return !feof($this->file); 30 | } 31 | 32 | public function key() { 33 | return $this->key; 34 | } 35 | 36 | public function current() { 37 | return $this->current; 38 | } 39 | 40 | public function next() { 41 | $this->current = fgetcsv($this->file); 42 | $this->key++; 43 | } 44 | } -------------------------------------------------------------------------------- /枕边算法/1.7.php: -------------------------------------------------------------------------------- 1 | 0){ 23 | //反过来 24 | $reNum = (int)implode('',array_reverse(str_split($num))); 25 | $newNum = $num+$reNum; 26 | 27 | if(isHuiWen($newNum)){ //出口 28 | return $num+$reNum; 29 | }else{ 30 | return huiwenshuzi($newNum); //递归 31 | } 32 | }else{ 33 | return '错误'; 34 | } 35 | } 36 | 37 | //判断是否回文 38 | function isHuiWen($str){ 39 | $str = preg_split('/(? 2 | 3 | 4 | 5 | AddLink 6 | 7 | 8 | 9 |

AddLink

10 | int AddLink() 11 |

Description

12 | Creates a new internal link and returns its identifier. An internal link is a clickable area 13 | which directs to another place within the document. 14 |
15 | The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is 16 | defined with SetLink(). 17 |

See also

18 | Cell, 19 | Write, 20 | Image, 21 | Link, 22 | SetLink 23 |
24 |
Index
25 | 26 | 27 | -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/9chainofresponsibility/chain.php: -------------------------------------------------------------------------------- 1 | successor = $nextHandler; 8 | } 9 | 10 | abstract public function HandleRequest(); 11 | } 12 | 13 | class ConcreteHandler1 extends Handler { 14 | public function HandleRequest() { 15 | echo 'ConcreteHandler1->HandleRequest' . PHP_EOL; 16 | 17 | if ($this->successor != null) { 18 | $this->successor->HandleRequest(); 19 | } else { 20 | echo 'Success1' . PHP_EOL; 21 | } 22 | } 23 | } 24 | 25 | class ConcreteHandler2 extends Handler { 26 | public function HandleRequest() { 27 | echo 'ConcreteHandler2->HandleRequest' . PHP_EOL; 28 | 29 | if ($this->successor != null) { 30 | $this->successor->HandlerRequest(); 31 | } else { 32 | echo 'Success2' . PHP_EOL; 33 | } 34 | } 35 | } 36 | 37 | $ch1 = new ConcreteHandler1(); 38 | $ch2 = new ConcreteHandler2(); 39 | $ch1->setSuccessor($ch2); 40 | $ch1->HandleRequest(); 41 | -------------------------------------------------------------------------------- /shenrulijiephp/12/temperature.php: -------------------------------------------------------------------------------- 1 | props[$key] = $val; 29 | } 30 | public function getProperty($key){ 31 | return $this->props[$key]; 32 | } 33 | } 34 | 35 | $pref = Preferences::getInstance(); 36 | $pref->setProperty("name","matt"); 37 | unset($pref); //移除引用 38 | 39 | $pref2 = Preferences::getInstance(); 40 | print $pref2->getProperty("name")."\n"; //属性值没有丢失 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/setlinewidth.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetLineWidth 6 | 7 | 8 | 9 |

SetLineWidth

10 | SetLineWidth(float width) 11 |

Description

12 | Defines the line width. By default, the value equals 0.2 mm. The method can be called before 13 | the first page is created and the value is retained from page to page. 14 |

Parameters

15 |
16 |
width
17 |
18 | The width. 19 |
20 |
21 |

See also

22 | Line, 23 | Rect, 24 | Cell, 25 | MultiCell 26 |
27 |
Index
28 | 29 | 30 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/setxy.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetXY 6 | 7 | 8 | 9 |

SetXY

10 | SetXY(float x, float y) 11 |

Description

12 | Defines the abscissa and ordinate of the current position. If the passed values are negative, 13 | they are relative respectively to the right and bottom of the page. 14 |

Parameters

15 |
16 |
x
17 |
18 | The value of the abscissa. 19 |
20 |
y
21 |
22 | The value of the ordinate. 23 |
24 |
25 |

See also

26 | SetX, 27 | SetY 28 |
29 |
Index
30 | 31 | 32 | -------------------------------------------------------------------------------- /shenrulijiephp/1-2.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | '; 18 | foreach($parent as $task_id =>$todo){ 19 | // echo "
  • $todo"; 20 | echo << $todo 22 | EOT; 23 | 24 | 25 | if(isset($task[$task_id])){ 26 | make_list($tasks[$task_id]); 27 | } 28 | echo "
  • "; 29 | } 30 | echo ''; 31 | } 32 | $dbc = mysqli_connect('localhost','root','root','books'); 33 | $q = "select * from tasks order by parent_id,date_added ASC"; 34 | $r = mysqli_query($dbc,$q); 35 | 36 | $tasks = array(); 37 | while(list($task_id,$parent_id,$task)=mysqli_fetch_array($r,MYSQLI_NUM)){ 38 | $tasks[$parent_id][$task_id] = $task; 39 | } 40 | make_list($tasks[0]); 41 | ?> 42 | 43 | 44 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 28 | // ->hourly(); 29 | } 30 | 31 | /** 32 | * Register the Closure based commands for the application. 33 | * 34 | * @return void 35 | */ 36 | protected function commands() 37 | { 38 | require base_path('routes/console.php'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/public/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /phpbianchengshizhan/wild.php: -------------------------------------------------------------------------------- 1 | type = "tiger"; 14 | } 15 | 16 | function get_type() 17 | { 18 | return $this->type; 19 | } 20 | } 21 | } 22 | 23 | namespace animal\wild{ 24 | class animal 25 | { 26 | static function whereami(){print __NAMESPACE__."\n";} 27 | function __construct() 28 | { 29 | $this->type = "tiger2"; 30 | } 31 | 32 | function get_type() 33 | { 34 | return $this->type; 35 | } 36 | } 37 | } 38 | namespace animal\domestic{ 39 | class animal 40 | { 41 | function __construct() 42 | { 43 | $this->type = "dog2"; 44 | } 45 | 46 | function get_type() 47 | { 48 | return $this->type; 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /shenrulijiephp/2/index.php: -------------------------------------------------------------------------------- 1 | conn == null ){ 23 | if(self::$pdo==null){ 24 | self::$pdo = new PDO($GLOBALS['DB_DSN'],$GLOBALS['DB_USER'],$GLOBALS['DB_PASSWD']); 25 | } 26 | $this->conn = $this->createDefaultDBConnection(self::$pdo,$GLOBALS['DB_DBNAME']); 27 | } 28 | return $this->conn; 29 | } 30 | 31 | protected function getDataSet() 32 | { 33 | // TODO: Implement getDataSet() method. 34 | } 35 | 36 | 37 | } -------------------------------------------------------------------------------- /shenrulijiephp/9/index.php: -------------------------------------------------------------------------------- 1 | query($q); 14 | // Check that rows were returned: 15 | if ($r && $r->rowCount() > 0) { 16 | 17 | // Set the fetch mode: 18 | $r->setFetchMode(PDO::FETCH_CLASS, 'Page'); 19 | 20 | // Records will be fetched in the view: 21 | include('views/index.html'); 22 | 23 | } else { // Problem! 24 | throw new Exception('No content is available to be viewed at this time.'); 25 | } 26 | 27 | } catch (Exception $e) { // Catch generic Exceptions. 28 | include('views/error.html'); 29 | } 30 | // Include the footer: 31 | include('includes/footer.inc.php'); 32 | ?> -------------------------------------------------------------------------------- /modernphp/ex5.php: -------------------------------------------------------------------------------- 1 | show(); -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/3/3.5.php: -------------------------------------------------------------------------------- 1 | "; 12 | } 13 | public static function test(){ 14 | self::call(); 15 | static::call(); 16 | } 17 | } 18 | class B extends A{ 19 | public static function call(){ 20 | echo "class B.
    "; 21 | } 22 | } 23 | B::test(); 24 | 25 | //后期静态绑定 26 | class AA{ 27 | public function call(){ 28 | echo "class A.
    "; 29 | } 30 | public function test(){ 31 | self::call(); 32 | static::call(); 33 | } 34 | } 35 | class BB extends AA{ 36 | public function call(){ 37 | echo "class B.
    "; 38 | } 39 | } 40 | 41 | $bb = new BB(); 42 | $bb->test(); 43 | 44 | class AAA{ 45 | public static function create(){ 46 | $self = new self(); 47 | $static = new static(); 48 | return [$self,$static]; 49 | } 50 | } 51 | class BBB extends AAA{ 52 | 53 | } 54 | 55 | $arr = BBB::create(); 56 | foreach($arr as $value){ 57 | var_dump($value); 58 | } -------------------------------------------------------------------------------- /phphexinjishuyuzuijiashijian/4.php: -------------------------------------------------------------------------------- 1 | setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 13 | $db->exec("SET NAMES 'UTF8'"); 14 | $sql = "INSERT INTO userinfo(`name`) VALUES ('aaaa')"; 15 | $db->exec($sql); 16 | 17 | //预处理 18 | $insert = $db->prepare("INSERT INTO userinfo(`name`) VALUES (?)"); 19 | $insert->execute(['bbbb']); 20 | 21 | //参数绑定 22 | $sth = $db->prepare("INSERT INTO userinfo(`name`) VALUES (:username)"); 23 | $username = 'ccccccccc'; 24 | $sth->bindParam(':username',$username,PDO::PARAM_STR,12); 25 | $sth->execute(); 26 | 27 | //异常 28 | $sql = "select * from userinfo"; 29 | $query = $db->prepare($sql); 30 | $query->execute(); 31 | var_dump($query->fetchAll(PDO::FETCH_ASSOC)); 32 | 33 | 34 | 35 | 36 | } catch (PDOException $e) { 37 | echo $e->getMessage(); 38 | } 39 | 40 | -------------------------------------------------------------------------------- /shenrulijiephp/10/get_quote.php: -------------------------------------------------------------------------------- 1 | The latest value for '.$read[0].'()'.$_GET['symbol'].' is $'; 17 | }else{ 18 | echo '
    Invalid symbol!
    '; 19 | } 20 | } 21 | ?> 22 |
    23 |
    24 | Enter a NYSE stock symbol to get the latest price 25 |

    26 |

    27 |
    28 |
    29 | -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/16bridge/bridge.php: -------------------------------------------------------------------------------- 1 | imp = $imp; 31 | } 32 | 33 | abstract public function Operation(); 34 | } 35 | 36 | class RefinedAbstration extends Abstraction 37 | { 38 | public function Operation() 39 | { 40 | $this->imp->OperationImp(); 41 | } 42 | } 43 | 44 | $impA = new ConcreteImplementorA(); 45 | $impB = new ConcreteImplementorB(); 46 | 47 | $ref = new RefinedAbstration(); 48 | 49 | $ref->setImplementor($impA); 50 | $ref->Operation(); 51 | 52 | $ref->setImplementor($impB); 53 | $ref->Operation(); 54 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/resources/assets/sass/_variables.scss: -------------------------------------------------------------------------------- 1 | 2 | // Body 3 | $body-bg: #f5f8fa; 4 | 5 | // Borders 6 | $laravel-border-color: darken($body-bg, 10%); 7 | $list-group-border: $laravel-border-color; 8 | $navbar-default-border: $laravel-border-color; 9 | $panel-default-border: $laravel-border-color; 10 | $panel-inner-border: $laravel-border-color; 11 | 12 | // Brands 13 | $brand-primary: #3097D1; 14 | $brand-info: #8eb4cb; 15 | $brand-success: #2ab27b; 16 | $brand-warning: #cbb956; 17 | $brand-danger: #bf5329; 18 | 19 | // Typography 20 | $icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/"; 21 | $font-family-sans-serif: "Raleway", sans-serif; 22 | $font-size-base: 14px; 23 | $line-height-base: 1.6; 24 | $text-color: #636b6f; 25 | 26 | // Navbar 27 | $navbar-default-bg: #fff; 28 | 29 | // Buttons 30 | $btn-default-color: $text-color; 31 | 32 | // Inputs 33 | $input-border: lighten($text-color, 40%); 34 | $input-border-focus: lighten($brand-primary, 25%); 35 | $input-color-placeholder: lighten($text-color, 30%); 36 | 37 | // Panels 38 | $panel-default-heading-bg: #fff; 39 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/setleftmargin.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetLeftMargin 6 | 7 | 8 | 9 |

    SetLeftMargin

    10 | SetLeftMargin(float margin) 11 |

    Description

    12 | Defines the left margin. The method can be called before creating the first page. 13 |
    14 | If the current abscissa gets out of page, it is brought back to the margin. 15 |

    Parameters

    16 |
    17 |
    margin
    18 |
    19 | The margin. 20 |
    21 |
    22 |

    See also

    23 | SetTopMargin, 24 | SetRightMargin, 25 | SetAutoPageBreak, 26 | SetMargins 27 |
    28 |
    Index
    29 | 30 | 31 | -------------------------------------------------------------------------------- /shenrulijiephp/3/sessions.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | DB Session Test 15 | 16 | 17 | Session data stored.

    '; 24 | }else{ 25 | echo '

    Session Data Exists:

    '.print_r($_SESSION,1).'

    '; 26 | } 27 | if(isset($_GET['logout'])){ 28 | session_destroy(); 29 | echo '

    Session destroyed.

    '; 30 | }else{ 31 | echo 'Log Out'; 32 | } 33 | echo '

    Session Data:

    '.print_r($_SESSION,1).'

    '; 34 | echo ''; 35 | session_write_close(); 36 | ?> -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/line.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Line 6 | 7 | 8 | 9 |

    Line

    10 | Line(float x1, float y1, float x2, float y2) 11 |

    Description

    12 | Draws a line between two points. 13 |

    Parameters

    14 |
    15 |
    x1
    16 |
    17 | Abscissa of first point. 18 |
    19 |
    y1
    20 |
    21 | Ordinate of first point. 22 |
    23 |
    x2
    24 |
    25 | Abscissa of second point. 26 |
    27 |
    y2
    28 |
    29 | Ordinate of second point. 30 |
    31 |
    32 |

    See also

    33 | SetLineWidth, 34 | SetDrawColor 35 |
    36 |
    Index
    37 | 38 | 39 | -------------------------------------------------------------------------------- /phpunit/DependencyAndDataProviderComboTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 24 | return 'first'; 25 | } 26 | 27 | public function testProducerSecond() 28 | { 29 | $this->assertTrue(true); 30 | return 'second'; 31 | } 32 | 33 | /** 34 | * @depends testProducerFirst 35 | * @depends testProducerSecond 36 | * @dataProvider provider 37 | */ 38 | public function testConsumer() 39 | { 40 | $this->assertEquals( 41 | ['provider1', 'first', 'second'], 42 | func_get_args() 43 | ); 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/sety.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetY 6 | 7 | 8 | 9 |

    SetY

    10 | SetY(float y [, boolean resetX]) 11 |

    Description

    12 | Sets the ordinate and optionally moves the current abscissa back to the left margin. If the value 13 | is negative, it is relative to the bottom of the page. 14 |

    Parameters

    15 |
    16 |
    y
    17 |
    18 | The value of the ordinate. 19 |
    20 |
    resetX
    21 |
    22 | Whether to reset the abscissa. Default value: true. 23 |
    24 |
    25 |

    See also

    26 | GetX, 27 | GetY, 28 | SetX, 29 | SetXY 30 |
    31 |
    Index
    32 | 33 | 34 | -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/7command/command.php: -------------------------------------------------------------------------------- 1 | receiver = $receiver; 9 | } 10 | 11 | abstract public function execute(); 12 | } 13 | 14 | // 命令具体实现 15 | class ConcreateCommand extends Command{ 16 | public function execute(){ 17 | $this->receiver->action(); 18 | } 19 | } 20 | 21 | // Invoker 请求者 22 | class Invoker{ 23 | private $command; 24 | 25 | public function setCommand(Command $command){ 26 | $this->command = $command; 27 | } 28 | 29 | public function executeCommand(){ 30 | $this->command->execute(); 31 | } 32 | } 33 | 34 | // Receiver 接收者 35 | class Receiver{ 36 | public function action(){ 37 | echo "命令执行啦!"; 38 | } 39 | } 40 | 41 | 42 | 43 | // 实例化Receiver 44 | $receiver = new Receiver(); 45 | // 实例化Command 46 | $command = new ConcreateCommand($receiver); 47 | // 实例化Invoker 48 | $invoker = new Invoker(); 49 | 50 | // 设置命令 51 | $invoker->setCommand($command); 52 | // 执行命令 53 | $invoker->executeCommand(); 54 | -------------------------------------------------------------------------------- /learningphp7highperformance/2/2.1.php: -------------------------------------------------------------------------------- 1 | name('Altaf Hussain'); 29 | echo $person->age(30); 30 | echo $person->isAlive(TRUE); 31 | 32 | //匿名类 33 | class Packt{ 34 | protected $number; 35 | public function __construct() 36 | { 37 | echo 'I am parent constructor'; 38 | } 39 | public function getNumber() : float{ 40 | return $this->number; 41 | } 42 | } 43 | 44 | $number = new class(5) extends Packt { 45 | public function __construct(float $number) 46 | { 47 | parent::__construct(); 48 | $this->number = $number; 49 | } 50 | }; 51 | echo $number->getNumber(); 52 | 53 | //统一变量语法 54 | $first = ['name'=>'second']; 55 | $second = 'Howdy'; 56 | echo $$first['name']; 57 | echo ${$first['name']}; -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/setcompression.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetCompression 6 | 7 | 8 | 9 |

    SetCompression

    10 | SetCompression(boolean compress) 11 |

    Description

    12 | Activates or deactivates page compression. When activated, the internal representation of 13 | each page is compressed, which leads to a compression ratio of about 2 for the resulting 14 | document. 15 |
    16 | Compression is on by default. 17 |
    18 |
    19 | Note: the Zlib extension is required for this feature. If not present, compression 20 | will be turned off. 21 |

    Parameters

    22 |
    23 |
    compress
    24 |
    25 | Boolean indicating if compression must be enabled. 26 |
    27 |
    28 |
    29 |
    Index
    30 | 31 | 32 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/settitle.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetTitle 6 | 7 | 8 | 9 |

    SetTitle

    10 | SetTitle(string title [, boolean isUTF8]) 11 |

    Description

    12 | Defines the title of the document. 13 |

    Parameters

    14 |
    15 |
    title
    16 |
    17 | The title. 18 |
    19 |
    isUTF8
    20 |
    21 | Indicates if the string is encoded in ISO-8859-1 (false) or UTF-8 (true).
    22 | Default value: false. 23 |
    24 |
    25 |

    See also

    26 | SetAuthor, 27 | SetCreator, 28 | SetKeywords, 29 | SetSubject 30 |
    31 |
    Index
    32 | 33 | 34 | -------------------------------------------------------------------------------- /shenrulijiephp/1.php: -------------------------------------------------------------------------------- 1 | 940,'key2'=>'blah'), 12 | array('key1'=>23,'key2'=>'this'), 13 | array('key1'=>894,'key2'=>'that') 14 | ); 15 | function asc_number_sort($x,$y){ 16 | if($x['key1']>$y['key1']){ 17 | return true; 18 | }elseif($x['key1']<$y['key1']){ 19 | return false; 20 | }else{ 21 | return 0; 22 | } 23 | } 24 | usort($a,'asc_number_sort'); 25 | print_r($a); 26 | 27 | function string_sort($x,$y){ 28 | return strcasecmp($x['key2'],$y['key2']); 29 | } 30 | usort($a,'string_sort'); 31 | print_r($a); 32 | 33 | 34 | //递归函数 35 | function list_dir($start){ 36 | $contents = scandir($start); 37 | foreach ($contents as $item){ 38 | if(is_dir("$start/$item")&&(substr($item,0,1)!='.')){ 39 | list_dir("$start/$item"); 40 | }else{ 41 | echo $item,PHP_EOL; 42 | } 43 | } 44 | } 45 | list_dir("."); 46 | 47 | //匿名函数使用 48 | array_map(function($value){echo $value['key1'],PHP_EOL;},$a); 49 | 50 | 51 | -------------------------------------------------------------------------------- /modernphp/ex2.php: -------------------------------------------------------------------------------- 1 | geocoder = $geocoder; 19 | } 20 | 21 | public function setAddress($address){ 22 | $this->address = $address; 23 | } 24 | 25 | public function getLatitude(){ 26 | return $this->geocoder."getLatitude"; 27 | } 28 | 29 | public function getLongitude(){ 30 | return $this->geocoder."getLongitude"; 31 | } 32 | 33 | protected function geocodeAddress(){ 34 | return $this->address."|".$this->geocoder; 35 | } 36 | } 37 | 38 | class RetailStore{ 39 | use Geocodable; 40 | //会覆盖 41 | // public function getLongitude(){ 42 | // return "aaa"; 43 | // } 44 | } 45 | 46 | $store = new RetailStore(); 47 | $store->setAddress("北京市"); 48 | $store->setGeocoder("100,200"); 49 | 50 | print_r($store->getLatitude()."|".$store->getLongitude()); 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/8strategy/strategy.php: -------------------------------------------------------------------------------- 1 | strategy = $strategy; 8 | } 9 | public function contextInterface() 10 | { 11 | return $this->strategy->algorithmInterface(); 12 | } 13 | } 14 | 15 | interface Strategy 16 | { 17 | public function algorithmInterface(); 18 | } 19 | 20 | class ConcreateStrategyA implements Strategy 21 | { 22 | public function algorithmInterface() 23 | { 24 | echo 'A'; 25 | } 26 | } 27 | 28 | class ConcreateStrategyB implements Strategy 29 | { 30 | public function algorithmInterface() 31 | { 32 | echo 'B'; 33 | } 34 | } 35 | 36 | class ConcreateStrategyC implements Strategy 37 | { 38 | public function algorithmInterface() 39 | { 40 | echo 'C'; 41 | } 42 | } 43 | 44 | $ctx = new Context(new ConcreateStrategyA()); 45 | echo $ctx->contextInterface(); 46 | 47 | $ctx = new Context(new ConcreateStrategyB()); 48 | echo $ctx->contextInterface(); 49 | 50 | $ctx = new Context(new ConcreateStrategyC()); 51 | echo $ctx->contextInterface(); 52 | 53 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/setsubject.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetSubject 6 | 7 | 8 | 9 |

    SetSubject

    10 | SetSubject(string subject [, boolean isUTF8]) 11 |

    Description

    12 | Defines the subject of the document. 13 |

    Parameters

    14 |
    15 |
    subject
    16 |
    17 | The subject. 18 |
    19 |
    isUTF8
    20 |
    21 | Indicates if the string is encoded in ISO-8859-1 (false) or UTF-8 (true).
    22 | Default value: false. 23 |
    24 |
    25 |

    See also

    26 | SetAuthor, 27 | SetCreator, 28 | SetKeywords, 29 | SetTitle 30 |
    31 |
    Index
    32 | 33 | 34 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/setauthor.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetAuthor 6 | 7 | 8 | 9 |

    SetAuthor

    10 | SetAuthor(string author [, boolean isUTF8]) 11 |

    Description

    12 | Defines the author of the document. 13 |

    Parameters

    14 |
    15 |
    author
    16 |
    17 | The name of the author. 18 |
    19 |
    isUTF8
    20 |
    21 | Indicates if the string is encoded in ISO-8859-1 (false) or UTF-8 (true).
    22 | Default value: false. 23 |
    24 |
    25 |

    See also

    26 | SetCreator, 27 | SetKeywords, 28 | SetSubject, 29 | SetTitle 30 |
    31 |
    Index
    32 | 33 | 34 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => realpath(storage_path('framework/views')), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest', ['except' => 'logout']); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | ], 21 | 22 | 'ses' => [ 23 | 'key' => env('SES_KEY'), 24 | 'secret' => env('SES_SECRET'), 25 | 'region' => 'us-east-1', 26 | ], 27 | 28 | 'sparkpost' => [ 29 | 'secret' => env('SPARKPOST_SECRET'), 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => App\User::class, 34 | 'key' => env('STRIPE_KEY'), 35 | 'secret' => env('STRIPE_SECRET'), 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /swoole/5-Server-HTTP.php: -------------------------------------------------------------------------------- 1 | http = new swoole_http_server("127.0.0.1", 9501); 16 | 17 | $this->http->set([ 18 | 'worker_num' => 16, 19 | 'daemonize' => false, 20 | 'max_request' => 10000, 21 | 'dispatch_mode' => 1 22 | ]); 23 | 24 | $this->http->on('Start', [$this, 'onStart']); 25 | $this->http->on('request', [$this, 'onRequest']); 26 | $this->http->on('message', [$this, 'onMessage']); 27 | $this->http->start(); 28 | } 29 | 30 | public function onStart($serv) 31 | { 32 | echo "Start\n"; 33 | } 34 | 35 | public function onRequest($request, $response) 36 | { 37 | $response->end("

    Hello Swoole.

    "); 38 | } 39 | 40 | public function onMessage($request, $response) 41 | { 42 | echo $request->message; 43 | $response->message(json_encode(["data1", "data2"])); 44 | } 45 | } 46 | 47 | new Server(); -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/app/Http/Controllers/Auth/WebAuthController.php: -------------------------------------------------------------------------------- 1 | middleware('guest', ['except' => ['getLogout', 'getRegister']]); 25 | } 26 | 27 | protected function validator(array $data){ 28 | return Validator::make($data,[ 29 | 'username'=>'required|max:255', 30 | 'account'=>'required|max:255|unique:users', 31 | 'password'=>'required|confirmed|min:6' 32 | ]); 33 | } 34 | 35 | protected function create(array $data){ 36 | return Users::create([ 37 | 'username'=>$data['username'], 38 | 'account'=>$data['account'], 39 | 'password'=>bcrypt($data['password']), 40 | 'addtime' 41 | ]); 42 | } 43 | } -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/setlink.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetLink 6 | 7 | 8 | 9 |

    SetLink

    10 | SetLink(int link [, float y [, int page]]) 11 |

    Description

    12 | Defines the page and position a link points to. 13 |

    Parameters

    14 |
    15 |
    link
    16 |
    17 | The link identifier returned by AddLink(). 18 |
    19 |
    y
    20 |
    21 | Ordinate of target position; -1 indicates the current position. 22 | The default value is 0 (top of page). 23 |
    24 |
    page
    25 |
    26 | Number of target page; -1 indicates the current page. This is the default value. 27 |
    28 |
    29 |

    See also

    30 | AddLink 31 |
    32 |
    Index
    33 | 34 | 35 | -------------------------------------------------------------------------------- /LearningPHPDesignPatterns/20state/state.php: -------------------------------------------------------------------------------- 1 | state = $state; 9 | } 10 | 11 | public function setState(State $state) 12 | { 13 | echo '当前状态:' . get_class($this->state), PHP_EOL; 14 | $this->state = $state; 15 | } 16 | 17 | public function getState() 18 | { 19 | return $this->state; 20 | } 21 | 22 | public function Request() 23 | { 24 | $this->state->Handle($this); 25 | } 26 | } 27 | 28 | interface State 29 | { 30 | public function Handle(Context $context); 31 | } 32 | 33 | class ConcreteStateA implements State 34 | { 35 | public function Handle(Context $context) 36 | { 37 | $context->setState(new ConcreteStateB()); 38 | } 39 | } 40 | 41 | class ConcreteStateB implements State 42 | { 43 | public function Handle(Context $context) 44 | { 45 | $context->setState(new ConcreteStateA()); 46 | } 47 | } 48 | 49 | $context = new Context(new ConcreteStateA()); 50 | 51 | $context->Request(); 52 | $context->Request(); 53 | $context->Request(); 54 | $context->Request(); 55 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Feature 14 | 15 | 16 | 17 | ./tests/Unit 18 | 19 | 20 | 21 | 22 | ./app 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /mytools/字符中间加星号中英文.php: -------------------------------------------------------------------------------- 1 | $len){ 27 | return $str; 28 | } 29 | if ($start == 0 ) { 30 | $start = 1; 31 | } 32 | if ($end > $len) { 33 | $end = $len - 2; 34 | } 35 | $endStart = $len - $end; 36 | $top = mb_substr($str, 0, $start, $charset); 37 | $bottom = ""; 38 | if ($endStart > 0) { 39 | $bottom = mb_substr($str, $endStart, $end, $charset); 40 | } 41 | $len = $len - mb_strlen($top, $charset) - mb_strlen($bottom, $charset); 42 | $len = $len > 0 ? $len : 0; 43 | 44 | return $top . str_repeat($dot, $len) . $bottom; 45 | } 46 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/setkeywords.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetKeywords 6 | 7 | 8 | 9 |

    SetKeywords

    10 | SetKeywords(string keywords [, boolean isUTF8]) 11 |

    Description

    12 | Associates keywords with the document, generally in the form 'keyword1 keyword2 ...'. 13 |

    Parameters

    14 |
    15 |
    keywords
    16 |
    17 | The list of keywords. 18 |
    19 |
    isUTF8
    20 |
    21 | Indicates if the string is encoded in ISO-8859-1 (false) or UTF-8 (true).
    22 | Default value: false. 23 |
    24 |
    25 |

    See also

    26 | SetAuthor, 27 | SetCreator, 28 | SetSubject, 29 | SetTitle 30 |
    31 |
    Index
    32 | 33 | 34 | -------------------------------------------------------------------------------- /laravelkuangjiaguanjianjishujiexi/laravel/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 5 | "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch-poll": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 7 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 8 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 9 | }, 10 | "devDependencies": { 11 | "axios": "^0.15.3", 12 | "bootstrap-sass": "^3.3.7", 13 | "cross-env": "^3.2.3", 14 | "jquery": "^3.1.1", 15 | "laravel-mix": "^0.8.3", 16 | "lodash": "^4.17.4", 17 | "vue": "^2.1.10" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /shenrulijiephp/10/service.php: -------------------------------------------------------------------------------- 1 | $v){ 28 | $data[$k] = $v; 29 | } 30 | 31 | if($type=='application/json'){ 32 | $output = json_encode($data); 33 | }elseif($type=='text/csv'){ 34 | $output = ''; 35 | foreach($data as $v){ 36 | $output .='"'.$v.'",'; 37 | } 38 | $output = substr($output,0,-1); 39 | }elseif($type=='text/plain'){ 40 | $output = print_r($data,1); 41 | } 42 | }else{ 43 | $type = 'text/plain'; 44 | $output = 'This service has been incorrectly used.'; 45 | } 46 | header('Content-Type:'.$type); 47 | echo $output; 48 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/setcreator.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetCreator 6 | 7 | 8 | 9 |

    SetCreator

    10 | SetCreator(string creator [, boolean isUTF8]) 11 |

    Description

    12 | Defines the creator of the document. This is typically the name of the application that 13 | generates the PDF. 14 |

    Parameters

    15 |
    16 |
    creator
    17 |
    18 | The name of the creator. 19 |
    20 |
    isUTF8
    21 |
    22 | Indicates if the string is encoded in ISO-8859-1 (false) or UTF-8 (true).
    23 | Default value: false. 24 |
    25 |
    26 |

    See also

    27 | SetAuthor, 28 | SetKeywords, 29 | SetSubject, 30 | SetTitle 31 |
    32 |
    Index
    33 | 34 | 35 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/setmargins.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetMargins 6 | 7 | 8 | 9 |

    SetMargins

    10 | SetMargins(float left, float top [, float right]) 11 |

    Description

    12 | Defines the left, top and right margins. By default, they equal 1 cm. Call this method to change 13 | them. 14 |

    Parameters

    15 |
    16 |
    left
    17 |
    18 | Left margin. 19 |
    20 |
    top
    21 |
    22 | Top margin. 23 |
    24 |
    right
    25 |
    26 | Right margin. Default value is the left one. 27 |
    28 |
    29 |

    See also

    30 | SetLeftMargin, 31 | SetTopMargin, 32 | SetRightMargin, 33 | SetAutoPageBreak 34 |
    35 |
    Index
    36 | 37 | 38 | -------------------------------------------------------------------------------- /phpprogramming/fpdf181/doc/setautopagebreak.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SetAutoPageBreak 6 | 7 | 8 | 9 |

    SetAutoPageBreak

    10 | SetAutoPageBreak(boolean auto [, float margin]) 11 |

    Description

    12 | Enables or disables the automatic page breaking mode. When enabling, the second parameter is 13 | the distance from the bottom of the page that defines the triggering limit. By default, the 14 | mode is on and the margin is 2 cm. 15 |

    Parameters

    16 |
    17 |
    auto
    18 |
    19 | Boolean indicating if mode should be on or off. 20 |
    21 |
    margin
    22 |
    23 | Distance from the bottom of the page. 24 |
    25 |
    26 |

    See also

    27 | Cell, 28 | MultiCell, 29 | AcceptPageBreak 30 |
    31 |
    Index
    32 | 33 | 34 | -------------------------------------------------------------------------------- /shenrulijiephp/13/books4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide 7 | Larry Ullman 8 | 2012 9 | PHP's Command-Line Interface 10 | XML and PHP 11 | Debugging, Testing, and Performance 12 | 13 | 14 | 15 | Modern JavaScript: Develop and Design 16 | Larry Ullman 17 | 2012 18 | 612 19 | (Re-)Introducing JavaScript 20 | JavaScript in Action 21 | Tools of the Trade 22 | 23 | 24 | C++ Programming: Visual QuickStart Guide 25 | Larry Ullman 26 | Andreas Signer 27 | 2006 28 | 500 29 | Namespaces & Modularization 30 | 31 | --------------------------------------------------------------------------------