The mask of care and love

John McKnight on the service provider’s mask of care and love:

Behind that mask is simply the servicer, his systems, techniques and technologies – a business in need of markets, an economy seeking new growth potential, professionals in need of an income.

It is crucial that we understand that this mask of service is not a false face. The power of the ideology of service is demonstrated by the fact that most servicers cannot distinguish the mask from their own face. The service ideology is not hypocritical because hypocrisy is the false pretence of a desirable goal. The modernized servicer believes in his care and love, perhaps more than even the serviced. The mask is the face. The service ideology is not conspiratorial. A conspiracy is a group decision to create an exploitative result. The modernized servicer honestly joins his fellows to create a supposedly beneficial result. The masks are the faces.

In order to distinguish the mask and the face it is necessary to consider another symbol – need. We say love is a need. Care is a need. Service is a need. Servicers meet needs. People are collections of needs. Society has needs. The economy should be organized to meet needs. In a modernized society where the major business is service, the political reality is that the central “need” is an adequate income for professional servicers and the economic growth they portend. The masks of love and care obscure this reality so that the public cannot recognize the professionalized interests that manufacture needs in order to rationalize a service economy. Medicare, Educare, Judicare, Socialcare and Psychocare are portrayed as systems to meet need rather than programmes to meet the needs of servicers and the economies they support.

Removing the mask of love shows us the face of the servicers who need income, and an economic system that needs growth. Within this framework, the client is less a person in need than a person who is needed. In business terms, the client is less the consumer than the raw material for the servicing system. In management terms, the client becomes both the output and the input. His essential function is to meet the needs of servicers, the servicing system and the national economy. The central political issue becomes the servicers’ capacity to manufacture needs in order to expand the economy of the servicing system.

Excerpt from his essay ‘Personalized Service and Disabling Help’.

Posted in Quotes | Leave a comment

Posted in General | Leave a comment

Term Extraction in PHP

The new version of the term extraction tool on fivefilters.org is now in PHP.

Read the blog post explaining what’s new.

For anyone looking for a simple way to carry out term extraction on English text using PHP, here’s a snippet using the PHP port of Topia’s Term Extractor:

require 'TermExtractor/TermExtractor.php';

$text = 'Politics is the shadow cast on society by big business';

$extractor = new TermExtractor();
$terms = $extractor->extract($text);

// We're outputting results in plain text...
header('Content-Type: text/plain; charset=UTF-8');

// Loop through extracted terms and print each term on a new line
foreach ($terms as $term_info) {
  // index 0: term
  // index 1: number of occurrences in text
  // index 2: word count
  list($term, $occurrence, $word_count) = $term_info;
  echo "$term\n";
}
Posted in Code | Leave a comment

Chris Hedges: Assault on Gaza is Not a War, it is Murder

via Jonathan Cook

Posted in General | Comments closed

PHP DOMDocument replace DOMElement contents with HTML string

This is another StackOverflow answer I’m moving over to my blog.

AWinter asked:

Using PHP I’m attempting to take an HTML string passed from a WYSIWYG editor and replace the children of an element inside of a preloaded HTML document with the new HTML.

So far I’m loading the document identifying the element I want to change by ID but the process to convert an HTML to something that can be placed inside a DOMElement is eluding me.

$doc = new DOMDocument();
$doc->loadHTML($html);

$element = $doc->getElementById($item_id);
if(isset($element)){
    //Remove the old children from the element
    while($element->childNodes->length){
        $element->removeChild($element->firstChild);
    }

    //Need to build the new children from $html_string and append to $element
}

My answer:

If the HTML string can be parsed as XML, you can do this (after clearing the element of all child nodes):

$fragment = $doc->createDocumentFragment();
$fragment->appendXML($html_string);
$element->appendChild($fragment);

If $html_string cannot be parsed as XML, it will fail. If it does, you’ll have to use loadHTML(), which is less strict — but it will add elements around the fragment which you will have to strip.

Unlike PHP, Javascript has the innerHTML property which allows you to do this very easily. I needed something like it for a project so I extended PHP’s DOMElement to include Javascript-like innerHTML access.

With it you can access the innerHTML property and change it just as you would in Javascript:

echo $element->innerHTML;
$elem->innerHTML = 'example';
Posted in Code | Leave a comment