- Jun 2024
-
-
- openai use LiveKit to deliver realtime voice
- playground: https://cloud.livekit.io/projects/
-
- Mar 2024
-
medium.com medium.com
-
fileinfo
但是我的机器上是有的啊?
我也遇到了,但是不清楚是什么原因?可能确实和 PHP 有关!
-
- Jan 2024
-
alexcabal.com alexcabal.com
-
first published #2022/02/11
Apart from the framing of this post more as an apology than as a show of strength of keeping things simple and sturdy, interesting nuggets: Epub ebooks are xhtml and static so rapidly served without the need for a fancy framework or even a database. Flat texts are small, and their current collection fits in RAM entirely. PHP is used without frills. All in all a strong call to keep things simple, and to embrace my current use of php for local tools too: it's very fast.
Also makes me wonder: #openvraag what can one do with Epub books outside an ebook reader, in terms of excerpting e.g. and ripping things out for re-use elsewhere. I've got loads of them on my laptop
-
- May 2023
-
github.com github.com
-
```php
$record) { if ($name<>"count" and $name<>"specials") { foreach ($record["site"] as $sitelink) { $site[$sitelink["dbname"]]=$sitelink["url"]; } } if ($name==="specials") { foreach ($record as $sitelink) { $site[$sitelink["dbname"]]=$sitelink["url"]; } } } /* Open files */ $fp = fopen('data/'.$entity_proc.'.ttl', 'w'); fwrite($fp, "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n"); fwrite($fp, "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n"); fwrite($fp, "@prefix skos: <http://www.w3.org/2004/02/skos/core#> .\n"); fwrite($fp, "@prefix wd: <http://www.wikidata.org/entity/> .\n"); fwrite($fp, "@prefix wdt: <http://www.wikidata.org/prop/direct/> .\n"); fwrite($fp,"\n"); fwrite($fp,"<http://www.wikidata.org/categories> rdf:type skos:ConceptScheme ;\n"); fwrite($fp," skos:prefLabel \"Wikidata categories\"@en .\n\n"); // echo $list_entities."\n"; $url = "https://www.wikidata.org/w/api.php?action=wbgetentities&ids=".$entity_proc."&props=labels|aliases|sitelinks&format=php&utf8="; $a = unserialize(file_get_contents($url)); foreach ($a["entities"] as $entity=>$data_entity) { fwrite($fp,"wd:".$entity." rdf:type skos:Concept ;\n"); fwrite($fp," skos:inScheme <http://www.wikidata.org/categories> "); if (isset($data_entity["labels"])) { foreach ($data_entity["labels"] as $label) { fwrite($fp,";\n skos:prefLabel \"".$label["value"]."\"@".$label["language"]." "); } } if (isset($data_entity["aliases"])) { foreach ($data_entity["aliases"] as $item) { foreach ($item as $label) { fwrite($fp,";\n skos:altLabel> \"".$label["value"]."\"@".$label["language"]." "); } } } foreach ($data_entity["sitelinks"] as $item) { if (in_array($item["site"],$array_sources)) { /* GET BROADER CATEGORIES */ $repeat_query=true; $cmcontinue=""; while ($repeat_query==true) { $repeat_query = false; $url_wiki = $site[$item["site"]]."/w/api.php?action=query&generator=categories&titles=".urlencode($item["title"])."&prop=pageprops|categoryinfo&format=php&utf8=".$cmcontinue; $b = unserialize(file_get_contents($url_wiki)); if (isset($b["continue"]["cmcontinue"])) { $repeat_query = true; $cmcontinue = $b["continue"]["cmcontinue"]; } if (isset($b["query"]["pages"])) { foreach ($b["query"]["pages"] as $broadcat) { if (isset($broadcat["pageprops"]["wikibase_item"])) { if (!isset($broader[$broadcat["pageprops"]["wikibase_item"]])) {$broader[$broadcat["pageprops"]["wikibase_item"]]=$broadcat["title"];} // fwrite($fp,"<http://www.wikidata.org/entity/".$entity_proc."> <http://www.w3.org/2004/02/skos/core#broader> <http://www.wikidata.org/entity/".$broadcat["pageprops"]["wikibase_item"]."> <http://www.wikidata.org/categories/".$item["site"]."> .\n"); } } } } /* GET NARROWER CATEGORIES */ $repeat_query=true; $cmcontinue=""; while ($repeat_query==true) { $repeat_query = false; $url_wiki = $site[$item["site"]]."/w/api.php?action=query&generator=categorymembers&gcmtitle=".urlencode($item["title"])."&gcmtype=subcat&prop=pageprops|categoryinfo&format=php&utf8=".$cmcontinue; $b = unserialize(file_get_contents($url_wiki)); if (isset($b["continue"]["cmcontinue"])) { $repeat_query = true; $cmcontinue = $b["continue"]["cmcontinue"]; } if (isset($b["query"]["pages"])) { foreach ($b["query"]["pages"] as $narrowcat) { if (isset($narrowcat["pageprops"]["wikibase_item"])) { if (!isset($narrower[$narrowcat["pageprops"]["wikibase_item"]]) or $item["site"]=="enwiki") {$narrower[$narrowcat["pageprops"]["wikibase_item"]]=$narrowcat["title"];} // fwrite($fp,"<http://www.wikidata.org/entity/".$entity_proc."> <http://www.w3.org/2004/02/skos/core#narrower> <http://www.wikidata.org/entity/".$narrowcat["pageprops"]["wikibase_item"]."> <http://www.wikidata.org/categories/".$item["site"]."> .\n"); } } } } } } } $prevalue=""; foreach ($broader as $target=>$value) { fwrite($fp,";".$prevalue."\n skos:broader wd:".$target); $prevalue=" # ".$value; } if ($prevalue!=="") {fwrite($fp,$prevalue);} $prevalue=""; foreach ($narrower as $target=>$value) { fwrite($fp,";".$prevalue."\n skos:narrower wd:".$target); $prevalue=" # ".$value; } if ($prevalue!=="") {fwrite($fp,$prevalue);} fwrite($fp,".\n\n"); fclose($fp); ?>```
Tags
Annotators
URL
-
- Dec 2022
-
www.zhihu.com www.zhihu.com
-
如何通俗地解释 CGI、FastCGI、php-fpm 之间的关系?
Tags
Annotators
URL
-
- Jul 2022
-
www.php.net www.php.net
-
PHP est un langage de script utilisé le plus souvent côté serveur : dans cette architecture, le serveur interprète le code PHP des pages web demandées et génère du code (HTML, XHTML, CSS par exemple) et des données (JPEG, GIF, PNG par exemple) pouvant être interprétés et rendus par un navigateur web. PHP peut également générer d'autres formats comme le WML, le SVG et le PDF.
-
-
www.phpied.com www.phpied.com
-
In the functions.php of your WordPress theme add:
Same solution but in PHP
php function hints() { header("link: </wp-content/themes/phpied2/style.css>; rel=preload, </wp-includes/css/dist/block-library/style.min.css?ver=5.4.1>; rel=preload"); } add_action('send_headers', 'hints');
-
- Jun 2022
-
www.php.net www.php.net
-
<?php$base = array("orange", "banana", "apple", "raspberry");$replacements = array(0 => "pineapple", 4 => "cherry");$replacements2 = array(0 => "grape");$basket = array_replace($base, $replacements, $replacements2);print_r($basket);?> The above example will output: Array ( [0] => grape [1] => banana [2] => apple [3] => raspberry [4] => cherry )
array_replace() replaces the values of array with values having the same keys in each of the following arrays.
-
- May 2022
-
www.cnblogs.com www.cnblogs.com
-
FastCGI是语言无关的、可伸缩架构的CGI开放扩展,其主要行为是将CGI解释器进程一直保持在内存,不是fork-and-execute,并因此获得较高的性能。FastCGI支持分布式部署,可以部署在WEB服务器以外的多个主机上。 PHP-CGI作为PHP自带的PHP FastCGI管理器对FastCGI的管理方式简单,也不够灵活高效。 PHP-FPM为了解决PHP-CGI的不足,为PHP FastCGI提供了一种新的进程管理方式,可以有效控制进程,平滑重载PHP配置,其master process是常驻内存的,worker process有static、dynamic、ondemand三种管理方式。PHP-FPM进程池中的CGI在接受并处理完pm.max_requests个用户请求后将会respawn,并不会保证单个CGI是long-live and always be running,而会以更加灵活高效的方式来保证客户端的连接请求可以被多个CGI处理。
-
-
segmentfault.com segmentfault.com
-
首先,跨域请求分为两种,一种是简单请求,即get请求和post请求(不带多余的请求头),这种情况下,浏览器会直接请求,在有允许跨域的头的情况下,予以显示。(这里并不是说没有跨域头服务器就不返回数据了,数据是照常返回的,但是浏览器拦截了返回数据。)另一种呢是复杂请求,即非get或post请求,或者是有了自定义头的请求。这种情况下,浏览器会首先发送一个options请求(预请求),来确是否允许跨域。在服务器返回的跨域条件都允许之后,浏览器才会发送正式请求。
首先,跨域请求分为两种,一种是简单请求,即get请求和post请求(不带多余的请求头),这种情况下,浏览器会直接请求,在有允许跨域的头的情况下,予以显示。(这里并不是说没有跨域头服务器就不返回数据了,数据是照常返回的,但是浏览器拦截了返回数据。) 另一种呢是复杂请求,即非get或post请求,或者是有了自定义头的请求。这种情况下,浏览器会首先发送一个options请求(预请求),来确是否允许跨域。在服务器返回的跨域条件都允许之后,浏览器才会发送正式请求。
-
php 跨域请求执行了两次接口, CORS,
php,请求跨域接口;执行了两次请求;OPTIONS(预处理);get(真正请求);
按理来说,OPTIONS(预处理) 只是判断 header('Access-Control-Allow-Headers:x-requested-with,content-type');是否通过;通过了,才执行get; 现在出现的问题是,OPTIONS请求也执行了一次程序;然后get也执行了一次程序;
解决办法: if (strtolower($_SERVER['REQUEST_METHOD']) == 'options') { exit; }
Tags
Annotators
URL
-
-
ask.csdn.net ask.csdn.net
-
{错误:spawn C:\ wamp \ bin \ php \ php7.2.14 ENOENT 在Process.ChildProcess._handle.onexit at on OnErrorNT(internal / child_process.js:406:16) at process._tickCallback(internal / process / next_tick.js:63: 19) errno:'ENOENT', 代码:'ENOENT', 系统调用:'spawn C:\ wamp \ bin \ php \ php7.2.14', 路径:'C:\ \ wamp \ bin \ php \ php7.2.14', spawnargs:['c:\ wamp \ www \ NULB \ admin \ index.php']} < / pre>
Tags
Annotators
URL
-
- Apr 2022
-
stackoverflow.com stackoverflow.com
-
PHP try/catch and fatal error
-
- Jan 2022
-
www.jetbrains.com www.jetbrains.com
-
php.ini
php -i | grep ini /opt/homebrew/etc/php/8.1/php.ini
Tags
Annotators
URL
-
- Dec 2021
- Feb 2021
-
hub.docker.com hub.docker.comphp1
-
-apache
Meaning you need to append "-apache" to the image name to have Apache with PHP.
Tags
Annotators
URL
-
- May 2020
-
ma.ttias.be ma.ttias.be
-
wiki.php.net wiki.php.net
Tags
Annotators
URL
-
-
muldoon.cloud muldoon.cloud
-
Programming languages These will probably expose my ignorance pretty nicely.
When to use different programming languages (advice from an Amazon employee):
- Java - enterprise applications
- C# - Microsoft's spin on Java (useful in the Microsoft's ecosystem)
- Ruby - when speed is more important then legibility or debugging
- Python - same as Ruby but also for ML/AI (don't forget to use type hinting to make life a little saner)
- Go/Rust - fresh web service where latency and performance were more important than community/library support
- Haskell/Erlang - for very elegant/mathematical functional approach without a lot of business logic
- Clojure - in situation when you love Lisp (?)
- Kotlin/Scala - languages compiling to JVM bytecode (preferable over Clojure). Kotlin works with Java and has great IntelliJ support
- C - classes of applications (operating systems, language design, low-level programming and hardware)
- C++ - robotics, video games and high frequency trading where the performance gains from no garbage collection make it preferable to Java
- PHP/Hack - testing server changes without rebuilding. PHP is banned at Amazon due to security reasons, but its successor, Hack, runs a lot of Facebook and Slack's backends
-
- Apr 2020
-
-
PHP built-in server with sqlite enabled
Docker based PHP development environment
Tags
Annotators
URL
-
- Mar 2020
-
paramaggarwal.substack.com paramaggarwal.substack.com
-
And so was born PHP, it feels like a natural extension to HTML itself. You write your code between your HTML file itself and then be able to run those parts on the server, which further generate HTML and the final HTML gets send to the browser.This was extremely powerful. We could serve completely different pages to different users even though all of them access the same URL like Facebook. We could use a database on a server and store some data there, then based on some conditions use this data to modify the generated HTML and technically have an infinite number of pages available to serve (e-commerce).
Birth of PHP - way to serve different content under the same URL
-
-
bernardic.ca bernardic.ca
-
The popular question in my company these days is “Rails or WordPress?”, but I will probably touch upon the broader questions of “MVC or CMS?” and “Ruby or PHP?”, so you can often substitute “Rails” for “MVC framework” in the article.
-
-
laravel.com laravel.com
-
- Jan 2020
-
infokaistatic.s3.amazonaws.com infokaistatic.s3.amazonaws.com
-
REST exposes Uniform Resource Identifiers (URI) that are linked to resources. These links are called REST endpoints. Depending on the HTTP type used to access them, they will perform an action on the resource (change its state). The HTTP type is used to signal the REST verb to be performed.
How REST works in a nutshell
-
- Dec 2019
-
github.com github.com
Tags
Annotators
URL
-
- Nov 2019
-
www.silverstripe.org www.silverstripe.org
Tags
Annotators
URL
-
-
www.msweet.org www.msweet.org
-
- Oct 2019
-
www.thinktocode.com www.thinktocode.com
-
This can become messy when you have a lot of configurations in your Entity. Another issue is that your annotations are coupled to your source code. Your database implementations details, or any other configurations are coupled to your domain object. This goes against the guidelines of clean code. Your domain object (Entity) should only have one reason to change.
Thank you for saying that loud.
-
- Aug 2019
-
hypothes.is hypothes.is
-
Centric web solution is the renowned best web development company.
We have a very highly experienced and expert development team who are experts in web design & development.
We provide various services like Wordpress web development, eCommerce web development, Wordpress theme design and plugin development, website maintenance & optimization.
For more our services call us on +91 98587 58541 or visit our website https://www.centricwebsolution.com/.
Our Services Are:-
- Web Design & Development
- WordPress Development
- WooCommerce Development
- Custom Web Application Development
- Website Migration Services
- Website Maintenance & Performance optimization
- Website Plugin and API Development
- Website Store Optimization
- PHP Web Development
- Enterprise Web Application Development
- Laravel Development Services
- Angularjs Development Services
Tags
- WooCommerce Development
- Custom Web Application Development
- Website Migration Services
- PHP Web Development
- Enterprise Web Application Development
- Laravel Development Services
- Angularjs Development Services
- Website Maintenance & Performance optimization
- Website Plugin and API Development
- Website Store Optimization
- Web Design & Development
Annotators
URL
-
- Aug 2016
-
news.php.net news.php.net
-
Back when PHP had less than 100 functions and the function hashing mechanism was strlen(). In order to get a nice hash distribution of function names across the various function name lengths names were picked specifically to make them fit into a specific length bucket.
...
-
- Nov 2014
-
blog.whatfettle.com blog.whatfettle.com
-
There’s a certain amount of snobbery about PHP, but I’ve no truck for such snark. PHP is the Web’s BASIC. It’s everywhere, beginner-friendly, and I like it.
-