{"id":385,"date":"2021-08-18T09:34:07","date_gmt":"2021-08-18T12:34:07","guid":{"rendered":"http:\/\/hackerzone.com.br\/blog\/?p=385"},"modified":"2022-08-13T00:08:40","modified_gmt":"2022-08-13T03:08:40","slug":"retornando-tipos-de-pastas-no-php","status":"publish","type":"post","link":"http:\/\/hackerzone.com.br\/blog\/retornando-tipos-de-pastas-no-php\/","title":{"rendered":"Retornando tipos de pastas no PHP"},"content":{"rendered":"<p>Retorna o diret\u00f3rio p\u00fablico<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n$_SERVER['DOCUMENT_ROOT'];\r\n\/\/ Ex: \/home\/usuario\/public_html\r\n<\/pre>\n<p>Retorna o diret\u00f3rio home do usu\u00e1rio<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\ngetcwd();\r\n\/\/ Ex: \/home\/usuario\r\n<\/pre>\n<p>Retorna o caminho todo at\u00e9 chegar no arquivo atual<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\ndirname(__FILE__);\r\n\/\/ Ex: \/home\/usuario\/public_html\/site\/controller\r\n<\/pre>\n<p>Retorna o nome da pasta<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nbasename(__DIR__);\r\n\/\/ Ex: Controller\r\n<\/pre>\n<p>Retorna o nome do diret\u00f3rio do diret\u00f3rio atual<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\ndirname(__DIR__);\r\n\/\/ Ex: \/home\/usuario\/public_html\/site\r\n<\/pre>\n<p>Pega o nome do arquivo atual<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nbasename(__FILE__);\r\n\/\/ Ex: orcamento.php\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Retorna o diret\u00f3rio p\u00fablico Retorna o diret\u00f3rio home do usu\u00e1rio Retorna o caminho todo at\u00e9 chegar no arquivo atual Retorna o nome da pasta Retorna o nome do diret\u00f3rio do diret\u00f3rio atual Pega o nome do arquivo atual<\/p>\n","protected":false},"author":1,"featured_media":456,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[173,175,174,15],"class_list":["post-385","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-document_root","tag-file","tag-folder","tag-php","cat-12-id","has_thumb"],"_links":{"self":[{"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/posts\/385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/comments?post=385"}],"version-history":[{"count":1,"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/posts\/385\/revisions"}],"predecessor-version":[{"id":387,"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/posts\/385\/revisions\/387"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/media\/456"}],"wp:attachment":[{"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/media?parent=385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/categories?post=385"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hackerzone.com.br\/blog\/wp-json\/wp\/v2\/tags?post=385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}