px-files/_sys/php/commands/api.php
private function api_get(){
		$sitemap_filter_options = function($px, $cmd=null){
			$options = array();
			$options['filter'] = $px->req()->get_param('filter');
			if( strlen($options['filter']) ){
				switch( $options['filter'] ){
					case 'true':
					case '1':
						$options['filter'] = true;
						break;
					case 'false':
					case '0':
						$options['filter'] = false;
						break;
				}
			}
			return $options;
		};

		switch( $this->command[2] ){
			case 'version':
				$val = $this->px->get_version();
				print $this->data_convert( $val );
				break;
			case 'config':
				$val = $this->px->conf();
				print $this->data_convert( $val );
				break;
			case 'sitemap':
				$val = ($this->px->site() ? $this->px->site()->get_sitemap() : false);
				print $this->data_convert( $val );
				break;
			case 'page_info':
				$path = $this->px->req()->get_param('path');
				if( is_null($path) ){
					$path = $this->px->req()->get_request_file_path();
				}
				$val = ($this->px->site() ? $this->px->site()->get_page_info($path) : false);
				print $this->data_convert( $val );
				break;
			case 'page_originated_csv':
				$path = $this->px->req()->get_param('path');
				if( is_null($path) ){
					$path = $this->px->req()->get_request_file_path();
				}
				$val = ($this->px->site() ? $this->px->site()->get_page_originated_csv($path) : false);
				print $this->data_convert( $val );
				break;
			case 'parent':
				$val = ($this->px->site() ? $this->px->site()->get_parent() : false);
				print $this->data_convert( $val );
				break;
			case 'actors':
				$val = ($this->px->site() ? $this->px->site()->get_actors() : false);
				print $this->data_convert( $val );
				break;
			case 'role':
				$val = ($this->px->site() ? $this->px->site()->get_role() : false);
				print $this->data_convert( $val );
				break;
			case 'children':
				$val = ($this->px->site() ? $this->px->site()->get_children(null, $sitemap_filter_options($this->px, $this->command[2])) : false);
				print $this->data_convert( $val );
				break;
			case 'bros':
				$val = ($this->px->site() ? $this->px->site()->get_bros(null, $sitemap_filter_options($this->px, $this->command[2])) : false);
				print $this->data_convert( $val );
				break;
			case 'bros_next':
				$val = ($this->px->site() ? $this->px->site()->get_bros_next(null, $sitemap_filter_options($this->px, $this->command[2])) : false);
				print $this->data_convert( $val );
				break;
			case 'bros_prev':
				$val = ($this->px->site() ? $this->px->site()->get_bros_prev(null, $sitemap_filter_options($this->px, $this->command[2])) : false);
				print $this->data_convert( $val );
				break;
			case 'next':
				$val = ($this->px->site() ? $this->px->site()->get_next(null, $sitemap_filter_options($this->px, $this->command[2])) : false);
				print $this->data_convert( $val );
				break;
			case 'prev':
				$val = ($this->px->site() ? $this->px->site()->get_prev(null, $sitemap_filter_options($this->px, $this->command[2])) : false);
				print $this->data_convert( $val );
				break;
			case 'breadcrumb_array':
				$val = ($this->px->site() ? $this->px->site()->get_breadcrumb_array() : false);
				print $this->data_convert( $val );
				break;
			case 'dynamic_path_info':
				$val = ($this->px->site() ? $this->px->site()->get_dynamic_path_info($this->px->req()->get_param('path')) : false);
				print $this->data_convert( $val );
				break;
			case 'bind_dynamic_path_param':
				$param = $this->px->req()->get_param('param');
				$param = @json_decode( $param, true );
				$val = ($this->px->site() ? $this->px->site()->bind_dynamic_path_param($this->px->req()->get_param('path'), $param) : false);
				print $this->data_convert( $val );
				unset($param);
				break;
			case 'path_homedir': // deprecated
				$val = $this->px->get_realpath_homedir();
				print $this->data_convert( $val );
				break;
			case 'realpath_homedir':
				$val = $this->px->get_realpath_homedir();
				print $this->data_convert( $val );
				break;
			case 'path_controot':
				$val = $this->px->get_path_controot();
				print $this->data_convert( $val );
				break;
			case 'path_docroot': // deprecated
				$val = $this->px->get_realpath_docroot();
				print $this->data_convert( $val );
				break;
			case 'realpath_docroot':
				$val = $this->px->get_realpath_docroot();
				print $this->data_convert( $val );
				break;
			case 'path_content':
				$val = $this->px->get_path_content();
				print $this->data_convert( $val );
				break;
			case 'path_files':
				$val = ($this->px->site() ? $this->px->path_files($this->px->req()->get_param('path_resource')) : false);
				print $this->data_convert( $val );
				break;
			case 'realpath_files':
				$val = ($this->px->site() ? $this->px->realpath_files($this->px->req()->get_param('path_resource')) : false);
				print $this->data_convert( $val );
				break;
			case 'path_files_cache':
				$val = ($this->px->site() ? $this->px->path_files_cache($this->px->req()->get_param('path_resource')) : false);
				print $this->data_convert( $val );
				break;
			case 'realpath_files_cache':
				$val = ($this->px->site() ? $this->px->realpath_files_cache($this->px->req()->get_param('path_resource')) : false);
				print $this->data_convert( $val );
				break;
			case 'realpath_files_private_cache':
				$val = ($this->px->site() ? $this->px->realpath_files_private_cache($this->px->req()->get_param('path_resource')) : false);
				print $this->data_convert( $val );
				break;
			case 'domain':
				$val = $this->px->get_domain();
				print $this->data_convert( $val );
				break;
			case 'directory_index':
				$val = $this->px->get_directory_index();
				print $this->data_convert( $val );
				break;
			case 'directory_index_primary':
				$val = $this->px->get_directory_index_primary();
				print $this->data_convert( $val );
				break;
			case 'path_proc_type':
				$val = $this->px->get_path_proc_type();
				print $this->data_convert( $val );
				break;
			case 'href':
				$val = ($this->px->site() ? $this->px->href($this->px->req()->get_param('linkto')) : false);
				print $this->data_convert( $val );
				break;
			case 'canonical':
				$val = ($this->px->site() ? $this->px->canonical($this->px->req()->get_param('linkto')) : false);
				print $this->data_convert( $val );
				break;
			default:
				print $this->data_convert( array('result'=>0) );
				break;
		}
		exit;
	}
private function api_get(){
		$sitemap_filter_options = function($px, $cmd=null){
			$options = array();
			$options['filter'] = $px->req()->get_param('filter');
			if( strlen($options['filter']) ){
				switch( $options['filter'] ){
					case 'true':
					case '1':
						$options['filter'] = true;
						break;
					case 'false':
					case '0':
						$options['filter'] = false;
						break;
				}
			}
			return $options;
		};

		switch( $this->command[2] ){
			case 'version':
				$val = $this->px->get_version();
				print $this->data_convert( $val );
				break;
			case 'config':
				$val = $this->px->conf();
				print $this->data_convert( $val );
				break;
			case 'sitemap':
				$val = ($this->px->site() ? $this->px->site()->get_sitemap() : false);
				print $this->data_convert( $val );
				break;
			case 'page_info':
				$path = $this->px->req()->get_param('path');
				if( is_null($path) ){
					$path = $this->px->req()->get_request_file_path();
				}
				$val = ($this->px->site() ? $this->px->site()->get_page_info($path) : false);
				print $this->data_convert( $val );
				break;
			case 'page_originated_csv':
				$path = $this->px->req()->get_param('path');
				if( is_null($path) ){
					$path = $this->px->req()->get_request_file_path();
				}
				$val = ($this->px->site() ? $this->px->site()->get_page_originated_csv($path) : false);
				print $this->data_convert( $val );
				break;
			case 'parent':
				$val = ($this->px->site() ? $this->px->site()->get_parent() : false);
				print $this->data_convert( $val );
				break;
			case 'actors':
				$val = ($this->px->site() ? $this->px->site()->get_actors() : false);
				print $this->data_convert( $val );
				break;
			case 'role':
				$val = ($this->px->site() ? $this->px->site()->get_role() : false);
				print $this->data_convert( $val );
				break;
			case 'children':
				$val = ($this->px->site() ? $this->px->site()->get_children(null, $sitemap_filter_options($this->px, $this->command[2])) : false);
				print $this->data_convert( $val );
				break;
			case 'bros':
				$val = ($this->px->site() ? $this->px->site()->get_bros(null, $sitemap_filter_options($this->px, $this->command[2])) : false);
				print $this->data_convert( $val );
				break;
			case 'bros_next':
				$val = ($this->px->site() ? $this->px->site()->get_bros_next(null, $sitemap_filter_options($this->px, $this->command[2])) : false);
				print $this->data_convert( $val );
				break;
			case 'bros_prev':
				$val = ($this->px->site() ? $this->px->site()->get_bros_prev(null, $sitemap_filter_options($this->px, $this->command[2])) : false);
				print $this->data_convert( $val );
				break;
			case 'next':
				$val = ($this->px->site() ? $this->px->site()->get_next(null, $sitemap_filter_options($this->px, $this->command[2])) : false);
				print $this->data_convert( $val );
				break;
			case 'prev':
				$val = ($this->px->site() ? $this->px->site()->get_prev(null, $sitemap_filter_options($this->px, $this->command[2])) : false);
				print $this->data_convert( $val );
				break;
			case 'breadcrumb_array':
				$val = ($this->px->site() ? $this->px->site()->get_breadcrumb_array() : false);
				print $this->data_convert( $val );
				break;
			case 'dynamic_path_info':
				$val = ($this->px->site() ? $this->px->site()->get_dynamic_path_info($this->px->req()->get_param('path')) : false);
				print $this->data_convert( $val );
				break;
			case 'bind_dynamic_path_param':
				$param = $this->px->req()->get_param('param');
				$param = @json_decode( $param, true );
				$val = ($this->px->site() ? $this->px->site()->bind_dynamic_path_param($this->px->req()->get_param('path'), $param) : false);
				print $this->data_convert( $val );
				unset($param);
				break;
			case 'path_homedir': // deprecated
				$val = $this->px->get_realpath_homedir();
				print $this->data_convert( $val );
				break;
			case 'realpath_homedir':
				$val = $this->px->get_realpath_homedir();
				print $this->data_convert( $val );
				break;
			case 'path_controot':
				$val = $this->px->get_path_controot();
				print $this->data_convert( $val );
				break;
			case 'path_docroot': // deprecated
				$val = $this->px->get_realpath_docroot();
				print $this->data_convert( $val );
				break;
			case 'realpath_docroot':
				$val = $this->px->get_realpath_docroot();
				print $this->data_convert( $val );
				break;
			case 'path_content':
				$val = $this->px->get_path_content();
				print $this->data_convert( $val );
				break;
			case 'path_files':
				$val = ($this->px->site() ? $this->px->path_files($this->px->req()->get_param('path_resource')) : false);
				print $this->data_convert( $val );
				break;
			case 'realpath_files':
				$val = ($this->px->site() ? $this->px->realpath_files($this->px->req()->get_param('path_resource')) : false);
				print $this->data_convert( $val );
				break;
			case 'path_files_cache':
				$val = ($this->px->site() ? $this->px->path_files_cache($this->px->req()->get_param('path_resource')) : false);
				print $this->data_convert( $val );
				break;
			case 'realpath_files_cache':
				$val = ($this->px->site() ? $this->px->realpath_files_cache($this->px->req()->get_param('path_resource')) : false);
				print $this->data_convert( $val );
				break;
			case 'realpath_files_private_cache':
				$val = ($this->px->site() ? $this->px->realpath_files_private_cache($this->px->req()->get_param('path_resource')) : false);
				print $this->data_convert( $val );
				break;
			case 'domain':
				$val = $this->px->get_domain();
				print $this->data_convert( $val );
				break;
			case 'directory_index':
				$val = $this->px->get_directory_index();
				print $this->data_convert( $val );
				break;
			case 'directory_index_primary':
				$val = $this->px->get_directory_index_primary();
				print $this->data_convert( $val );
				break;
			case 'path_proc_type':
				$val = $this->px->get_path_proc_type();
				print $this->data_convert( $val );
				break;
			case 'href':
				$val = ($this->px->site() ? $this->px->href($this->px->req()->get_param('linkto')) : false);
				print $this->data_convert( $val );
				break;
			case 'canonical':
				$val = ($this->px->site() ? $this->px->canonical($this->px->req()->get_param('linkto')) : false);
				print $this->data_convert( $val );
				break;
			default:
				print $this->data_convert( array('result'=>0) );
				break;
		}
		exit;
	}
[API] api.get.*

結果を標準出力した後、`exit()` を発行してスクリプトを終了します。

@return void